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