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

Go to the source code of this file.

Data Structures

struct  pll_div
 
struct  da7210_priv
 

Macros

#define DA7210_PAGE_CONTROL   0x00
 
#define DA7210_CONTROL   0x01
 
#define DA7210_STATUS   0x02
 
#define DA7210_STARTUP1   0x03
 
#define DA7210_STARTUP2   0x04
 
#define DA7210_STARTUP3   0x05
 
#define DA7210_MIC_L   0x07
 
#define DA7210_MIC_R   0x08
 
#define DA7210_AUX1_L   0x09
 
#define DA7210_AUX1_R   0x0A
 
#define DA7210_AUX2   0x0B
 
#define DA7210_IN_GAIN   0x0C
 
#define DA7210_INMIX_L   0x0D
 
#define DA7210_INMIX_R   0x0E
 
#define DA7210_ADC_HPF   0x0F
 
#define DA7210_ADC   0x10
 
#define DA7210_ADC_EQ1_2   0X11
 
#define DA7210_ADC_EQ3_4   0x12
 
#define DA7210_ADC_EQ5   0x13
 
#define DA7210_DAC_HPF   0x14
 
#define DA7210_DAC_L   0x15
 
#define DA7210_DAC_R   0x16
 
#define DA7210_DAC_SEL   0x17
 
#define DA7210_SOFTMUTE   0x18
 
#define DA7210_DAC_EQ1_2   0x19
 
#define DA7210_DAC_EQ3_4   0x1A
 
#define DA7210_DAC_EQ5   0x1B
 
#define DA7210_OUTMIX_L   0x1C
 
#define DA7210_OUTMIX_R   0x1D
 
#define DA7210_OUT1_L   0x1E
 
#define DA7210_OUT1_R   0x1F
 
#define DA7210_OUT2   0x20
 
#define DA7210_HP_L_VOL   0x21
 
#define DA7210_HP_R_VOL   0x22
 
#define DA7210_HP_CFG   0x23
 
#define DA7210_ZERO_CROSS   0x24
 
#define DA7210_DAI_SRC_SEL   0x25
 
#define DA7210_DAI_CFG1   0x26
 
#define DA7210_DAI_CFG3   0x28
 
#define DA7210_PLL_DIV1   0x29
 
#define DA7210_PLL_DIV2   0x2A
 
#define DA7210_PLL_DIV3   0x2B
 
#define DA7210_PLL   0x2C
 
#define DA7210_ALC_MAX   0x83
 
#define DA7210_ALC_MIN   0x84
 
#define DA7210_ALC_NOIS   0x85
 
#define DA7210_ALC_ATT   0x86
 
#define DA7210_ALC_REL   0x87
 
#define DA7210_ALC_DEL   0x88
 
#define DA7210_A_HID_UNLOCK   0x8A
 
#define DA7210_A_TEST_UNLOCK   0x8B
 
#define DA7210_A_PLL1   0x90
 
#define DA7210_A_CP_MODE   0xA7
 
#define DA7210_SC_MST_EN   (1 << 0)
 
#define DA7210_MICBIAS_EN   (1 << 6)
 
#define DA7210_MIC_L_EN   (1 << 7)
 
#define DA7210_MIC_R_EN   (1 << 7)
 
#define DA7210_IN_L_EN   (1 << 7)
 
#define DA7210_IN_R_EN   (1 << 7)
 
#define DA7210_ADC_ALC_EN   (1 << 0)
 
#define DA7210_ADC_L_EN   (1 << 3)
 
#define DA7210_ADC_R_EN   (1 << 7)
 
#define DA7210_VOICE_F0_MASK   (0x7 << 4)
 
#define DA7210_VOICE_F0_25   (1 << 4)
 
#define DA7210_VOICE_EN   (1 << 7)
 
#define DA7210_DAC_L_SRC_DAI_L   (4 << 0)
 
#define DA7210_DAC_L_EN   (1 << 3)
 
#define DA7210_DAC_R_SRC_DAI_R   (5 << 4)
 
#define DA7210_DAC_R_EN   (1 << 7)
 
#define DA7210_OUT_L_EN   (1 << 7)
 
#define DA7210_OUT_R_EN   (1 << 7)
 
#define DA7210_HP_2CAP_MODE   (1 << 1)
 
#define DA7210_HP_SENSE_EN   (1 << 2)
 
#define DA7210_HP_L_EN   (1 << 3)
 
#define DA7210_HP_MODE   (1 << 6)
 
#define DA7210_HP_R_EN   (1 << 7)
 
#define DA7210_DAI_OUT_L_SRC   (6 << 0)
 
#define DA7210_DAI_OUT_R_SRC   (7 << 4)
 
#define DA7210_DAI_WORD_S16_LE   (0 << 0)
 
#define DA7210_DAI_WORD_S20_3LE   (1 << 0)
 
#define DA7210_DAI_WORD_S24_LE   (2 << 0)
 
#define DA7210_DAI_WORD_S32_LE   (3 << 0)
 
#define DA7210_DAI_FLEN_64BIT   (1 << 2)
 
#define DA7210_DAI_MODE_SLAVE   (0 << 7)
 
#define DA7210_DAI_MODE_MASTER   (1 << 7)
 
#define DA7210_DAI_FORMAT_I2SMODE   (0 << 0)
 
#define DA7210_DAI_FORMAT_LEFT_J   (1 << 0)
 
#define DA7210_DAI_FORMAT_RIGHT_J   (2 << 0)
 
#define DA7210_DAI_OE   (1 << 3)
 
#define DA7210_DAI_EN   (1 << 7)
 
#define DA7210_PLL_DIV_L_MASK   (0xF << 0)
 
#define DA7210_MCLK_RANGE_10_20_MHZ   (1 << 4)
 
#define DA7210_PLL_BYP   (1 << 6)
 
#define DA7210_PLL_FS_MASK   (0xF << 0)
 
#define DA7210_PLL_FS_8000   (0x1 << 0)
 
#define DA7210_PLL_FS_11025   (0x2 << 0)
 
#define DA7210_PLL_FS_12000   (0x3 << 0)
 
#define DA7210_PLL_FS_16000   (0x5 << 0)
 
#define DA7210_PLL_FS_22050   (0x6 << 0)
 
#define DA7210_PLL_FS_24000   (0x7 << 0)
 
#define DA7210_PLL_FS_32000   (0x9 << 0)
 
#define DA7210_PLL_FS_44100   (0xA << 0)
 
#define DA7210_PLL_FS_48000   (0xB << 0)
 
#define DA7210_PLL_FS_88200   (0xE << 0)
 
#define DA7210_PLL_FS_96000   (0xF << 0)
 
#define DA7210_MCLK_DET_EN   (0x1 << 5)
 
#define DA7210_MCLK_SRM_EN   (0x1 << 6)
 
#define DA7210_PLL_EN   (0x1 << 7)
 
#define DA7210_RAMP_EN   (1 << 6)
 
#define DA7210_REG_EN   (1 << 0)
 
#define DA7210_BIAS_EN   (1 << 2)
 
#define DA7210_NOISE_SUP_EN   (1 << 3)
 
#define DA7210_INPGA_L_VOL   (0x0F << 0)
 
#define DA7210_INPGA_R_VOL   (0xF0 << 0)
 
#define DA7210_AUX1_L_ZC   (1 << 0)
 
#define DA7210_AUX1_R_ZC   (1 << 1)
 
#define DA7210_HP_L_ZC   (1 << 6)
 
#define DA7210_HP_R_ZC   (1 << 7)
 
#define DA7210_AUX1_L_VOL   (0x3F << 0)
 
#define DA7210_AUX1_L_EN   (1 << 7)
 
#define DA7210_AUX1_R_VOL   (0x3F << 0)
 
#define DA7210_AUX1_R_EN   (1 << 7)
 
#define DA7210_AUX2_EN   (1 << 3)
 
#define DA7210_INPGA_MIN_VOL_NS   0x0A /* 10.5dB */
 
#define DA7210_AUX1_MIN_VOL_NS   0x35 /* 6dB */
 
#define DA7210_OUT1_L_EN   (1 << 7)
 
#define DA7210_OUT1_R_EN   (1 << 7)
 
#define DA7210_OUT2_OUTMIX_R   (1 << 5)
 
#define DA7210_OUT2_OUTMIX_L   (1 << 6)
 
#define DA7210_OUT2_EN   (1 << 7)
 
#define DA7210_VERSION   "0.0.1"
 
#define DA7210_FORMATS
 

Enumerations

enum  clk_src {
  clk_src_crystal, clk_src_href, clk_src_hclk, clk_src_hclkm3,
  clk_src_hclkm3d2, clk_src_host, clk_src_nvclk, clk_src_sclk,
  clk_src_mclk, clk_src_vdec, clk_src_dom6, DA7210_CLKSRC_MCLK,
  DA9055_CLKSRC_MCLK, WM8983_CLKSRC_MCLK, WM8983_CLKSRC_PLL, WM8985_CLKSRC_MCLK,
  WM8985_CLKSRC_PLL, WM8995_SYSCLK_MCLK1 = 1, WM8995_SYSCLK_MCLK2, WM8995_SYSCLK_FLL1,
  WM8995_SYSCLK_FLL2, WM8995_SYSCLK_OPCLK
}
 

Functions

 module_init (da7210_modinit)
 
 module_exit (da7210_exit)
 
 MODULE_DESCRIPTION ("ASoC DA7210 driver")
 
 MODULE_AUTHOR ("David Chen, Kuninori Morimoto")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define DA7210_A_CP_MODE   0xA7

Definition at line 83 of file da7210.c.

#define DA7210_A_HID_UNLOCK   0x8A

Definition at line 80 of file da7210.c.

#define DA7210_A_PLL1   0x90

Definition at line 82 of file da7210.c.

#define DA7210_A_TEST_UNLOCK   0x8B

Definition at line 81 of file da7210.c.

#define DA7210_ADC   0x10

Definition at line 46 of file da7210.c.

#define DA7210_ADC_ALC_EN   (1 << 0)

Definition at line 102 of file da7210.c.

#define DA7210_ADC_EQ1_2   0X11

Definition at line 47 of file da7210.c.

#define DA7210_ADC_EQ3_4   0x12

Definition at line 48 of file da7210.c.

#define DA7210_ADC_EQ5   0x13

Definition at line 49 of file da7210.c.

#define DA7210_ADC_HPF   0x0F

Definition at line 45 of file da7210.c.

#define DA7210_ADC_L_EN   (1 << 3)

Definition at line 103 of file da7210.c.

#define DA7210_ADC_R_EN   (1 << 7)

Definition at line 104 of file da7210.c.

#define DA7210_ALC_ATT   0x86

Definition at line 77 of file da7210.c.

#define DA7210_ALC_DEL   0x88

Definition at line 79 of file da7210.c.

#define DA7210_ALC_MAX   0x83

Definition at line 74 of file da7210.c.

#define DA7210_ALC_MIN   0x84

Definition at line 75 of file da7210.c.

#define DA7210_ALC_NOIS   0x85

Definition at line 76 of file da7210.c.

#define DA7210_ALC_REL   0x87

Definition at line 78 of file da7210.c.

#define DA7210_AUX1_L   0x09

Definition at line 39 of file da7210.c.

#define DA7210_AUX1_L_EN   (1 << 7)

Definition at line 192 of file da7210.c.

#define DA7210_AUX1_L_VOL   (0x3F << 0)

Definition at line 191 of file da7210.c.

#define DA7210_AUX1_L_ZC   (1 << 0)

Definition at line 185 of file da7210.c.

#define DA7210_AUX1_MIN_VOL_NS   0x35 /* 6dB */

Definition at line 203 of file da7210.c.

#define DA7210_AUX1_R   0x0A

Definition at line 40 of file da7210.c.

#define DA7210_AUX1_R_EN   (1 << 7)

Definition at line 196 of file da7210.c.

#define DA7210_AUX1_R_VOL   (0x3F << 0)

Definition at line 195 of file da7210.c.

#define DA7210_AUX1_R_ZC   (1 << 1)

Definition at line 186 of file da7210.c.

#define DA7210_AUX2   0x0B

Definition at line 41 of file da7210.c.

#define DA7210_AUX2_EN   (1 << 3)

Definition at line 199 of file da7210.c.

#define DA7210_BIAS_EN   (1 << 2)

Definition at line 177 of file da7210.c.

#define DA7210_CONTROL   0x01

Definition at line 32 of file da7210.c.

#define DA7210_DAC_EQ1_2   0x19

Definition at line 55 of file da7210.c.

#define DA7210_DAC_EQ3_4   0x1A

Definition at line 56 of file da7210.c.

#define DA7210_DAC_EQ5   0x1B

Definition at line 57 of file da7210.c.

#define DA7210_DAC_HPF   0x14

Definition at line 50 of file da7210.c.

#define DA7210_DAC_L   0x15

Definition at line 51 of file da7210.c.

#define DA7210_DAC_L_EN   (1 << 3)

Definition at line 113 of file da7210.c.

#define DA7210_DAC_L_SRC_DAI_L   (4 << 0)

Definition at line 112 of file da7210.c.

#define DA7210_DAC_R   0x16

Definition at line 52 of file da7210.c.

#define DA7210_DAC_R_EN   (1 << 7)

Definition at line 115 of file da7210.c.

#define DA7210_DAC_R_SRC_DAI_R   (5 << 4)

Definition at line 114 of file da7210.c.

#define DA7210_DAC_SEL   0x17

Definition at line 53 of file da7210.c.

#define DA7210_DAI_CFG1   0x26

Definition at line 68 of file da7210.c.

#define DA7210_DAI_CFG3   0x28

Definition at line 69 of file da7210.c.

#define DA7210_DAI_EN   (1 << 7)

Definition at line 148 of file da7210.c.

#define DA7210_DAI_FLEN_64BIT   (1 << 2)

Definition at line 139 of file da7210.c.

#define DA7210_DAI_FORMAT_I2SMODE   (0 << 0)

Definition at line 144 of file da7210.c.

#define DA7210_DAI_FORMAT_LEFT_J   (1 << 0)

Definition at line 145 of file da7210.c.

#define DA7210_DAI_FORMAT_RIGHT_J   (2 << 0)

Definition at line 146 of file da7210.c.

#define DA7210_DAI_MODE_MASTER   (1 << 7)

Definition at line 141 of file da7210.c.

#define DA7210_DAI_MODE_SLAVE   (0 << 7)

Definition at line 140 of file da7210.c.

#define DA7210_DAI_OE   (1 << 3)

Definition at line 147 of file da7210.c.

#define DA7210_DAI_OUT_L_SRC   (6 << 0)

Definition at line 131 of file da7210.c.

#define DA7210_DAI_OUT_R_SRC   (7 << 4)

Definition at line 132 of file da7210.c.

#define DA7210_DAI_SRC_SEL   0x25

Definition at line 67 of file da7210.c.

#define DA7210_DAI_WORD_S16_LE   (0 << 0)

Definition at line 135 of file da7210.c.

#define DA7210_DAI_WORD_S20_3LE   (1 << 0)

Definition at line 136 of file da7210.c.

#define DA7210_DAI_WORD_S24_LE   (2 << 0)

Definition at line 137 of file da7210.c.

#define DA7210_DAI_WORD_S32_LE   (3 << 0)

Definition at line 138 of file da7210.c.

#define DA7210_FORMATS
Value:

Definition at line 948 of file da7210.c.

#define DA7210_HP_2CAP_MODE   (1 << 1)

Definition at line 124 of file da7210.c.

#define DA7210_HP_CFG   0x23

Definition at line 65 of file da7210.c.

#define DA7210_HP_L_EN   (1 << 3)

Definition at line 126 of file da7210.c.

#define DA7210_HP_L_VOL   0x21

Definition at line 63 of file da7210.c.

#define DA7210_HP_L_ZC   (1 << 6)

Definition at line 187 of file da7210.c.

#define DA7210_HP_MODE   (1 << 6)

Definition at line 127 of file da7210.c.

#define DA7210_HP_R_EN   (1 << 7)

Definition at line 128 of file da7210.c.

#define DA7210_HP_R_VOL   0x22

Definition at line 64 of file da7210.c.

#define DA7210_HP_R_ZC   (1 << 7)

Definition at line 188 of file da7210.c.

#define DA7210_HP_SENSE_EN   (1 << 2)

Definition at line 125 of file da7210.c.

#define DA7210_IN_GAIN   0x0C

Definition at line 42 of file da7210.c.

#define DA7210_IN_L_EN   (1 << 7)

Definition at line 96 of file da7210.c.

#define DA7210_IN_R_EN   (1 << 7)

Definition at line 99 of file da7210.c.

#define DA7210_INMIX_L   0x0D

Definition at line 43 of file da7210.c.

#define DA7210_INMIX_R   0x0E

Definition at line 44 of file da7210.c.

#define DA7210_INPGA_L_VOL   (0x0F << 0)

Definition at line 181 of file da7210.c.

#define DA7210_INPGA_MIN_VOL_NS   0x0A /* 10.5dB */

Definition at line 202 of file da7210.c.

#define DA7210_INPGA_R_VOL   (0xF0 << 0)

Definition at line 182 of file da7210.c.

#define DA7210_MCLK_DET_EN   (0x1 << 5)

Definition at line 168 of file da7210.c.

#define DA7210_MCLK_RANGE_10_20_MHZ   (1 << 4)

Definition at line 152 of file da7210.c.

#define DA7210_MCLK_SRM_EN   (0x1 << 6)

Definition at line 169 of file da7210.c.

#define DA7210_MIC_L   0x07

Definition at line 37 of file da7210.c.

#define DA7210_MIC_L_EN   (1 << 7)

Definition at line 90 of file da7210.c.

#define DA7210_MIC_R   0x08

Definition at line 38 of file da7210.c.

#define DA7210_MIC_R_EN   (1 << 7)

Definition at line 93 of file da7210.c.

#define DA7210_MICBIAS_EN   (1 << 6)

Definition at line 89 of file da7210.c.

#define DA7210_NOISE_SUP_EN   (1 << 3)

Definition at line 178 of file da7210.c.

#define DA7210_OUT1_L   0x1E

Definition at line 60 of file da7210.c.

#define DA7210_OUT1_L_EN   (1 << 7)

Definition at line 206 of file da7210.c.

#define DA7210_OUT1_R   0x1F

Definition at line 61 of file da7210.c.

#define DA7210_OUT1_R_EN   (1 << 7)

Definition at line 209 of file da7210.c.

#define DA7210_OUT2   0x20

Definition at line 62 of file da7210.c.

#define DA7210_OUT2_EN   (1 << 7)

Definition at line 214 of file da7210.c.

#define DA7210_OUT2_OUTMIX_L   (1 << 6)

Definition at line 213 of file da7210.c.

#define DA7210_OUT2_OUTMIX_R   (1 << 5)

Definition at line 212 of file da7210.c.

#define DA7210_OUT_L_EN   (1 << 7)

Definition at line 118 of file da7210.c.

#define DA7210_OUT_R_EN   (1 << 7)

Definition at line 121 of file da7210.c.

#define DA7210_OUTMIX_L   0x1C

Definition at line 58 of file da7210.c.

#define DA7210_OUTMIX_R   0x1D

Definition at line 59 of file da7210.c.

#define DA7210_PAGE_CONTROL   0x00

Definition at line 31 of file da7210.c.

#define DA7210_PLL   0x2C

Definition at line 73 of file da7210.c.

#define DA7210_PLL_BYP   (1 << 6)

Definition at line 153 of file da7210.c.

#define DA7210_PLL_DIV1   0x29

Definition at line 70 of file da7210.c.

#define DA7210_PLL_DIV2   0x2A

Definition at line 71 of file da7210.c.

#define DA7210_PLL_DIV3   0x2B

Definition at line 72 of file da7210.c.

#define DA7210_PLL_DIV_L_MASK   (0xF << 0)

Definition at line 151 of file da7210.c.

#define DA7210_PLL_EN   (0x1 << 7)

Definition at line 170 of file da7210.c.

#define DA7210_PLL_FS_11025   (0x2 << 0)

Definition at line 158 of file da7210.c.

#define DA7210_PLL_FS_12000   (0x3 << 0)

Definition at line 159 of file da7210.c.

#define DA7210_PLL_FS_16000   (0x5 << 0)

Definition at line 160 of file da7210.c.

#define DA7210_PLL_FS_22050   (0x6 << 0)

Definition at line 161 of file da7210.c.

#define DA7210_PLL_FS_24000   (0x7 << 0)

Definition at line 162 of file da7210.c.

#define DA7210_PLL_FS_32000   (0x9 << 0)

Definition at line 163 of file da7210.c.

#define DA7210_PLL_FS_44100   (0xA << 0)

Definition at line 164 of file da7210.c.

#define DA7210_PLL_FS_48000   (0xB << 0)

Definition at line 165 of file da7210.c.

#define DA7210_PLL_FS_8000   (0x1 << 0)

Definition at line 157 of file da7210.c.

#define DA7210_PLL_FS_88200   (0xE << 0)

Definition at line 166 of file da7210.c.

#define DA7210_PLL_FS_96000   (0xF << 0)

Definition at line 167 of file da7210.c.

#define DA7210_PLL_FS_MASK   (0xF << 0)

Definition at line 156 of file da7210.c.

#define DA7210_RAMP_EN   (1 << 6)

Definition at line 173 of file da7210.c.

#define DA7210_REG_EN   (1 << 0)

Definition at line 176 of file da7210.c.

#define DA7210_SC_MST_EN   (1 << 0)

Definition at line 86 of file da7210.c.

#define DA7210_SOFTMUTE   0x18

Definition at line 54 of file da7210.c.

#define DA7210_STARTUP1   0x03

Definition at line 34 of file da7210.c.

#define DA7210_STARTUP2   0x04

Definition at line 35 of file da7210.c.

#define DA7210_STARTUP3   0x05

Definition at line 36 of file da7210.c.

#define DA7210_STATUS   0x02

Definition at line 33 of file da7210.c.

#define DA7210_VERSION   "0.0.1"

Definition at line 257 of file da7210.c.

#define DA7210_VOICE_EN   (1 << 7)

Definition at line 109 of file da7210.c.

#define DA7210_VOICE_F0_25   (1 << 4)

Definition at line 108 of file da7210.c.

#define DA7210_VOICE_F0_MASK   (0x7 << 4)

Definition at line 107 of file da7210.c.

#define DA7210_ZERO_CROSS   0x24

Definition at line 66 of file da7210.c.

Enumeration Type Documentation

enum clk_src
Enumerator:
clk_src_crystal 
clk_src_href 
clk_src_hclk 
clk_src_hclkm3 
clk_src_hclkm3d2 
clk_src_host 
clk_src_nvclk 
clk_src_sclk 
clk_src_mclk 
clk_src_vdec 
clk_src_dom6 
DA7210_CLKSRC_MCLK 
DA9055_CLKSRC_MCLK 
WM8983_CLKSRC_MCLK 
WM8983_CLKSRC_PLL 
WM8985_CLKSRC_MCLK 
WM8985_CLKSRC_PLL 
WM8995_SYSCLK_MCLK1 
WM8995_SYSCLK_MCLK2 
WM8995_SYSCLK_FLL1 
WM8995_SYSCLK_FLL2 
WM8995_SYSCLK_OPCLK 

Definition at line 253 of file da7210.c.

Function Documentation

MODULE_AUTHOR ( "David  Chen,
Kuninori Morimoto"   
)
MODULE_DESCRIPTION ( "ASoC DA7210 driver )
module_exit ( da7210_exit  )
module_init ( da7210_modinit  )
MODULE_LICENSE ( "GPL"  )