Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
adav80x.c File Reference
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/i2c.h>
#include <linux/spi/spi.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/tlv.h>
#include <sound/soc.h>
#include "adav80x.h"

Go to the source code of this file.

Data Structures

struct  adav80x
 

Macros

#define ADAV80X_PLAYBACK_CTRL   0x04
 
#define ADAV80X_AUX_IN_CTRL   0x05
 
#define ADAV80X_REC_CTRL   0x06
 
#define ADAV80X_AUX_OUT_CTRL   0x07
 
#define ADAV80X_DPATH_CTRL1   0x62
 
#define ADAV80X_DPATH_CTRL2   0x63
 
#define ADAV80X_DAC_CTRL1   0x64
 
#define ADAV80X_DAC_CTRL2   0x65
 
#define ADAV80X_DAC_CTRL3   0x66
 
#define ADAV80X_DAC_L_VOL   0x68
 
#define ADAV80X_DAC_R_VOL   0x69
 
#define ADAV80X_PGA_L_VOL   0x6c
 
#define ADAV80X_PGA_R_VOL   0x6d
 
#define ADAV80X_ADC_CTRL1   0x6e
 
#define ADAV80X_ADC_CTRL2   0x6f
 
#define ADAV80X_ADC_L_VOL   0x70
 
#define ADAV80X_ADC_R_VOL   0x71
 
#define ADAV80X_PLL_CTRL1   0x74
 
#define ADAV80X_PLL_CTRL2   0x75
 
#define ADAV80X_ICLK_CTRL1   0x76
 
#define ADAV80X_ICLK_CTRL2   0x77
 
#define ADAV80X_PLL_CLK_SRC   0x78
 
#define ADAV80X_PLL_OUTE   0x7a
 
#define ADAV80X_PLL_CLK_SRC_PLL_XIN(pll)   0x00
 
#define ADAV80X_PLL_CLK_SRC_PLL_MCLKI(pll)   (0x40 << (pll))
 
#define ADAV80X_PLL_CLK_SRC_PLL_MASK(pll)   (0x40 << (pll))
 
#define ADAV80X_ICLK_CTRL1_DAC_SRC(src)   ((src) << 5)
 
#define ADAV80X_ICLK_CTRL1_ADC_SRC(src)   ((src) << 2)
 
#define ADAV80X_ICLK_CTRL1_ICLK2_SRC(src)   (src)
 
#define ADAV80X_ICLK_CTRL2_ICLK1_SRC(src)   ((src) << 3)
 
#define ADAV80X_PLL_CTRL1_PLLDIV   0x10
 
#define ADAV80X_PLL_CTRL1_PLLPD(pll)   (0x04 << (pll))
 
#define ADAV80X_PLL_CTRL1_XTLPD   0x02
 
#define ADAV80X_PLL_CTRL2_FIELD(pll, x)   ((x) << ((pll) * 4))
 
#define ADAV80X_PLL_CTRL2_FS_48(pll)   ADAV80X_PLL_CTRL2_FIELD((pll), 0x00)
 
#define ADAV80X_PLL_CTRL2_FS_32(pll)   ADAV80X_PLL_CTRL2_FIELD((pll), 0x08)
 
#define ADAV80X_PLL_CTRL2_FS_44(pll)   ADAV80X_PLL_CTRL2_FIELD((pll), 0x0c)
 
#define ADAV80X_PLL_CTRL2_SEL(pll)   ADAV80X_PLL_CTRL2_FIELD((pll), 0x02)
 
#define ADAV80X_PLL_CTRL2_DOUB(pll)   ADAV80X_PLL_CTRL2_FIELD((pll), 0x01)
 
#define ADAV80X_PLL_CTRL2_PLL_MASK(pll)   ADAV80X_PLL_CTRL2_FIELD((pll), 0x0f)
 
#define ADAV80X_ADC_CTRL1_MODULATOR_MASK   0x80
 
#define ADAV80X_ADC_CTRL1_MODULATOR_128FS   0x00
 
#define ADAV80X_ADC_CTRL1_MODULATOR_64FS   0x80
 
#define ADAV80X_DAC_CTRL1_PD   0x80
 
#define ADAV80X_DAC_CTRL2_DIV1   0x00
 
#define ADAV80X_DAC_CTRL2_DIV1_5   0x10
 
#define ADAV80X_DAC_CTRL2_DIV2   0x20
 
#define ADAV80X_DAC_CTRL2_DIV3   0x30
 
#define ADAV80X_DAC_CTRL2_DIV_MASK   0x30
 
#define ADAV80X_DAC_CTRL2_INTERPOL_256FS   0x00
 
#define ADAV80X_DAC_CTRL2_INTERPOL_128FS   0x40
 
#define ADAV80X_DAC_CTRL2_INTERPOL_64FS   0x80
 
#define ADAV80X_DAC_CTRL2_INTERPOL_MASK   0xc0
 
#define ADAV80X_DAC_CTRL2_DEEMPH_NONE   0x00
 
#define ADAV80X_DAC_CTRL2_DEEMPH_44   0x01
 
#define ADAV80X_DAC_CTRL2_DEEMPH_32   0x02
 
#define ADAV80X_DAC_CTRL2_DEEMPH_48   0x03
 
#define ADAV80X_DAC_CTRL2_DEEMPH_MASK   0x01
 
#define ADAV80X_CAPTURE_MODE_MASTER   0x20
 
#define ADAV80X_CAPTURE_WORD_LEN24   0x00
 
#define ADAV80X_CAPTURE_WORD_LEN20   0x04
 
#define ADAV80X_CAPTRUE_WORD_LEN18   0x08
 
#define ADAV80X_CAPTURE_WORD_LEN16   0x0c
 
#define ADAV80X_CAPTURE_WORD_LEN_MASK   0x0c
 
#define ADAV80X_CAPTURE_MODE_LEFT_J   0x00
 
#define ADAV80X_CAPTURE_MODE_I2S   0x01
 
#define ADAV80X_CAPTURE_MODE_RIGHT_J   0x03
 
#define ADAV80X_CAPTURE_MODE_MASK   0x03
 
#define ADAV80X_PLAYBACK_MODE_MASTER   0x10
 
#define ADAV80X_PLAYBACK_MODE_LEFT_J   0x00
 
#define ADAV80X_PLAYBACK_MODE_I2S   0x01
 
#define ADAV80X_PLAYBACK_MODE_RIGHT_J_24   0x04
 
#define ADAV80X_PLAYBACK_MODE_RIGHT_J_20   0x05
 
#define ADAV80X_PLAYBACK_MODE_RIGHT_J_18   0x06
 
#define ADAV80X_PLAYBACK_MODE_RIGHT_J_16   0x07
 
#define ADAV80X_PLAYBACK_MODE_MASK   0x07
 
#define ADAV80X_PLL_OUTE_SYSCLKPD(x)   BIT(2 - (x))
 
#define ADAV80X_MUX_ENUM_DECL(name, reg, shift)
 
#define ADAV80X_MUX(name, ctrl)   SND_SOC_DAPM_VALUE_MUX(name, SND_SOC_NOPM, 0, 0, ctrl)
 
#define ADAV80X_PLAYBACK_RATES
 
#define ADAV80X_CAPTURE_RATES   (SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000)
 
#define ADAV80X_FORMATS
 

Functions

 module_init (adav80x_init)
 
 module_exit (adav80x_exit)
 
 MODULE_DESCRIPTION ("ASoC ADAV80x driver")
 
 MODULE_AUTHOR ("Lars-Peter Clausen <[email protected]>")
 
 MODULE_AUTHOR ("Yi Li <yi.li@analog.com>>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ADAV80X_ADC_CTRL1   0x6e

Definition at line 38 of file adav80x.c.

#define ADAV80X_ADC_CTRL1_MODULATOR_128FS   0x00

Definition at line 73 of file adav80x.c.

#define ADAV80X_ADC_CTRL1_MODULATOR_64FS   0x80

Definition at line 74 of file adav80x.c.

#define ADAV80X_ADC_CTRL1_MODULATOR_MASK   0x80

Definition at line 72 of file adav80x.c.

#define ADAV80X_ADC_CTRL2   0x6f

Definition at line 39 of file adav80x.c.

#define ADAV80X_ADC_L_VOL   0x70

Definition at line 40 of file adav80x.c.

#define ADAV80X_ADC_R_VOL   0x71

Definition at line 41 of file adav80x.c.

#define ADAV80X_AUX_IN_CTRL   0x05

Definition at line 26 of file adav80x.c.

#define ADAV80X_AUX_OUT_CTRL   0x07

Definition at line 28 of file adav80x.c.

#define ADAV80X_CAPTRUE_WORD_LEN18   0x08

Definition at line 98 of file adav80x.c.

#define ADAV80X_CAPTURE_MODE_I2S   0x01

Definition at line 103 of file adav80x.c.

#define ADAV80X_CAPTURE_MODE_LEFT_J   0x00

Definition at line 102 of file adav80x.c.

#define ADAV80X_CAPTURE_MODE_MASK   0x03

Definition at line 105 of file adav80x.c.

#define ADAV80X_CAPTURE_MODE_MASTER   0x20

Definition at line 95 of file adav80x.c.

#define ADAV80X_CAPTURE_MODE_RIGHT_J   0x03

Definition at line 104 of file adav80x.c.

#define ADAV80X_CAPTURE_RATES   (SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000)

Definition at line 732 of file adav80x.c.

#define ADAV80X_CAPTURE_WORD_LEN16   0x0c

Definition at line 99 of file adav80x.c.

#define ADAV80X_CAPTURE_WORD_LEN20   0x04

Definition at line 97 of file adav80x.c.

#define ADAV80X_CAPTURE_WORD_LEN24   0x00

Definition at line 96 of file adav80x.c.

#define ADAV80X_CAPTURE_WORD_LEN_MASK   0x0c

Definition at line 100 of file adav80x.c.

#define ADAV80X_DAC_CTRL1   0x64

Definition at line 31 of file adav80x.c.

#define ADAV80X_DAC_CTRL1_PD   0x80

Definition at line 76 of file adav80x.c.

#define ADAV80X_DAC_CTRL2   0x65

Definition at line 32 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_DEEMPH_32   0x02

Definition at line 91 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_DEEMPH_44   0x01

Definition at line 90 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_DEEMPH_48   0x03

Definition at line 92 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_DEEMPH_MASK   0x01

Definition at line 93 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_DEEMPH_NONE   0x00

Definition at line 89 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_DIV1   0x00

Definition at line 78 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_DIV1_5   0x10

Definition at line 79 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_DIV2   0x20

Definition at line 80 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_DIV3   0x30

Definition at line 81 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_DIV_MASK   0x30

Definition at line 82 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_INTERPOL_128FS   0x40

Definition at line 85 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_INTERPOL_256FS   0x00

Definition at line 84 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_INTERPOL_64FS   0x80

Definition at line 86 of file adav80x.c.

#define ADAV80X_DAC_CTRL2_INTERPOL_MASK   0xc0

Definition at line 87 of file adav80x.c.

#define ADAV80X_DAC_CTRL3   0x66

Definition at line 33 of file adav80x.c.

#define ADAV80X_DAC_L_VOL   0x68

Definition at line 34 of file adav80x.c.

#define ADAV80X_DAC_R_VOL   0x69

Definition at line 35 of file adav80x.c.

#define ADAV80X_DPATH_CTRL1   0x62

Definition at line 29 of file adav80x.c.

#define ADAV80X_DPATH_CTRL2   0x63

Definition at line 30 of file adav80x.c.

#define ADAV80X_FORMATS
Value:

Definition at line 734 of file adav80x.c.

#define ADAV80X_ICLK_CTRL1   0x76

Definition at line 44 of file adav80x.c.

#define ADAV80X_ICLK_CTRL1_ADC_SRC (   src)    ((src) << 2)

Definition at line 54 of file adav80x.c.

#define ADAV80X_ICLK_CTRL1_DAC_SRC (   src)    ((src) << 5)

Definition at line 53 of file adav80x.c.

#define ADAV80X_ICLK_CTRL1_ICLK2_SRC (   src)    (src)

Definition at line 55 of file adav80x.c.

#define ADAV80X_ICLK_CTRL2   0x77

Definition at line 45 of file adav80x.c.

#define ADAV80X_ICLK_CTRL2_ICLK1_SRC (   src)    ((src) << 3)

Definition at line 56 of file adav80x.c.

#define ADAV80X_MUX (   name,
  ctrl 
)    SND_SOC_DAPM_VALUE_MUX(name, SND_SOC_NOPM, 0, 0, ctrl)

Definition at line 171 of file adav80x.c.

#define ADAV80X_MUX_ENUM_DECL (   name,
  reg,
  shift 
)
Value:
ARRAY_SIZE(adav80x_mux_text), adav80x_mux_text, \
adav80x_mux_values)

Definition at line 155 of file adav80x.c.

#define ADAV80X_PGA_L_VOL   0x6c

Definition at line 36 of file adav80x.c.

#define ADAV80X_PGA_R_VOL   0x6d

Definition at line 37 of file adav80x.c.

#define ADAV80X_PLAYBACK_CTRL   0x04

Definition at line 25 of file adav80x.c.

#define ADAV80X_PLAYBACK_MODE_I2S   0x01

Definition at line 109 of file adav80x.c.

#define ADAV80X_PLAYBACK_MODE_LEFT_J   0x00

Definition at line 108 of file adav80x.c.

#define ADAV80X_PLAYBACK_MODE_MASK   0x07

Definition at line 114 of file adav80x.c.

#define ADAV80X_PLAYBACK_MODE_MASTER   0x10

Definition at line 107 of file adav80x.c.

#define ADAV80X_PLAYBACK_MODE_RIGHT_J_16   0x07

Definition at line 113 of file adav80x.c.

#define ADAV80X_PLAYBACK_MODE_RIGHT_J_18   0x06

Definition at line 112 of file adav80x.c.

#define ADAV80X_PLAYBACK_MODE_RIGHT_J_20   0x05

Definition at line 111 of file adav80x.c.

#define ADAV80X_PLAYBACK_MODE_RIGHT_J_24   0x04

Definition at line 110 of file adav80x.c.

#define ADAV80X_PLAYBACK_RATES
Value:
SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | SNDRV_PCM_RATE_88200 | \
SNDRV_PCM_RATE_96000)

Definition at line 728 of file adav80x.c.

#define ADAV80X_PLL_CLK_SRC   0x78

Definition at line 46 of file adav80x.c.

#define ADAV80X_PLL_CLK_SRC_PLL_MASK (   pll)    (0x40 << (pll))

Definition at line 51 of file adav80x.c.

#define ADAV80X_PLL_CLK_SRC_PLL_MCLKI (   pll)    (0x40 << (pll))

Definition at line 50 of file adav80x.c.

#define ADAV80X_PLL_CLK_SRC_PLL_XIN (   pll)    0x00

Definition at line 49 of file adav80x.c.

#define ADAV80X_PLL_CTRL1   0x74

Definition at line 42 of file adav80x.c.

#define ADAV80X_PLL_CTRL1_PLLDIV   0x10

Definition at line 58 of file adav80x.c.

#define ADAV80X_PLL_CTRL1_PLLPD (   pll)    (0x04 << (pll))

Definition at line 59 of file adav80x.c.

#define ADAV80X_PLL_CTRL1_XTLPD   0x02

Definition at line 60 of file adav80x.c.

#define ADAV80X_PLL_CTRL2   0x75

Definition at line 43 of file adav80x.c.

#define ADAV80X_PLL_CTRL2_DOUB (   pll)    ADAV80X_PLL_CTRL2_FIELD((pll), 0x01)

Definition at line 69 of file adav80x.c.

#define ADAV80X_PLL_CTRL2_FIELD (   pll,
  x 
)    ((x) << ((pll) * 4))

Definition at line 62 of file adav80x.c.

#define ADAV80X_PLL_CTRL2_FS_32 (   pll)    ADAV80X_PLL_CTRL2_FIELD((pll), 0x08)

Definition at line 65 of file adav80x.c.

#define ADAV80X_PLL_CTRL2_FS_44 (   pll)    ADAV80X_PLL_CTRL2_FIELD((pll), 0x0c)

Definition at line 66 of file adav80x.c.

#define ADAV80X_PLL_CTRL2_FS_48 (   pll)    ADAV80X_PLL_CTRL2_FIELD((pll), 0x00)

Definition at line 64 of file adav80x.c.

#define ADAV80X_PLL_CTRL2_PLL_MASK (   pll)    ADAV80X_PLL_CTRL2_FIELD((pll), 0x0f)

Definition at line 70 of file adav80x.c.

#define ADAV80X_PLL_CTRL2_SEL (   pll)    ADAV80X_PLL_CTRL2_FIELD((pll), 0x02)

Definition at line 68 of file adav80x.c.

#define ADAV80X_PLL_OUTE   0x7a

Definition at line 47 of file adav80x.c.

#define ADAV80X_PLL_OUTE_SYSCLKPD (   x)    BIT(2 - (x))

Definition at line 116 of file adav80x.c.

#define ADAV80X_REC_CTRL   0x06

Definition at line 27 of file adav80x.c.

Function Documentation

MODULE_AUTHOR ( "Lars-Peter Clausen <[email protected]>"  )
MODULE_AUTHOR ( "Yi Li <yi.li@analog.com>  ,
 
)
MODULE_DESCRIPTION ( "ASoC ADAV80x driver )
module_exit ( adav80x_exit  )
module_init ( adav80x_init  )
MODULE_LICENSE ( "GPL"  )