xref: /linux/sound/soc/codecs/da7213.h (revision d2912cb15bdda8ba4a5dd73396ad62641af2f520)
1*d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2ef5c2ebaSAdam Thomson /*
3ef5c2ebaSAdam Thomson  * da7213.h - DA7213 ASoC Codec Driver
4ef5c2ebaSAdam Thomson  *
5ef5c2ebaSAdam Thomson  * Copyright (c) 2013 Dialog Semiconductor
6ef5c2ebaSAdam Thomson  *
7ef5c2ebaSAdam Thomson  * Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
8ef5c2ebaSAdam Thomson  */
9ef5c2ebaSAdam Thomson 
10ef5c2ebaSAdam Thomson #ifndef _DA7213_H
11ef5c2ebaSAdam Thomson #define _DA7213_H
12ef5c2ebaSAdam Thomson 
136e7c4443SAdam Thomson #include <linux/clk.h>
14ef5c2ebaSAdam Thomson #include <linux/regmap.h>
15ef5c2ebaSAdam Thomson #include <sound/da7213.h>
16ef5c2ebaSAdam Thomson 
17ef5c2ebaSAdam Thomson /*
18ef5c2ebaSAdam Thomson  * Registers
19ef5c2ebaSAdam Thomson  */
20ef5c2ebaSAdam Thomson 
21ef5c2ebaSAdam Thomson /* Status Registers */
22ef5c2ebaSAdam Thomson #define DA7213_STATUS1			0x02
23ef5c2ebaSAdam Thomson #define DA7213_PLL_STATUS		0x03
24ef5c2ebaSAdam Thomson #define DA7213_AUX_L_GAIN_STATUS	0x04
25ef5c2ebaSAdam Thomson #define DA7213_AUX_R_GAIN_STATUS	0x05
26ef5c2ebaSAdam Thomson #define DA7213_MIC_1_GAIN_STATUS	0x06
27ef5c2ebaSAdam Thomson #define DA7213_MIC_2_GAIN_STATUS	0x07
28ef5c2ebaSAdam Thomson #define DA7213_MIXIN_L_GAIN_STATUS	0x08
29ef5c2ebaSAdam Thomson #define DA7213_MIXIN_R_GAIN_STATUS	0x09
30ef5c2ebaSAdam Thomson #define DA7213_ADC_L_GAIN_STATUS	0x0A
31ef5c2ebaSAdam Thomson #define DA7213_ADC_R_GAIN_STATUS	0x0B
32ef5c2ebaSAdam Thomson #define DA7213_DAC_L_GAIN_STATUS	0x0C
33ef5c2ebaSAdam Thomson #define DA7213_DAC_R_GAIN_STATUS	0x0D
34ef5c2ebaSAdam Thomson #define DA7213_HP_L_GAIN_STATUS		0x0E
35ef5c2ebaSAdam Thomson #define DA7213_HP_R_GAIN_STATUS		0x0F
36ef5c2ebaSAdam Thomson #define DA7213_LINE_GAIN_STATUS		0x10
37ef5c2ebaSAdam Thomson 
38ef5c2ebaSAdam Thomson /* System Initialisation Registers */
39ef5c2ebaSAdam Thomson #define DA7213_DIG_ROUTING_DAI		0x21
40ef5c2ebaSAdam Thomson #define DA7213_SR			0x22
41ef5c2ebaSAdam Thomson #define DA7213_REFERENCES		0x23
42ef5c2ebaSAdam Thomson #define DA7213_PLL_FRAC_TOP		0x24
43ef5c2ebaSAdam Thomson #define DA7213_PLL_FRAC_BOT		0x25
44ef5c2ebaSAdam Thomson #define DA7213_PLL_INTEGER		0x26
45ef5c2ebaSAdam Thomson #define DA7213_PLL_CTRL			0x27
46ef5c2ebaSAdam Thomson #define DA7213_DAI_CLK_MODE		0x28
47ef5c2ebaSAdam Thomson #define DA7213_DAI_CTRL			0x29
48ef5c2ebaSAdam Thomson #define DA7213_DIG_ROUTING_DAC		0x2A
49ef5c2ebaSAdam Thomson #define DA7213_ALC_CTRL1		0x2B
50ef5c2ebaSAdam Thomson 
51ef5c2ebaSAdam Thomson /* Input - Gain, Select and Filter Registers */
52ef5c2ebaSAdam Thomson #define DA7213_AUX_L_GAIN		0x30
53ef5c2ebaSAdam Thomson #define DA7213_AUX_R_GAIN		0x31
54ef5c2ebaSAdam Thomson #define DA7213_MIXIN_L_SELECT		0x32
55ef5c2ebaSAdam Thomson #define DA7213_MIXIN_R_SELECT		0x33
56ef5c2ebaSAdam Thomson #define DA7213_MIXIN_L_GAIN		0x34
57ef5c2ebaSAdam Thomson #define DA7213_MIXIN_R_GAIN		0x35
58ef5c2ebaSAdam Thomson #define DA7213_ADC_L_GAIN		0x36
59ef5c2ebaSAdam Thomson #define DA7213_ADC_R_GAIN		0x37
60ef5c2ebaSAdam Thomson #define DA7213_ADC_FILTERS1		0x38
61ef5c2ebaSAdam Thomson #define DA7213_MIC_1_GAIN		0x39
62ef5c2ebaSAdam Thomson #define DA7213_MIC_2_GAIN		0x3A
63ef5c2ebaSAdam Thomson 
64ef5c2ebaSAdam Thomson /* Output - Gain, Select and Filter Registers */
65ef5c2ebaSAdam Thomson #define DA7213_DAC_FILTERS5		0x40
66ef5c2ebaSAdam Thomson #define DA7213_DAC_FILTERS2		0x41
67ef5c2ebaSAdam Thomson #define DA7213_DAC_FILTERS3		0x42
68ef5c2ebaSAdam Thomson #define DA7213_DAC_FILTERS4		0x43
69ef5c2ebaSAdam Thomson #define DA7213_DAC_FILTERS1		0x44
70ef5c2ebaSAdam Thomson #define DA7213_DAC_L_GAIN		0x45
71ef5c2ebaSAdam Thomson #define DA7213_DAC_R_GAIN		0x46
72ef5c2ebaSAdam Thomson #define DA7213_CP_CTRL			0x47
73ef5c2ebaSAdam Thomson #define DA7213_HP_L_GAIN		0x48
74ef5c2ebaSAdam Thomson #define DA7213_HP_R_GAIN		0x49
75ef5c2ebaSAdam Thomson #define DA7213_LINE_GAIN		0x4A
76ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_L_SELECT		0x4B
77ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_R_SELECT		0x4C
78ef5c2ebaSAdam Thomson 
79ef5c2ebaSAdam Thomson /* System Controller Registers */
80ef5c2ebaSAdam Thomson #define DA7213_SYSTEM_MODES_INPUT	0x50
81ef5c2ebaSAdam Thomson #define DA7213_SYSTEM_MODES_OUTPUT	0x51
82ef5c2ebaSAdam Thomson 
83ef5c2ebaSAdam Thomson /* Control Registers */
84ef5c2ebaSAdam Thomson #define DA7213_AUX_L_CTRL		0x60
85ef5c2ebaSAdam Thomson #define DA7213_AUX_R_CTRL		0x61
86ef5c2ebaSAdam Thomson #define DA7213_MICBIAS_CTRL		0x62
87ef5c2ebaSAdam Thomson #define DA7213_MIC_1_CTRL		0x63
88ef5c2ebaSAdam Thomson #define DA7213_MIC_2_CTRL		0x64
89ef5c2ebaSAdam Thomson #define DA7213_MIXIN_L_CTRL		0x65
90ef5c2ebaSAdam Thomson #define DA7213_MIXIN_R_CTRL		0x66
91ef5c2ebaSAdam Thomson #define DA7213_ADC_L_CTRL		0x67
92ef5c2ebaSAdam Thomson #define DA7213_ADC_R_CTRL		0x68
93ef5c2ebaSAdam Thomson #define DA7213_DAC_L_CTRL		0x69
94ef5c2ebaSAdam Thomson #define DA7213_DAC_R_CTRL		0x6A
95ef5c2ebaSAdam Thomson #define DA7213_HP_L_CTRL		0x6B
96ef5c2ebaSAdam Thomson #define DA7213_HP_R_CTRL		0x6C
97ef5c2ebaSAdam Thomson #define DA7213_LINE_CTRL		0x6D
98ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_L_CTRL		0x6E
99ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_R_CTRL		0x6F
100ef5c2ebaSAdam Thomson 
101ef5c2ebaSAdam Thomson /* Configuration Registers */
102ef5c2ebaSAdam Thomson #define DA7213_LDO_CTRL			0x90
103ef5c2ebaSAdam Thomson #define DA7213_IO_CTRL			0x91
104ef5c2ebaSAdam Thomson #define DA7213_GAIN_RAMP_CTRL		0x92
105ef5c2ebaSAdam Thomson #define DA7213_MIC_CONFIG		0x93
106ef5c2ebaSAdam Thomson #define DA7213_PC_COUNT			0x94
107ef5c2ebaSAdam Thomson #define DA7213_CP_VOL_THRESHOLD1	0x95
108ef5c2ebaSAdam Thomson #define DA7213_CP_DELAY			0x96
109ef5c2ebaSAdam Thomson #define DA7213_CP_DETECTOR		0x97
110ef5c2ebaSAdam Thomson #define DA7213_DAI_OFFSET		0x98
111ef5c2ebaSAdam Thomson #define DA7213_DIG_CTRL			0x99
112ef5c2ebaSAdam Thomson #define DA7213_ALC_CTRL2		0x9A
113ef5c2ebaSAdam Thomson #define DA7213_ALC_CTRL3		0x9B
114ef5c2ebaSAdam Thomson #define DA7213_ALC_NOISE		0x9C
115ef5c2ebaSAdam Thomson #define DA7213_ALC_TARGET_MIN		0x9D
116ef5c2ebaSAdam Thomson #define DA7213_ALC_TARGET_MAX		0x9E
117ef5c2ebaSAdam Thomson #define DA7213_ALC_GAIN_LIMITS		0x9F
118ef5c2ebaSAdam Thomson #define DA7213_ALC_ANA_GAIN_LIMITS	0xA0
119ef5c2ebaSAdam Thomson #define DA7213_ALC_ANTICLIP_CTRL	0xA1
120ef5c2ebaSAdam Thomson #define DA7213_ALC_ANTICLIP_LEVEL	0xA2
121ef5c2ebaSAdam Thomson 
122ef5c2ebaSAdam Thomson #define DA7213_ALC_OFFSET_AUTO_M_L	0xA3
123ef5c2ebaSAdam Thomson #define DA7213_ALC_OFFSET_AUTO_U_L	0xA4
124ef5c2ebaSAdam Thomson #define DA7213_ALC_OFFSET_MAN_M_L	0xA6
125ef5c2ebaSAdam Thomson #define DA7213_ALC_OFFSET_MAN_U_L	0xA7
126ef5c2ebaSAdam Thomson #define DA7213_ALC_OFFSET_AUTO_M_R	0xA8
127ef5c2ebaSAdam Thomson #define DA7213_ALC_OFFSET_AUTO_U_R	0xA9
128ef5c2ebaSAdam Thomson #define DA7213_ALC_OFFSET_MAN_M_R	0xAB
129ef5c2ebaSAdam Thomson #define DA7213_ALC_OFFSET_MAN_U_R	0xAC
130ef5c2ebaSAdam Thomson #define DA7213_ALC_CIC_OP_LVL_CTRL	0xAD
131ef5c2ebaSAdam Thomson #define DA7213_ALC_CIC_OP_LVL_DATA	0xAE
132ef5c2ebaSAdam Thomson #define DA7213_DAC_NG_SETUP_TIME	0xAF
133ef5c2ebaSAdam Thomson #define DA7213_DAC_NG_OFF_THRESHOLD	0xB0
134ef5c2ebaSAdam Thomson #define DA7213_DAC_NG_ON_THRESHOLD	0xB1
135ef5c2ebaSAdam Thomson #define DA7213_DAC_NG_CTRL		0xB2
136ef5c2ebaSAdam Thomson 
137ef5c2ebaSAdam Thomson 
138ef5c2ebaSAdam Thomson /*
139ef5c2ebaSAdam Thomson  * Bit fields
140ef5c2ebaSAdam Thomson  */
141ef5c2ebaSAdam Thomson 
142d575b0b0SAdam Thomson /* DA7213_PLL_STATUS = 0x03 */
143d575b0b0SAdam Thomson #define DA7219_PLL_SRM_LOCK					(0x1 << 1)
144d575b0b0SAdam Thomson 
145ef5c2ebaSAdam Thomson /* DA7213_SR = 0x22 */
146ef5c2ebaSAdam Thomson #define DA7213_SR_8000						(0x1 << 0)
147ef5c2ebaSAdam Thomson #define DA7213_SR_11025						(0x2 << 0)
148ef5c2ebaSAdam Thomson #define DA7213_SR_12000						(0x3 << 0)
149ef5c2ebaSAdam Thomson #define DA7213_SR_16000						(0x5 << 0)
150ef5c2ebaSAdam Thomson #define DA7213_SR_22050						(0x6 << 0)
151ef5c2ebaSAdam Thomson #define DA7213_SR_24000						(0x7 << 0)
152ef5c2ebaSAdam Thomson #define DA7213_SR_32000						(0x9 << 0)
153ef5c2ebaSAdam Thomson #define DA7213_SR_44100						(0xA << 0)
154ef5c2ebaSAdam Thomson #define DA7213_SR_48000						(0xB << 0)
155ef5c2ebaSAdam Thomson #define DA7213_SR_88200						(0xE << 0)
156ef5c2ebaSAdam Thomson #define DA7213_SR_96000						(0xF << 0)
157ef5c2ebaSAdam Thomson 
158ef5c2ebaSAdam Thomson /* DA7213_REFERENCES = 0x23 */
159ef5c2ebaSAdam Thomson #define DA7213_BIAS_EN						(0x1 << 3)
160ef5c2ebaSAdam Thomson #define DA7213_VMID_EN						(0x1 << 7)
161ef5c2ebaSAdam Thomson 
162ef5c2ebaSAdam Thomson /* DA7213_PLL_CTRL = 0x27 */
1631e62c52dSAdam Thomson #define DA7213_PLL_INDIV_5_TO_9_MHZ				(0x0 << 2)
1641e62c52dSAdam Thomson #define DA7213_PLL_INDIV_9_TO_18_MHZ				(0x1 << 2)
1651e62c52dSAdam Thomson #define DA7213_PLL_INDIV_18_TO_36_MHZ				(0x2 << 2)
1661e62c52dSAdam Thomson #define DA7213_PLL_INDIV_36_TO_54_MHZ				(0x3 << 2)
167ef5c2ebaSAdam Thomson #define DA7213_PLL_INDIV_MASK					(0x3 << 2)
168ef5c2ebaSAdam Thomson #define DA7213_PLL_MCLK_SQR_EN					(0x1 << 4)
169ef5c2ebaSAdam Thomson #define DA7213_PLL_32K_MODE					(0x1 << 5)
170ef5c2ebaSAdam Thomson #define DA7213_PLL_SRM_EN					(0x1 << 6)
171ef5c2ebaSAdam Thomson #define DA7213_PLL_EN						(0x1 << 7)
1724c75225aSAdam Thomson #define DA7213_PLL_MODE_MASK					(0x7 << 5)
173ef5c2ebaSAdam Thomson 
174ef5c2ebaSAdam Thomson /* DA7213_DAI_CLK_MODE = 0x28 */
175ef5c2ebaSAdam Thomson #define DA7213_DAI_BCLKS_PER_WCLK_32				(0x0 << 0)
176ef5c2ebaSAdam Thomson #define DA7213_DAI_BCLKS_PER_WCLK_64				(0x1 << 0)
177ef5c2ebaSAdam Thomson #define DA7213_DAI_BCLKS_PER_WCLK_128				(0x2 << 0)
178ef5c2ebaSAdam Thomson #define DA7213_DAI_BCLKS_PER_WCLK_256				(0x3 << 0)
179ef5c2ebaSAdam Thomson #define DA7213_DAI_BCLKS_PER_WCLK_MASK				(0x3 << 0)
180ef5c2ebaSAdam Thomson #define DA7213_DAI_CLK_POL_INV					(0x1 << 2)
181414a7321SLogesh #define DA7213_DAI_CLK_POL_MASK					(0x1 << 2)
182ef5c2ebaSAdam Thomson #define DA7213_DAI_WCLK_POL_INV					(0x1 << 3)
183414a7321SLogesh #define DA7213_DAI_WCLK_POL_MASK				(0x1 << 3)
184ef5c2ebaSAdam Thomson #define DA7213_DAI_CLK_EN_MASK					(0x1 << 7)
185ef5c2ebaSAdam Thomson 
186ef5c2ebaSAdam Thomson /* DA7213_DAI_CTRL = 0x29 */
187ef5c2ebaSAdam Thomson #define DA7213_DAI_FORMAT_I2S_MODE				(0x0 << 0)
188ef5c2ebaSAdam Thomson #define DA7213_DAI_FORMAT_LEFT_J				(0x1 << 0)
189ef5c2ebaSAdam Thomson #define DA7213_DAI_FORMAT_RIGHT_J				(0x2 << 0)
190e0d746ccSPierre-Louis Bossart #define DA7213_DAI_FORMAT_DSP					(0x3 << 0)
191ef5c2ebaSAdam Thomson #define DA7213_DAI_FORMAT_MASK					(0x3 << 0)
192ef5c2ebaSAdam Thomson #define DA7213_DAI_WORD_LENGTH_S16_LE				(0x0 << 2)
193ef5c2ebaSAdam Thomson #define DA7213_DAI_WORD_LENGTH_S20_LE				(0x1 << 2)
194ef5c2ebaSAdam Thomson #define DA7213_DAI_WORD_LENGTH_S24_LE				(0x2 << 2)
195ef5c2ebaSAdam Thomson #define DA7213_DAI_WORD_LENGTH_S32_LE				(0x3 << 2)
196ef5c2ebaSAdam Thomson #define DA7213_DAI_WORD_LENGTH_MASK				(0x3 << 2)
197ef5c2ebaSAdam Thomson #define DA7213_DAI_EN_SHIFT					7
198ef5c2ebaSAdam Thomson 
199ef5c2ebaSAdam Thomson /* DA7213_DIG_ROUTING_DAI = 0x21 */
200ef5c2ebaSAdam Thomson #define DA7213_DAI_L_SRC_SHIFT					0
201ef5c2ebaSAdam Thomson #define DA7213_DAI_R_SRC_SHIFT					4
202ef5c2ebaSAdam Thomson #define DA7213_DAI_SRC_MAX					4
203ef5c2ebaSAdam Thomson 
204ef5c2ebaSAdam Thomson /* DA7213_DIG_ROUTING_DAC = 0x2A */
205ef5c2ebaSAdam Thomson #define DA7213_DAC_L_SRC_SHIFT					0
206ef5c2ebaSAdam Thomson #define DA7213_DAC_L_MONO_SHIFT					3
207ef5c2ebaSAdam Thomson #define DA7213_DAC_R_SRC_SHIFT					4
208ef5c2ebaSAdam Thomson #define DA7213_DAC_R_MONO_SHIFT					7
209ef5c2ebaSAdam Thomson #define DA7213_DAC_SRC_MAX					4
210ef5c2ebaSAdam Thomson #define DA7213_DAC_MONO_MAX					0x1
211ef5c2ebaSAdam Thomson 
212ef5c2ebaSAdam Thomson /* DA7213_ALC_CTRL1 = 0x2B */
213ef5c2ebaSAdam Thomson #define DA7213_ALC_OFFSET_EN_SHIFT				0
214ef5c2ebaSAdam Thomson #define DA7213_ALC_OFFSET_EN_MAX				0x1
215ef5c2ebaSAdam Thomson #define DA7213_ALC_OFFSET_EN					(0x1 << 0)
216ef5c2ebaSAdam Thomson #define DA7213_ALC_SYNC_MODE					(0x1 << 1)
217ef5c2ebaSAdam Thomson #define DA7213_ALC_CALIB_MODE_MAN				(0x1 << 2)
218ef5c2ebaSAdam Thomson #define DA7213_ALC_L_EN_SHIFT					3
219ef5c2ebaSAdam Thomson #define DA7213_ALC_AUTO_CALIB_EN				(0x1 << 4)
220ef5c2ebaSAdam Thomson #define DA7213_ALC_CALIB_OVERFLOW				(0x1 << 5)
221ef5c2ebaSAdam Thomson #define DA7213_ALC_R_EN_SHIFT					7
222ef5c2ebaSAdam Thomson #define DA7213_ALC_EN_MAX					0x1
223ef5c2ebaSAdam Thomson 
224ef5c2ebaSAdam Thomson /* DA7213_AUX_L/R_GAIN = 0x30/0x31 */
225ef5c2ebaSAdam Thomson #define DA7213_AUX_AMP_GAIN_SHIFT				0
226ef5c2ebaSAdam Thomson #define DA7213_AUX_AMP_GAIN_MAX					0x3F
227ef5c2ebaSAdam Thomson 
228ef5c2ebaSAdam Thomson /* DA7213_MIXIN_L/R_SELECT = 0x32/0x33 */
229ef5c2ebaSAdam Thomson #define DA7213_DMIC_EN_SHIFT					7
230ef5c2ebaSAdam Thomson #define DA7213_DMIC_EN_MAX					0x1
231ef5c2ebaSAdam Thomson 
232ef5c2ebaSAdam Thomson /* DA7213_MIXIN_L_SELECT = 0x32 */
233ef5c2ebaSAdam Thomson #define DA7213_MIXIN_L_MIX_SELECT_AUX_L_SHIFT			0
234ef5c2ebaSAdam Thomson #define DA7213_MIXIN_L_MIX_SELECT_MIC_1_SHIFT			1
235ef5c2ebaSAdam Thomson #define DA7213_MIXIN_L_MIX_SELECT_MIC_1				(0x1 << 1)
236ef5c2ebaSAdam Thomson #define DA7213_MIXIN_L_MIX_SELECT_MIC_2_SHIFT			2
237ef5c2ebaSAdam Thomson #define DA7213_MIXIN_L_MIX_SELECT_MIC_2				(0x1 << 2)
238ef5c2ebaSAdam Thomson #define DA7213_MIXIN_L_MIX_SELECT_MIXIN_R_SHIFT			3
239ef5c2ebaSAdam Thomson #define DA7213_MIXIN_L_MIX_SELECT_MAX				0x1
240ef5c2ebaSAdam Thomson 
241ef5c2ebaSAdam Thomson /* DA7213_MIXIN_R_SELECT =  0x33 */
242ef5c2ebaSAdam Thomson #define DA7213_MIXIN_R_MIX_SELECT_AUX_R_SHIFT			0
243ef5c2ebaSAdam Thomson #define DA7213_MIXIN_R_MIX_SELECT_MIC_2_SHIFT			1
244ef5c2ebaSAdam Thomson #define DA7213_MIXIN_R_MIX_SELECT_MIC_2				(0x1 << 1)
245ef5c2ebaSAdam Thomson #define DA7213_MIXIN_R_MIX_SELECT_MIC_1_SHIFT			2
246ef5c2ebaSAdam Thomson #define DA7213_MIXIN_R_MIX_SELECT_MIC_1				(0x1 << 2)
247ef5c2ebaSAdam Thomson #define DA7213_MIXIN_R_MIX_SELECT_MIXIN_L_SHIFT			3
248ef5c2ebaSAdam Thomson #define DA7213_MIXIN_R_MIX_SELECT_MAX				0x1
249ef5c2ebaSAdam Thomson #define DA7213_MIC_BIAS_OUTPUT_SELECT_2				(0x1 << 6)
250ef5c2ebaSAdam Thomson 
251ef5c2ebaSAdam Thomson /* DA7213_MIXIN_L/R_GAIN = 0x34/0x35 */
252ef5c2ebaSAdam Thomson #define DA7213_MIXIN_AMP_GAIN_SHIFT				0
253ef5c2ebaSAdam Thomson #define DA7213_MIXIN_AMP_GAIN_MAX				0xF
254ef5c2ebaSAdam Thomson 
255ef5c2ebaSAdam Thomson /* DA7213_ADC_L/R_GAIN = 0x36/0x37 */
256ef5c2ebaSAdam Thomson #define DA7213_ADC_AMP_GAIN_SHIFT				0
257ef5c2ebaSAdam Thomson #define DA7213_ADC_AMP_GAIN_MAX					0x7F
258ef5c2ebaSAdam Thomson 
259ef5c2ebaSAdam Thomson /* DA7213_ADC/DAC_FILTERS1 = 0x38/0x44 */
260ef5c2ebaSAdam Thomson #define DA7213_VOICE_HPF_CORNER_SHIFT				0
261ef5c2ebaSAdam Thomson #define DA7213_VOICE_HPF_CORNER_MAX				8
262ef5c2ebaSAdam Thomson #define DA7213_VOICE_EN_SHIFT					3
263ef5c2ebaSAdam Thomson #define DA7213_VOICE_EN_MAX					0x1
264ef5c2ebaSAdam Thomson #define DA7213_AUDIO_HPF_CORNER_SHIFT				4
265ef5c2ebaSAdam Thomson #define DA7213_AUDIO_HPF_CORNER_MAX				4
266ef5c2ebaSAdam Thomson #define DA7213_HPF_EN_SHIFT					7
267ef5c2ebaSAdam Thomson #define DA7213_HPF_EN_MAX					0x1
268ef5c2ebaSAdam Thomson 
269ef5c2ebaSAdam Thomson /* DA7213_MIC_1/2_GAIN = 0x39/0x3A */
270ef5c2ebaSAdam Thomson #define DA7213_MIC_AMP_GAIN_SHIFT				0
271ef5c2ebaSAdam Thomson #define DA7213_MIC_AMP_GAIN_MAX					0x7
272ef5c2ebaSAdam Thomson 
273ef5c2ebaSAdam Thomson /* DA7213_DAC_FILTERS5 = 0x40 */
274ef5c2ebaSAdam Thomson #define DA7213_DAC_SOFTMUTE_EN_SHIFT				7
275ef5c2ebaSAdam Thomson #define DA7213_DAC_SOFTMUTE_EN_MAX				0x1
276ef5c2ebaSAdam Thomson #define DA7213_DAC_SOFTMUTE_RATE_SHIFT				4
277ef5c2ebaSAdam Thomson #define DA7213_DAC_SOFTMUTE_RATE_MAX				7
278ef5c2ebaSAdam Thomson 
279ef5c2ebaSAdam Thomson /* DA7213_DAC_FILTERS2/3/4 = 0x41/0x42/0x43 */
280ef5c2ebaSAdam Thomson #define DA7213_DAC_EQ_BAND_MAX					0xF
281ef5c2ebaSAdam Thomson 
282ef5c2ebaSAdam Thomson /* DA7213_DAC_FILTERS2 = 0x41 */
283ef5c2ebaSAdam Thomson #define DA7213_DAC_EQ_BAND1_SHIFT				0
284ef5c2ebaSAdam Thomson #define DA7213_DAC_EQ_BAND2_SHIFT				4
285ef5c2ebaSAdam Thomson 
286ef5c2ebaSAdam Thomson /* DA7213_DAC_FILTERS2 = 0x42 */
287ef5c2ebaSAdam Thomson #define DA7213_DAC_EQ_BAND3_SHIFT				0
288ef5c2ebaSAdam Thomson #define DA7213_DAC_EQ_BAND4_SHIFT				4
289ef5c2ebaSAdam Thomson 
290ef5c2ebaSAdam Thomson /* DA7213_DAC_FILTERS4 = 0x43 */
291ef5c2ebaSAdam Thomson #define DA7213_DAC_EQ_BAND5_SHIFT				0
292ef5c2ebaSAdam Thomson #define DA7213_DAC_EQ_EN_SHIFT					7
293ef5c2ebaSAdam Thomson #define DA7213_DAC_EQ_EN_MAX					0x1
294ef5c2ebaSAdam Thomson 
295ef5c2ebaSAdam Thomson /* DA7213_DAC_L/R_GAIN = 0x45/0x46 */
296ef5c2ebaSAdam Thomson #define DA7213_DAC_AMP_GAIN_SHIFT				0
297ef5c2ebaSAdam Thomson #define DA7213_DAC_AMP_GAIN_MAX					0x7F
298ef5c2ebaSAdam Thomson 
299ef5c2ebaSAdam Thomson /* DA7213_HP_L/R_GAIN = 0x45/0x46 */
300ef5c2ebaSAdam Thomson #define DA7213_HP_AMP_GAIN_SHIFT				0
301ef5c2ebaSAdam Thomson #define DA7213_HP_AMP_GAIN_MAX					0x3F
302ef5c2ebaSAdam Thomson 
303ef5c2ebaSAdam Thomson /* DA7213_CP_CTRL = 0x47 */
304ef5c2ebaSAdam Thomson #define DA7213_CP_EN_SHIFT					7
305ef5c2ebaSAdam Thomson 
306ef5c2ebaSAdam Thomson /* DA7213_LINE_GAIN = 0x4A */
307ef5c2ebaSAdam Thomson #define DA7213_LINE_AMP_GAIN_SHIFT				0
308ef5c2ebaSAdam Thomson #define DA7213_LINE_AMP_GAIN_MAX				0x3F
309ef5c2ebaSAdam Thomson 
310ef5c2ebaSAdam Thomson /* DA7213_MIXOUT_L_SELECT = 0x4B */
311ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_L_MIX_SELECT_AUX_L_SHIFT			0
312ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_L_MIX_SELECT_MIXIN_L_SHIFT		1
313ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_L_MIX_SELECT_MIXIN_R_SHIFT		2
314ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_L_MIX_SELECT_DAC_L_SHIFT			3
315ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_L_MIX_SELECT_AUX_L_INVERTED_SHIFT		4
316ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_L_MIX_SELECT_MIXIN_L_INVERTED_SHIFT	5
317ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_L_MIX_SELECT_MIXIN_R_INVERTED_SHIFT	6
318ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_L_MIX_SELECT_MAX				0x1
319ef5c2ebaSAdam Thomson 
320ef5c2ebaSAdam Thomson /* DA7213_MIXOUT_R_SELECT = 0x4C */
321ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_R_MIX_SELECT_AUX_R_SHIFT			0
322ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_R_MIX_SELECT_MIXIN_R_SHIFT		1
323ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_R_MIX_SELECT_MIXIN_L_SHIFT		2
324ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_R_MIX_SELECT_DAC_R_SHIFT			3
325ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_R_MIX_SELECT_AUX_R_INVERTED_SHIFT		4
326ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_R_MIX_SELECT_MIXIN_R_INVERTED_SHIFT	5
327ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_R_MIX_SELECT_MIXIN_L_INVERTED_SHIFT	6
328ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_R_MIX_SELECT_MAX				0x1
329ef5c2ebaSAdam Thomson 
330ef5c2ebaSAdam Thomson /*
331ef5c2ebaSAdam Thomson  * DA7213_AUX_L/R_CTRL = 0x60/0x61,
332ef5c2ebaSAdam Thomson  * DA7213_MIC_1/2_CTRL = 0x63/0x64,
333ef5c2ebaSAdam Thomson  * DA7213_MIXIN_L/R_CTRL = 0x65/0x66,
334ef5c2ebaSAdam Thomson  * DA7213_ADC_L/R_CTRL = 0x65/0x66,
335ef5c2ebaSAdam Thomson  * DA7213_DAC_L/R_CTRL = 0x69/0x6A,
336ef5c2ebaSAdam Thomson  * DA7213_HP_L/R_CTRL = 0x6B/0x6C,
337ef5c2ebaSAdam Thomson  * DA7213_LINE_CTRL = 0x6D
338ef5c2ebaSAdam Thomson  */
339ef5c2ebaSAdam Thomson #define DA7213_MUTE_EN_SHIFT					6
340ef5c2ebaSAdam Thomson #define DA7213_MUTE_EN_MAX					0x1
341ef5c2ebaSAdam Thomson #define DA7213_MUTE_EN						(0x1 << 6)
342ef5c2ebaSAdam Thomson 
343ef5c2ebaSAdam Thomson /*
344ef5c2ebaSAdam Thomson  * DA7213_AUX_L/R_CTRL = 0x60/0x61,
345ef5c2ebaSAdam Thomson  * DA7213_MIXIN_L/R_CTRL = 0x65/0x66,
346ef5c2ebaSAdam Thomson  * DA7213_ADC_L/R_CTRL = 0x65/0x66,
347ef5c2ebaSAdam Thomson  * DA7213_DAC_L/R_CTRL = 0x69/0x6A,
348ef5c2ebaSAdam Thomson  * DA7213_HP_L/R_CTRL = 0x6B/0x6C,
349ef5c2ebaSAdam Thomson  * DA7213_LINE_CTRL = 0x6D
350ef5c2ebaSAdam Thomson  */
351ef5c2ebaSAdam Thomson #define DA7213_GAIN_RAMP_EN_SHIFT				5
352ef5c2ebaSAdam Thomson #define DA7213_GAIN_RAMP_EN_MAX					0x1
353ef5c2ebaSAdam Thomson #define DA7213_GAIN_RAMP_EN					(0x1 << 5)
354ef5c2ebaSAdam Thomson 
355ef5c2ebaSAdam Thomson /*
356ef5c2ebaSAdam Thomson  * DA7213_AUX_L/R_CTRL = 0x60/0x61,
357ef5c2ebaSAdam Thomson  * DA7213_MIXIN_L/R_CTRL = 0x65/0x66,
358ef5c2ebaSAdam Thomson  * DA7213_HP_L/R_CTRL = 0x6B/0x6C,
359ef5c2ebaSAdam Thomson  * DA7213_LINE_CTRL = 0x6D
360ef5c2ebaSAdam Thomson  */
361ef5c2ebaSAdam Thomson #define DA7213_ZC_EN_SHIFT					4
362ef5c2ebaSAdam Thomson #define DA7213_ZC_EN_MAX					0x1
363ef5c2ebaSAdam Thomson 
364ef5c2ebaSAdam Thomson /*
365ef5c2ebaSAdam Thomson  * DA7213_AUX_L/R_CTRL = 0x60/0x61,
366ef5c2ebaSAdam Thomson  * DA7213_MIC_1/2_CTRL = 0x63/0x64,
367ef5c2ebaSAdam Thomson  * DA7213_MIXIN_L/R_CTRL = 0x65/0x66,
368ef5c2ebaSAdam Thomson  * DA7213_HP_L/R_CTRL = 0x6B/0x6C,
369ef5c2ebaSAdam Thomson  * DA7213_MIXOUT_L/R_CTRL = 0x6E/0x6F,
370ef5c2ebaSAdam Thomson  * DA7213_LINE_CTRL = 0x6D
371ef5c2ebaSAdam Thomson  */
372ef5c2ebaSAdam Thomson #define DA7213_AMP_EN_SHIFT					7
373ef5c2ebaSAdam Thomson 
374ef5c2ebaSAdam Thomson /* DA7213_MIC_1/2_CTRL = 0x63/0x64 */
375ef5c2ebaSAdam Thomson #define DA7213_MIC_AMP_IN_SEL_SHIFT				2
376ef5c2ebaSAdam Thomson #define DA7213_MIC_AMP_IN_SEL_MAX				3
377ef5c2ebaSAdam Thomson 
378ef5c2ebaSAdam Thomson /* DA7213_MICBIAS_CTRL = 0x62 */
379ef5c2ebaSAdam Thomson #define DA7213_MICBIAS1_LEVEL_SHIFT				0
380ef5c2ebaSAdam Thomson #define DA7213_MICBIAS1_LEVEL_MASK				(0x3 << 0)
381ef5c2ebaSAdam Thomson #define DA7213_MICBIAS1_EN_SHIFT				3
382ef5c2ebaSAdam Thomson #define DA7213_MICBIAS2_LEVEL_SHIFT				4
383ef5c2ebaSAdam Thomson #define DA7213_MICBIAS2_LEVEL_MASK				(0x3 << 4)
384ef5c2ebaSAdam Thomson #define DA7213_MICBIAS2_EN_SHIFT				7
385ef5c2ebaSAdam Thomson 
386ef5c2ebaSAdam Thomson /* DA7213_MIXIN_L/R_CTRL = 0x65/0x66 */
387ef5c2ebaSAdam Thomson #define DA7213_MIXIN_MIX_EN					(0x1 << 3)
388ef5c2ebaSAdam Thomson 
389ef5c2ebaSAdam Thomson /* DA7213_ADC_L/R_CTRL = 0x67/0x68 */
390ef5c2ebaSAdam Thomson #define DA7213_ADC_EN_SHIFT					7
391ef5c2ebaSAdam Thomson #define DA7213_ADC_EN						(0x1 << 7)
392ef5c2ebaSAdam Thomson 
393ef5c2ebaSAdam Thomson /* DA7213_DAC_L/R_CTRL =  0x69/0x6A*/
394ef5c2ebaSAdam Thomson #define DA7213_DAC_EN_SHIFT					7
395ef5c2ebaSAdam Thomson 
396ef5c2ebaSAdam Thomson /* DA7213_HP_L/R_CTRL = 0x6B/0x6C */
397ef5c2ebaSAdam Thomson #define DA7213_HP_AMP_OE					(0x1 << 3)
398ef5c2ebaSAdam Thomson 
399ef5c2ebaSAdam Thomson /* DA7213_LINE_CTRL = 0x6D */
400ef5c2ebaSAdam Thomson #define DA7213_LINE_AMP_OE					(0x1 << 3)
401ef5c2ebaSAdam Thomson 
402ef5c2ebaSAdam Thomson /* DA7213_MIXOUT_L/R_CTRL = 0x6E/0x6F */
403ef5c2ebaSAdam Thomson #define DA7213_MIXOUT_MIX_EN					(0x1 << 3)
404ef5c2ebaSAdam Thomson 
405ef5c2ebaSAdam Thomson /* DA7213_GAIN_RAMP_CTRL = 0x92 */
406ef5c2ebaSAdam Thomson #define DA7213_GAIN_RAMP_RATE_SHIFT				0
407ef5c2ebaSAdam Thomson #define DA7213_GAIN_RAMP_RATE_MAX				4
408ef5c2ebaSAdam Thomson 
409ef5c2ebaSAdam Thomson /* DA7213_MIC_CONFIG = 0x93 */
410ef5c2ebaSAdam Thomson #define DA7213_DMIC_DATA_SEL_SHIFT				0
411ef5c2ebaSAdam Thomson #define DA7213_DMIC_DATA_SEL_MASK				(0x1 << 0)
412ef5c2ebaSAdam Thomson #define DA7213_DMIC_SAMPLEPHASE_SHIFT				1
413ef5c2ebaSAdam Thomson #define DA7213_DMIC_SAMPLEPHASE_MASK				(0x1 << 1)
414ef5c2ebaSAdam Thomson #define DA7213_DMIC_CLK_RATE_SHIFT				2
415ef5c2ebaSAdam Thomson #define DA7213_DMIC_CLK_RATE_MASK				(0x1 << 2)
416ef5c2ebaSAdam Thomson 
4177e28fd46SAdam Thomson /* DA7213_PC_COUNT = 0x94 */
4187e28fd46SAdam Thomson #define DA7213_PC_FREERUN_MASK					(0x1 << 0)
4197e28fd46SAdam Thomson 
420ef5c2ebaSAdam Thomson /* DA7213_DIG_CTRL = 0x99 */
421ef5c2ebaSAdam Thomson #define DA7213_DAC_L_INV_SHIFT					3
422ef5c2ebaSAdam Thomson #define DA7213_DAC_R_INV_SHIFT					7
423ef5c2ebaSAdam Thomson #define DA7213_DAC_INV_MAX					0x1
424ef5c2ebaSAdam Thomson 
425ef5c2ebaSAdam Thomson /* DA7213_ALC_CTRL2 = 0x9A */
426ef5c2ebaSAdam Thomson #define DA7213_ALC_ATTACK_SHIFT					0
427ef5c2ebaSAdam Thomson #define DA7213_ALC_ATTACK_MAX					13
428ef5c2ebaSAdam Thomson #define DA7213_ALC_RELEASE_SHIFT				4
429ef5c2ebaSAdam Thomson #define DA7213_ALC_RELEASE_MAX					11
430ef5c2ebaSAdam Thomson 
431ef5c2ebaSAdam Thomson /* DA7213_ALC_CTRL3 = 0x9B */
432ef5c2ebaSAdam Thomson #define DA7213_ALC_HOLD_SHIFT					0
433ef5c2ebaSAdam Thomson #define DA7213_ALC_HOLD_MAX					16
434ef5c2ebaSAdam Thomson #define DA7213_ALC_INTEG_ATTACK_SHIFT				4
435ef5c2ebaSAdam Thomson #define DA7213_ALC_INTEG_RELEASE_SHIFT				6
436ef5c2ebaSAdam Thomson #define DA7213_ALC_INTEG_MAX					4
437ef5c2ebaSAdam Thomson 
438ef5c2ebaSAdam Thomson /*
439ef5c2ebaSAdam Thomson  * DA7213_ALC_NOISE = 0x9C,
440ef5c2ebaSAdam Thomson  * DA7213_ALC_TARGET_MIN/MAX = 0x9D/0x9E
441ef5c2ebaSAdam Thomson  */
442ef5c2ebaSAdam Thomson #define DA7213_ALC_THRESHOLD_SHIFT				0
443ef5c2ebaSAdam Thomson #define DA7213_ALC_THRESHOLD_MAX				0x3F
444ef5c2ebaSAdam Thomson 
445ef5c2ebaSAdam Thomson /* DA7213_ALC_GAIN_LIMITS = 0x9F */
446ef5c2ebaSAdam Thomson #define DA7213_ALC_ATTEN_MAX_SHIFT				0
447ef5c2ebaSAdam Thomson #define DA7213_ALC_GAIN_MAX_SHIFT				4
448ef5c2ebaSAdam Thomson #define DA7213_ALC_ATTEN_GAIN_MAX_MAX				0xF
449ef5c2ebaSAdam Thomson 
450ef5c2ebaSAdam Thomson /* DA7213_ALC_ANA_GAIN_LIMITS = 0xA0 */
451ef5c2ebaSAdam Thomson #define DA7213_ALC_ANA_GAIN_MIN_SHIFT				0
452ef5c2ebaSAdam Thomson #define DA7213_ALC_ANA_GAIN_MAX_SHIFT				4
453ef5c2ebaSAdam Thomson #define DA7213_ALC_ANA_GAIN_MAX					0x7
454ef5c2ebaSAdam Thomson 
455ef5c2ebaSAdam Thomson /* DA7213_ALC_ANTICLIP_CTRL = 0xA1 */
456ef5c2ebaSAdam Thomson #define DA7213_ALC_ANTICLIP_EN_SHIFT				7
457ef5c2ebaSAdam Thomson #define DA7213_ALC_ANTICLIP_EN_MAX				0x1
458ef5c2ebaSAdam Thomson 
459ef5c2ebaSAdam Thomson /* DA7213_ALC_ANTICLIP_LEVEL = 0xA2 */
460ef5c2ebaSAdam Thomson #define DA7213_ALC_ANTICLIP_LEVEL_SHIFT				0
461ef5c2ebaSAdam Thomson #define DA7213_ALC_ANTICLIP_LEVEL_MAX				0x7F
462ef5c2ebaSAdam Thomson 
463ef5c2ebaSAdam Thomson /* DA7213_ALC_CIC_OP_LVL_CTRL = 0xAD */
464ef5c2ebaSAdam Thomson #define DA7213_ALC_DATA_MIDDLE					(0x2 << 0)
465ef5c2ebaSAdam Thomson #define DA7213_ALC_DATA_TOP					(0x3 << 0)
466ef5c2ebaSAdam Thomson #define DA7213_ALC_CIC_OP_CHANNEL_LEFT				(0x0 << 7)
467ef5c2ebaSAdam Thomson #define DA7213_ALC_CIC_OP_CHANNEL_RIGHT				(0x1 << 7)
468ef5c2ebaSAdam Thomson 
469ef5c2ebaSAdam Thomson /* DA7213_DAC_NG_SETUP_TIME = 0xAF */
470ef5c2ebaSAdam Thomson #define DA7213_DAC_NG_SETUP_TIME_SHIFT				0
471ef5c2ebaSAdam Thomson #define DA7213_DAC_NG_SETUP_TIME_MAX				4
472ef5c2ebaSAdam Thomson #define DA7213_DAC_NG_RAMPUP_RATE_SHIFT				2
473ef5c2ebaSAdam Thomson #define DA7213_DAC_NG_RAMPDN_RATE_SHIFT				3
474ef5c2ebaSAdam Thomson #define DA7213_DAC_NG_RAMP_RATE_MAX				2
475ef5c2ebaSAdam Thomson 
476ef5c2ebaSAdam Thomson /* DA7213_DAC_NG_OFF/ON_THRESH = 0xB0/0xB1 */
477ef5c2ebaSAdam Thomson #define DA7213_DAC_NG_THRESHOLD_SHIFT				0
478ef5c2ebaSAdam Thomson #define DA7213_DAC_NG_THRESHOLD_MAX				0x7
479ef5c2ebaSAdam Thomson 
480ef5c2ebaSAdam Thomson /* DA7213_DAC_NG_CTRL = 0xB2 */
481ef5c2ebaSAdam Thomson #define DA7213_DAC_NG_EN_SHIFT					7
482ef5c2ebaSAdam Thomson #define DA7213_DAC_NG_EN_MAX					0x1
483ef5c2ebaSAdam Thomson 
484ef5c2ebaSAdam Thomson 
485ef5c2ebaSAdam Thomson /*
486ef5c2ebaSAdam Thomson  * General defines
487ef5c2ebaSAdam Thomson  */
488ef5c2ebaSAdam Thomson 
489ef5c2ebaSAdam Thomson /* Register inversion */
490ef5c2ebaSAdam Thomson #define DA7213_NO_INVERT		0
491ef5c2ebaSAdam Thomson #define DA7213_INVERT			1
492ef5c2ebaSAdam Thomson 
493ef5c2ebaSAdam Thomson /* Byte related defines */
494ef5c2ebaSAdam Thomson #define DA7213_BYTE_SHIFT		8
495ef5c2ebaSAdam Thomson #define DA7213_BYTE_MASK		0xFF
496ef5c2ebaSAdam Thomson 
497ef5c2ebaSAdam Thomson /* ALC related */
498ef5c2ebaSAdam Thomson #define DA7213_ALC_OFFSET_15_8		0x00FF00
499ef5c2ebaSAdam Thomson #define DA7213_ALC_OFFSET_19_16		0x0F0000
500ef5c2ebaSAdam Thomson #define DA7213_ALC_AVG_ITERATIONS	5
501ef5c2ebaSAdam Thomson 
502ef5c2ebaSAdam Thomson /* PLL related */
503ef5c2ebaSAdam Thomson #define DA7213_PLL_FREQ_OUT_90316800		90316800
504ef5c2ebaSAdam Thomson #define DA7213_PLL_FREQ_OUT_98304000		98304000
505ef5c2ebaSAdam Thomson #define DA7213_PLL_FREQ_OUT_94310400		94310400
5061e62c52dSAdam Thomson #define DA7213_PLL_INDIV_5_TO_9_MHZ_VAL		2
5071e62c52dSAdam Thomson #define DA7213_PLL_INDIV_9_TO_18_MHZ_VAL	4
5081e62c52dSAdam Thomson #define DA7213_PLL_INDIV_18_TO_36_MHZ_VAL	8
5091e62c52dSAdam Thomson #define DA7213_PLL_INDIV_36_TO_54_MHZ_VAL	16
510d575b0b0SAdam Thomson #define DA7213_SRM_CHECK_RETRIES		8
511ef5c2ebaSAdam Thomson 
5126e7c4443SAdam Thomson enum da7213_clk_src {
5136e7c4443SAdam Thomson 	DA7213_CLKSRC_MCLK = 0,
5146e7c4443SAdam Thomson 	DA7213_CLKSRC_MCLK_SQR,
515ef5c2ebaSAdam Thomson };
516ef5c2ebaSAdam Thomson 
5174c75225aSAdam Thomson enum da7213_sys_clk {
5184c75225aSAdam Thomson 	DA7213_SYSCLK_MCLK = 0,
5194c75225aSAdam Thomson 	DA7213_SYSCLK_PLL,
5204c75225aSAdam Thomson 	DA7213_SYSCLK_PLL_SRM,
5214c75225aSAdam Thomson 	DA7213_SYSCLK_PLL_32KHZ
5224c75225aSAdam Thomson };
5234c75225aSAdam Thomson 
524ef5c2ebaSAdam Thomson /* Codec private data */
525ef5c2ebaSAdam Thomson struct da7213_priv {
526ef5c2ebaSAdam Thomson 	struct regmap *regmap;
5276e7c4443SAdam Thomson 	struct clk *mclk;
528ef5c2ebaSAdam Thomson 	unsigned int mclk_rate;
5296e7c4443SAdam Thomson 	int clk_src;
530ef5c2ebaSAdam Thomson 	bool master;
531ef5c2ebaSAdam Thomson 	bool alc_calib_auto;
532ef5c2ebaSAdam Thomson 	bool alc_en;
533ef5c2ebaSAdam Thomson 	struct da7213_platform_data *pdata;
534ef5c2ebaSAdam Thomson };
535ef5c2ebaSAdam Thomson 
536ef5c2ebaSAdam Thomson #endif /* _DA7213_H */
537