xref: /linux/sound/soc/codecs/max98090.h (revision b8a3ee820f7b0802c9b90a9f3426dbda54e93d09)
1685e4215SJerry Wong /*
2685e4215SJerry Wong  * max98090.h -- MAX98090 ALSA SoC Audio driver
3685e4215SJerry Wong  *
4685e4215SJerry Wong  * Copyright 2011-2012 Maxim Integrated Products
5685e4215SJerry Wong  *
6685e4215SJerry Wong  * This program is free software; you can redistribute it and/or modify
7685e4215SJerry Wong  * it under the terms of the GNU General Public License version 2 as
8685e4215SJerry Wong  * published by the Free Software Foundation.
9685e4215SJerry Wong  */
10685e4215SJerry Wong 
11685e4215SJerry Wong #ifndef _MAX98090_H
12685e4215SJerry Wong #define _MAX98090_H
13685e4215SJerry Wong 
14685e4215SJerry Wong #include <linux/version.h>
15685e4215SJerry Wong 
16685e4215SJerry Wong /* One can override the Linux version here with an explicit version number */
17685e4215SJerry Wong #define M98090_LINUX_VERSION LINUX_VERSION_CODE
18685e4215SJerry Wong 
19685e4215SJerry Wong /*
20685e4215SJerry Wong  * MAX98090 Register Definitions
21685e4215SJerry Wong  */
22685e4215SJerry Wong 
23685e4215SJerry Wong #define M98090_REG_SOFTWARE_RESET		0x00
24685e4215SJerry Wong #define M98090_REG_DEVICE_STATUS		0x01
25685e4215SJerry Wong #define M98090_REG_JACK_STATUS			0x02
26685e4215SJerry Wong #define M98090_REG_INTERRUPT_S			0x03
27685e4215SJerry Wong #define M98090_REG_QUICK_SYSTEM_CLOCK		0x04
28685e4215SJerry Wong #define M98090_REG_QUICK_SAMPLE_RATE		0x05
29685e4215SJerry Wong #define M98090_REG_DAI_INTERFACE		0x06
30685e4215SJerry Wong #define M98090_REG_DAC_PATH			0x07
31685e4215SJerry Wong #define M98090_REG_MIC_DIRECT_TO_ADC		0x08
32685e4215SJerry Wong #define M98090_REG_LINE_TO_ADC			0x09
33685e4215SJerry Wong #define M98090_REG_ANALOG_MIC_LOOP		0x0A
34685e4215SJerry Wong #define M98090_REG_ANALOG_LINE_LOOP		0x0B
35685e4215SJerry Wong #define M98090_REG_RESERVED			0x0C
36685e4215SJerry Wong #define M98090_REG_LINE_INPUT_CONFIG		0x0D
37685e4215SJerry Wong #define M98090_REG_LINE_INPUT_LEVEL		0x0E
38685e4215SJerry Wong #define M98090_REG_INPUT_MODE			0x0F
39685e4215SJerry Wong #define M98090_REG_MIC1_INPUT_LEVEL		0x10
40685e4215SJerry Wong #define M98090_REG_MIC2_INPUT_LEVEL		0x11
41685e4215SJerry Wong #define M98090_REG_MIC_BIAS_VOLTAGE		0x12
42685e4215SJerry Wong #define M98090_REG_DIGITAL_MIC_ENABLE		0x13
43685e4215SJerry Wong #define M98090_REG_DIGITAL_MIC_CONFIG		0x14
44685e4215SJerry Wong #define M98090_REG_LEFT_ADC_MIXER		0x15
45685e4215SJerry Wong #define M98090_REG_RIGHT_ADC_MIXER		0x16
46685e4215SJerry Wong #define M98090_REG_LEFT_ADC_LEVEL		0x17
47685e4215SJerry Wong #define M98090_REG_RIGHT_ADC_LEVEL		0x18
48685e4215SJerry Wong #define M98090_REG_ADC_BIQUAD_LEVEL		0x19
49685e4215SJerry Wong #define M98090_REG_ADC_SIDETONE			0x1A
50685e4215SJerry Wong #define M98090_REG_SYSTEM_CLOCK			0x1B
51685e4215SJerry Wong #define M98090_REG_CLOCK_MODE			0x1C
52685e4215SJerry Wong #define M98090_REG_CLOCK_RATIO_NI_MSB		0x1D
53685e4215SJerry Wong #define M98090_REG_CLOCK_RATIO_NI_LSB		0x1E
54685e4215SJerry Wong #define M98090_REG_CLOCK_RATIO_MI_MSB		0x1F
55685e4215SJerry Wong #define M98090_REG_CLOCK_RATIO_MI_LSB		0x20
56685e4215SJerry Wong #define M98090_REG_MASTER_MODE			0x21
57685e4215SJerry Wong #define M98090_REG_INTERFACE_FORMAT		0x22
58685e4215SJerry Wong #define M98090_REG_TDM_CONTROL			0x23
59685e4215SJerry Wong #define M98090_REG_TDM_FORMAT			0x24
60685e4215SJerry Wong #define M98090_REG_IO_CONFIGURATION		0x25
61685e4215SJerry Wong #define M98090_REG_FILTER_CONFIG		0x26
62685e4215SJerry Wong #define M98090_REG_DAI_PLAYBACK_LEVEL		0x27
63685e4215SJerry Wong #define M98090_REG_DAI_PLAYBACK_LEVEL_EQ	0x28
64685e4215SJerry Wong #define M98090_REG_LEFT_HP_MIXER		0x29
65685e4215SJerry Wong #define M98090_REG_RIGHT_HP_MIXER		0x2A
66685e4215SJerry Wong #define M98090_REG_HP_CONTROL			0x2B
67685e4215SJerry Wong #define M98090_REG_LEFT_HP_VOLUME		0x2C
68685e4215SJerry Wong #define M98090_REG_RIGHT_HP_VOLUME		0x2D
69685e4215SJerry Wong #define M98090_REG_LEFT_SPK_MIXER		0x2E
70685e4215SJerry Wong #define M98090_REG_RIGHT_SPK_MIXER		0x2F
71685e4215SJerry Wong #define M98090_REG_SPK_CONTROL			0x30
72685e4215SJerry Wong #define M98090_REG_LEFT_SPK_VOLUME		0x31
73685e4215SJerry Wong #define M98090_REG_RIGHT_SPK_VOLUME		0x32
74685e4215SJerry Wong #define M98090_REG_DRC_TIMING			0x33
75685e4215SJerry Wong #define M98090_REG_DRC_COMPRESSOR		0x34
76685e4215SJerry Wong #define M98090_REG_DRC_EXPANDER			0x35
77685e4215SJerry Wong #define M98090_REG_DRC_GAIN			0x36
78685e4215SJerry Wong #define M98090_REG_RCV_LOUTL_MIXER		0x37
79685e4215SJerry Wong #define M98090_REG_RCV_LOUTL_CONTROL		0x38
80685e4215SJerry Wong #define M98090_REG_RCV_LOUTL_VOLUME		0x39
81685e4215SJerry Wong #define M98090_REG_LOUTR_MIXER			0x3A
82685e4215SJerry Wong #define M98090_REG_LOUTR_CONTROL		0x3B
83685e4215SJerry Wong #define M98090_REG_LOUTR_VOLUME			0x3C
84685e4215SJerry Wong #define M98090_REG_JACK_DETECT			0x3D
85685e4215SJerry Wong #define M98090_REG_INPUT_ENABLE			0x3E
86685e4215SJerry Wong #define M98090_REG_OUTPUT_ENABLE		0x3F
87685e4215SJerry Wong #define M98090_REG_LEVEL_CONTROL		0x40
88685e4215SJerry Wong #define M98090_REG_DSP_FILTER_ENABLE		0x41
89685e4215SJerry Wong #define M98090_REG_BIAS_CONTROL			0x42
90685e4215SJerry Wong #define M98090_REG_DAC_CONTROL			0x43
91685e4215SJerry Wong #define M98090_REG_ADC_CONTROL			0x44
92685e4215SJerry Wong #define M98090_REG_DEVICE_SHUTDOWN		0x45
93685e4215SJerry Wong #define M98090_REG_EQUALIZER_BASE		0x46
94685e4215SJerry Wong #define M98090_REG_RECORD_BIQUAD_BASE		0xAF
95685e4215SJerry Wong #define M98090_REG_DMIC3_VOLUME			0xBE
96685e4215SJerry Wong #define M98090_REG_DMIC4_VOLUME			0xBF
97685e4215SJerry Wong #define M98090_REG_DMIC34_BQ_PREATTEN		0xC0
98685e4215SJerry Wong #define M98090_REG_RECORD_TDM_SLOT		0xC1
99685e4215SJerry Wong #define M98090_REG_SAMPLE_RATE			0xC2
100685e4215SJerry Wong #define M98090_REG_DMIC34_BIQUAD_BASE		0xC3
101685e4215SJerry Wong #define M98090_REG_REVISION_ID			0xFF
102685e4215SJerry Wong 
103685e4215SJerry Wong #define M98090_REG_CNT				(0xFF+1)
104685e4215SJerry Wong #define MAX98090_MAX_REGISTER			0xFF
105685e4215SJerry Wong 
106685e4215SJerry Wong /* MAX98090 Register Bit Fields */
107685e4215SJerry Wong 
108685e4215SJerry Wong /*
109685e4215SJerry Wong  * M98090_REG_SOFTWARE_RESET
110685e4215SJerry Wong  */
111685e4215SJerry Wong #define M98090_SWRESET_MASK		(1<<7)
112685e4215SJerry Wong #define M98090_SWRESET_SHIFT		7
113685e4215SJerry Wong #define M98090_SWRESET_WIDTH		1
114685e4215SJerry Wong 
115685e4215SJerry Wong /*
116685e4215SJerry Wong  * M98090_REG_DEVICE_STATUS
117685e4215SJerry Wong  */
118685e4215SJerry Wong #define M98090_CLD_MASK			(1<<7)
119685e4215SJerry Wong #define M98090_CLD_SHIFT		7
120685e4215SJerry Wong #define M98090_CLD_WIDTH		1
121685e4215SJerry Wong #define M98090_SLD_MASK			(1<<6)
122685e4215SJerry Wong #define M98090_SLD_SHIFT		6
123685e4215SJerry Wong #define M98090_SLD_WIDTH		1
124685e4215SJerry Wong #define M98090_ULK_MASK			(1<<5)
125685e4215SJerry Wong #define M98090_ULK_SHIFT		5
126685e4215SJerry Wong #define M98090_ULK_WIDTH		1
127685e4215SJerry Wong #define M98090_JDET_MASK		(1<<2)
128685e4215SJerry Wong #define M98090_JDET_SHIFT		2
129685e4215SJerry Wong #define M98090_JDET_WIDTH		1
130685e4215SJerry Wong #define M98090_DRCACT_MASK		(1<<1)
131685e4215SJerry Wong #define M98090_DRCACT_SHIFT		1
132685e4215SJerry Wong #define M98090_DRCACT_WIDTH		1
133685e4215SJerry Wong #define M98090_DRCCLP_MASK		(1<<0)
134685e4215SJerry Wong #define M98090_DRCCLP_SHIFT		0
135685e4215SJerry Wong #define M98090_DRCCLP_WIDTH		1
136685e4215SJerry Wong 
137685e4215SJerry Wong /*
138685e4215SJerry Wong  * M98090_REG_JACK_STATUS
139685e4215SJerry Wong  */
140685e4215SJerry Wong #define M98090_LSNS_MASK		(1<<2)
141685e4215SJerry Wong #define M98090_LSNS_SHIFT		2
142685e4215SJerry Wong #define M98090_LSNS_WIDTH		1
143685e4215SJerry Wong #define M98090_JKSNS_MASK		(1<<1)
144685e4215SJerry Wong #define M98090_JKSNS_SHIFT		1
145685e4215SJerry Wong #define M98090_JKSNS_WIDTH		1
146685e4215SJerry Wong 
147685e4215SJerry Wong /*
148685e4215SJerry Wong  * M98090_REG_INTERRUPT_S
149685e4215SJerry Wong  */
150685e4215SJerry Wong #define M98090_ICLD_MASK		(1<<7)
151685e4215SJerry Wong #define M98090_ICLD_SHIFT		7
152685e4215SJerry Wong #define M98090_ICLD_WIDTH		1
153685e4215SJerry Wong #define M98090_ISLD_MASK		(1<<6)
154685e4215SJerry Wong #define M98090_ISLD_SHIFT		6
155685e4215SJerry Wong #define M98090_ISLD_WIDTH		1
156685e4215SJerry Wong #define M98090_IULK_MASK		(1<<5)
157685e4215SJerry Wong #define M98090_IULK_SHIFT		5
158685e4215SJerry Wong #define M98090_IULK_WIDTH		1
159685e4215SJerry Wong #define M98090_IJDET_MASK		(1<<2)
160685e4215SJerry Wong #define M98090_IJDET_SHIFT		2
161685e4215SJerry Wong #define M98090_IJDET_WIDTH		1
162685e4215SJerry Wong #define M98090_IDRCACT_MASK		(1<<1)
163685e4215SJerry Wong #define M98090_IDRCACT_SHIFT		1
164685e4215SJerry Wong #define M98090_IDRCACT_WIDTH		1
165685e4215SJerry Wong #define M98090_IDRCCLP_MASK		(1<<0)
166685e4215SJerry Wong #define M98090_IDRCCLP_SHIFT		0
167685e4215SJerry Wong #define M98090_IDRCCLP_WIDTH		1
168685e4215SJerry Wong 
169685e4215SJerry Wong /*
170685e4215SJerry Wong  * M98090_REG_QUICK_SYSTEM_CLOCK
171685e4215SJerry Wong  */
172685e4215SJerry Wong #define M98090_26M_MASK			(1<<7)
173685e4215SJerry Wong #define M98090_26M_SHIFT		7
174685e4215SJerry Wong #define M98090_26M_WIDTH		1
175685e4215SJerry Wong #define M98090_19P2M_MASK		(1<<6)
176685e4215SJerry Wong #define M98090_19P2M_SHIFT		6
177685e4215SJerry Wong #define M98090_19P2M_WIDTH		1
178685e4215SJerry Wong #define M98090_13M_MASK			(1<<5)
179685e4215SJerry Wong #define M98090_13M_SHIFT		5
180685e4215SJerry Wong #define M98090_13M_WIDTH		1
181685e4215SJerry Wong #define M98090_12P288M_MASK		(1<<4)
182685e4215SJerry Wong #define M98090_12P288M_SHIFT		4
183685e4215SJerry Wong #define M98090_12P288M_WIDTH		1
184685e4215SJerry Wong #define M98090_12M_MASK			(1<<3)
185685e4215SJerry Wong #define M98090_12M_SHIFT		3
186685e4215SJerry Wong #define M98090_12M_WIDTH		1
187685e4215SJerry Wong #define M98090_11P2896M_MASK		(1<<2)
188685e4215SJerry Wong #define M98090_11P2896M_SHIFT		2
189685e4215SJerry Wong #define M98090_11P2896M_WIDTH		1
190685e4215SJerry Wong #define M98090_256FS_MASK		(1<<0)
191685e4215SJerry Wong #define M98090_256FS_SHIFT		0
192685e4215SJerry Wong #define M98090_256FS_WIDTH		1
193685e4215SJerry Wong #define M98090_CLK_ALL_SHIFT		0
194685e4215SJerry Wong #define M98090_CLK_ALL_WIDTH		8
195685e4215SJerry Wong #define M98090_CLK_ALL_NUM		(1<<M98090_CLK_ALL_WIDTH)
196685e4215SJerry Wong 
197685e4215SJerry Wong /*
198685e4215SJerry Wong  * M98090_REG_QUICK_SAMPLE_RATE
199685e4215SJerry Wong  */
200685e4215SJerry Wong #define M98090_SR_96K_MASK		(1<<5)
201685e4215SJerry Wong #define M98090_SR_96K_SHIFT		5
202685e4215SJerry Wong #define M98090_SR_96K_WIDTH		1
203685e4215SJerry Wong #define M98090_SR_32K_MASK		(1<<4)
204685e4215SJerry Wong #define M98090_SR_32K_SHIFT		4
205685e4215SJerry Wong #define M98090_SR_32K_WIDTH		1
206685e4215SJerry Wong #define M98090_SR_48K_MASK		(1<<3)
207685e4215SJerry Wong #define M98090_SR_48K_SHIFT		3
208685e4215SJerry Wong #define M98090_SR_48K_WIDTH		1
209685e4215SJerry Wong #define M98090_SR_44K1_MASK		(1<<2)
210685e4215SJerry Wong #define M98090_SR_44K1_SHIFT		2
211685e4215SJerry Wong #define M98090_SR_44K1_WIDTH		1
212685e4215SJerry Wong #define M98090_SR_16K_MASK		(1<<1)
213685e4215SJerry Wong #define M98090_SR_16K_SHIFT		1
214685e4215SJerry Wong #define M98090_SR_16K_WIDTH		1
215685e4215SJerry Wong #define M98090_SR_8K_MASK		(1<<0)
216685e4215SJerry Wong #define M98090_SR_8K_SHIFT		0
217685e4215SJerry Wong #define M98090_SR_8K_WIDTH		1
218685e4215SJerry Wong #define M98090_SR_MASK			0x3F
219685e4215SJerry Wong #define M98090_SR_ALL_SHIFT		0
220685e4215SJerry Wong #define M98090_SR_ALL_WIDTH		8
221685e4215SJerry Wong #define M98090_SR_ALL_NUM		(1<<M98090_SR_ALL_WIDTH)
222685e4215SJerry Wong 
223685e4215SJerry Wong /*
224685e4215SJerry Wong  * M98090_REG_DAI_INTERFACE
225685e4215SJerry Wong  */
226685e4215SJerry Wong #define M98090_RJ_M_MASK		(1<<5)
227685e4215SJerry Wong #define M98090_RJ_M_SHIFT		5
228685e4215SJerry Wong #define M98090_RJ_M_WIDTH		1
229685e4215SJerry Wong #define M98090_RJ_S_MASK		(1<<4)
230685e4215SJerry Wong #define M98090_RJ_S_SHIFT		4
231685e4215SJerry Wong #define M98090_RJ_S_WIDTH		1
232685e4215SJerry Wong #define M98090_LJ_M_MASK		(1<<3)
233685e4215SJerry Wong #define M98090_LJ_M_SHIFT		3
234685e4215SJerry Wong #define M98090_LJ_M_WIDTH		1
235685e4215SJerry Wong #define M98090_LJ_S_MASK		(1<<2)
236685e4215SJerry Wong #define M98090_LJ_S_SHIFT		2
237685e4215SJerry Wong #define M98090_LJ_S_WIDTH		1
238685e4215SJerry Wong #define M98090_I2S_M_MASK		(1<<1)
239685e4215SJerry Wong #define M98090_I2S_M_SHIFT		1
240685e4215SJerry Wong #define M98090_I2S_M_WIDTH		1
241685e4215SJerry Wong #define M98090_I2S_S_MASK		(1<<0)
242685e4215SJerry Wong #define M98090_I2S_S_SHIFT		0
243685e4215SJerry Wong #define M98090_I2S_S_WIDTH		1
244685e4215SJerry Wong #define M98090_DAI_ALL_SHIFT		0
245685e4215SJerry Wong #define M98090_DAI_ALL_WIDTH		8
246685e4215SJerry Wong #define M98090_DAI_ALL_NUM		(1<<M98090_DAI_ALL_WIDTH)
247685e4215SJerry Wong 
248685e4215SJerry Wong /*
249685e4215SJerry Wong  * M98090_REG_DAC_PATH
250685e4215SJerry Wong  */
251685e4215SJerry Wong #define M98090_DIG2_HP_MASK		(1<<7)
252685e4215SJerry Wong #define M98090_DIG2_HP_SHIFT		7
253685e4215SJerry Wong #define M98090_DIG2_HP_WIDTH		1
254685e4215SJerry Wong #define M98090_DIG2_EAR_MASK		(1<<6)
255685e4215SJerry Wong #define M98090_DIG2_EAR_SHIFT		6
256685e4215SJerry Wong #define M98090_DIG2_EAR_WIDTH		1
257685e4215SJerry Wong #define M98090_DIG2_SPK_MASK		(1<<5)
258685e4215SJerry Wong #define M98090_DIG2_SPK_SHIFT		5
259685e4215SJerry Wong #define M98090_DIG2_SPK_WIDTH		1
260685e4215SJerry Wong #define M98090_DIG2_LOUT_MASK		(1<<4)
261685e4215SJerry Wong #define M98090_DIG2_LOUT_SHIFT		4
262685e4215SJerry Wong #define M98090_DIG2_LOUT_WIDTH		1
263685e4215SJerry Wong #define M98090_DIG2_ALL_SHIFT		0
264685e4215SJerry Wong #define M98090_DIG2_ALL_WIDTH		8
265685e4215SJerry Wong #define M98090_DIG2_ALL_NUM		(1<<M98090_DIG2_ALL_WIDTH)
266685e4215SJerry Wong 
267685e4215SJerry Wong /*
268685e4215SJerry Wong  * M98090_REG_MIC_DIRECT_TO_ADC
269685e4215SJerry Wong  */
270685e4215SJerry Wong #define M98090_IN12_MIC1_MASK		(1<<7)
271685e4215SJerry Wong #define M98090_IN12_MIC1_SHIFT		7
272685e4215SJerry Wong #define M98090_IN12_MIC1_WIDTH		1
273685e4215SJerry Wong #define M98090_IN34_MIC2_MASK		(1<<6)
274685e4215SJerry Wong #define M98090_IN34_MIC2_SHIFT		6
275685e4215SJerry Wong #define M98090_IN34_MIC2_WIDTH		1
276685e4215SJerry Wong #define M98090_IN56_MIC1_MASK		(1<<5)
277685e4215SJerry Wong #define M98090_IN56_MIC1_SHIFT		5
278685e4215SJerry Wong #define M98090_IN56_MIC1_WIDTH		1
279685e4215SJerry Wong #define M98090_IN56_MIC2_MASK		(1<<4)
280685e4215SJerry Wong #define M98090_IN56_MIC2_SHIFT		4
281685e4215SJerry Wong #define M98090_IN56_MIC2_WIDTH		1
282685e4215SJerry Wong #define M98090_IN12_DADC_MASK		(1<<3)
283685e4215SJerry Wong #define M98090_IN12_DADC_SHIFT		3
284685e4215SJerry Wong #define M98090_IN12_DADC_WIDTH		1
285685e4215SJerry Wong #define M98090_IN34_DADC_MASK		(1<<2)
286685e4215SJerry Wong #define M98090_IN34_DADC_SHIFT		2
287685e4215SJerry Wong #define M98090_IN34_DADC_WIDTH		1
288685e4215SJerry Wong #define M98090_IN56_DADC_MASK		(1<<1)
289685e4215SJerry Wong #define M98090_IN56_DADC_SHIFT		1
290685e4215SJerry Wong #define M98090_IN56_DADC_WIDTH		1
291685e4215SJerry Wong #define M98090_MIC_ALL_SHIFT		0
292685e4215SJerry Wong #define M98090_MIC_ALL_WIDTH		8
293685e4215SJerry Wong #define M98090_MIC_ALL_NUM		(1<<M98090_MIC_ALL_WIDTH)
294685e4215SJerry Wong 
295685e4215SJerry Wong /*
296685e4215SJerry Wong  * M98090_REG_LINE_TO_ADC
297685e4215SJerry Wong  */
298685e4215SJerry Wong #define M98090_IN12S_AB_MASK		(1<<7)
299685e4215SJerry Wong #define M98090_IN12S_AB_SHIFT		7
300685e4215SJerry Wong #define M98090_IN12S_AB_WIDTH		1
301685e4215SJerry Wong #define M98090_IN34S_AB_MASK		(1<<6)
302685e4215SJerry Wong #define M98090_IN34S_AB_SHIFT		6
303685e4215SJerry Wong #define M98090_IN34S_AB_WIDTH		1
304685e4215SJerry Wong #define M98090_IN56S_AB_MASK		(1<<5)
305685e4215SJerry Wong #define M98090_IN56S_AB_SHIFT		5
306685e4215SJerry Wong #define M98090_IN56S_AB_WIDTH		1
307685e4215SJerry Wong #define M98090_IN34D_A_MASK		(1<<4)
308685e4215SJerry Wong #define M98090_IN34D_A_SHIFT		4
309685e4215SJerry Wong #define M98090_IN34D_A_WIDTH		1
310685e4215SJerry Wong #define M98090_IN56D_B_MASK		(1<<3)
311685e4215SJerry Wong #define M98090_IN56D_B_SHIFT		3
312685e4215SJerry Wong #define M98090_IN56D_B_WIDTH		1
313685e4215SJerry Wong #define M98090_LINE_ALL_SHIFT		0
314685e4215SJerry Wong #define M98090_LINE_ALL_WIDTH		8
315685e4215SJerry Wong #define M98090_LINE_ALL_NUM		(1<<M98090_LINE_ALL_WIDTH)
316685e4215SJerry Wong 
317685e4215SJerry Wong /*
318685e4215SJerry Wong  * M98090_REG_ANALOG_MIC_LOOP
319685e4215SJerry Wong  */
320685e4215SJerry Wong #define M98090_IN12_M1HPL_MASK		(1<<7)
321685e4215SJerry Wong #define M98090_IN12_M1HPL_SHIFT		7
322685e4215SJerry Wong #define M98090_IN12_M1HPL_WIDTH		1
323685e4215SJerry Wong #define M98090_IN12_M1SPKL_MASK		(1<<6)
324685e4215SJerry Wong #define M98090_IN12_M1SPKL_SHIFT	6
325685e4215SJerry Wong #define M98090_IN12_M1SPKL_WIDTH	1
326685e4215SJerry Wong #define M98090_IN12_M1EAR_MASK		(1<<5)
327685e4215SJerry Wong #define M98090_IN12_M1EAR_SHIFT		5
328685e4215SJerry Wong #define M98090_IN12_M1EAR_WIDTH		1
329685e4215SJerry Wong #define M98090_IN12_M1LOUTL_MASK	(1<<4)
330685e4215SJerry Wong #define M98090_IN12_M1LOUTL_SHIFT	4
331685e4215SJerry Wong #define M98090_IN12_M1LOUTL_WIDTH	1
332685e4215SJerry Wong #define M98090_IN34_M2HPR_MASK		(1<<3)
333685e4215SJerry Wong #define M98090_IN34_M2HPR_SHIFT		3
334685e4215SJerry Wong #define M98090_IN34_M2HPR_WIDTH		1
335685e4215SJerry Wong #define M98090_IN34_M2SPKR_MASK		(1<<2)
336685e4215SJerry Wong #define M98090_IN34_M2SPKR_SHIFT	2
337685e4215SJerry Wong #define M98090_IN34_M2SPKR_WIDTH	1
338685e4215SJerry Wong #define M98090_IN34_M2EAR_MASK		(1<<1)
339685e4215SJerry Wong #define M98090_IN34_M2EAR_SHIFT		1
340685e4215SJerry Wong #define M98090_IN34_M2EAR_WIDTH		1
341685e4215SJerry Wong #define M98090_IN34_M2LOUTR_MASK	(1<<0)
342685e4215SJerry Wong #define M98090_IN34_M2LOUTR_SHIFT	0
343685e4215SJerry Wong #define M98090_IN34_M2LOUTR_WIDTH	1
344685e4215SJerry Wong #define M98090_AMIC_ALL_SHIFT		0
345685e4215SJerry Wong #define M98090_AMIC_ALL_WIDTH		8
346685e4215SJerry Wong #define M98090_AMIC_ALL_NUM		(1<<M98090_AMIC_ALL_WIDTH)
347685e4215SJerry Wong 
348685e4215SJerry Wong /*
349685e4215SJerry Wong  * M98090_REG_ANALOG_LINE_LOOP
350685e4215SJerry Wong  */
351685e4215SJerry Wong #define M98090_IN12S_ABHP_MASK		(1<<7)
352685e4215SJerry Wong #define M98090_IN12S_ABHP_SHIFT		7
353685e4215SJerry Wong #define M98090_IN12S_ABHP_WIDTH		1
354685e4215SJerry Wong #define M98090_IN34D_ASPKL_MASK		(1<<6)
355685e4215SJerry Wong #define M98090_IN34D_ASPKL_SHIFT	6
356685e4215SJerry Wong #define M98090_IN34D_ASPKL_WIDTH	1
357685e4215SJerry Wong #define M98090_IN34D_AEAR_MASK		(1<<5)
358685e4215SJerry Wong #define M98090_IN34D_AEAR_SHIFT		5
359685e4215SJerry Wong #define M98090_IN34D_AEAR_WIDTH		1
360685e4215SJerry Wong #define M98090_IN12S_ABLOUT_MASK	(1<<4)
361685e4215SJerry Wong #define M98090_IN12S_ABLOUT_SHIFT	4
362685e4215SJerry Wong #define M98090_IN12S_ABLOUT_WIDTH	1
363685e4215SJerry Wong #define M98090_IN34S_ABHP_MASK		(1<<3)
364685e4215SJerry Wong #define M98090_IN34S_ABHP_SHIFT		3
365685e4215SJerry Wong #define M98090_IN34S_ABHP_WIDTH		1
366685e4215SJerry Wong #define M98090_IN56D_BSPKR_MASK		(1<<2)
367685e4215SJerry Wong #define M98090_IN56D_BSPKR_SHIFT	2
368685e4215SJerry Wong #define M98090_IN56D_BSPKR_WIDTH	1
369685e4215SJerry Wong #define M98090_IN56D_BEAR_MASK		(1<<1)
370685e4215SJerry Wong #define M98090_IN56D_BEAR_SHIFT		1
371685e4215SJerry Wong #define M98090_IN56D_BEAR_WIDTH		1
372685e4215SJerry Wong #define M98090_IN34S_ABLOUT_MASK	(1<<0)
373685e4215SJerry Wong #define M98090_IN34S_ABLOUT_SHIFT	0
374685e4215SJerry Wong #define M98090_IN34S_ABLOUT_WIDTH	1
375685e4215SJerry Wong #define M98090_ALIN_ALL_SHIFT		0
376685e4215SJerry Wong #define M98090_ALIN_ALL_WIDTH		8
377685e4215SJerry Wong #define M98090_ALIN_ALL_NUM		(1<<M98090_ALIN_ALL_WIDTH)
378685e4215SJerry Wong 
379685e4215SJerry Wong /*
380685e4215SJerry Wong  * M98090_REG_RESERVED
381685e4215SJerry Wong  */
382685e4215SJerry Wong 
383685e4215SJerry Wong /*
384685e4215SJerry Wong  * M98090_REG_LINE_INPUT_CONFIG
385685e4215SJerry Wong  */
386685e4215SJerry Wong #define M98090_IN34DIFF_MASK		(1<<7)
387685e4215SJerry Wong #define M98090_IN34DIFF_SHIFT		7
388685e4215SJerry Wong #define M98090_IN34DIFF_WIDTH		1
389685e4215SJerry Wong #define M98090_IN56DIFF_MASK		(1<<6)
390685e4215SJerry Wong #define M98090_IN56DIFF_SHIFT		6
391685e4215SJerry Wong #define M98090_IN56DIFF_WIDTH		1
392685e4215SJerry Wong #define M98090_IN1SEEN_MASK		(1<<5)
393685e4215SJerry Wong #define M98090_IN1SEEN_SHIFT		5
394685e4215SJerry Wong #define M98090_IN1SEEN_WIDTH		1
395685e4215SJerry Wong #define M98090_IN2SEEN_MASK		(1<<4)
396685e4215SJerry Wong #define M98090_IN2SEEN_SHIFT		4
397685e4215SJerry Wong #define M98090_IN2SEEN_WIDTH		1
398685e4215SJerry Wong #define M98090_IN3SEEN_MASK		(1<<3)
399685e4215SJerry Wong #define M98090_IN3SEEN_SHIFT		3
400685e4215SJerry Wong #define M98090_IN3SEEN_WIDTH		1
401685e4215SJerry Wong #define M98090_IN4SEEN_MASK		(1<<2)
402685e4215SJerry Wong #define M98090_IN4SEEN_SHIFT		2
403685e4215SJerry Wong #define M98090_IN4SEEN_WIDTH		1
404685e4215SJerry Wong #define M98090_IN5SEEN_MASK		(1<<1)
405685e4215SJerry Wong #define M98090_IN5SEEN_SHIFT		1
406685e4215SJerry Wong #define M98090_IN5SEEN_WIDTH		1
407685e4215SJerry Wong #define M98090_IN6SEEN_MASK		(1<<0)
408685e4215SJerry Wong #define M98090_IN6SEEN_SHIFT		0
409685e4215SJerry Wong #define M98090_IN6SEEN_WIDTH		1
410685e4215SJerry Wong 
411685e4215SJerry Wong /*
412685e4215SJerry Wong  * M98090_REG_LINE_INPUT_LEVEL
413685e4215SJerry Wong  */
414685e4215SJerry Wong #define M98090_MIXG135_MASK		(1<<7)
415685e4215SJerry Wong #define M98090_MIXG135_SHIFT		7
416685e4215SJerry Wong #define M98090_MIXG135_WIDTH		1
417685e4215SJerry Wong #define M98090_MIXG135_NUM		(1<<M98090_MIXG135_WIDTH)
418685e4215SJerry Wong #define M98090_MIXG246_MASK		(1<<6)
419685e4215SJerry Wong #define M98090_MIXG246_SHIFT		6
420685e4215SJerry Wong #define M98090_MIXG246_WIDTH		1
421685e4215SJerry Wong #define M98090_MIXG246_NUM		(1<<M98090_MIXG246_WIDTH)
422685e4215SJerry Wong #define M98090_LINAPGA_MASK		(7<<3)
423685e4215SJerry Wong #define M98090_LINAPGA_SHIFT		3
424685e4215SJerry Wong #define M98090_LINAPGA_WIDTH		3
425685e4215SJerry Wong #define M98090_LINAPGA_NUM		6
426685e4215SJerry Wong #define M98090_LINBPGA_MASK		(7<<0)
427685e4215SJerry Wong #define M98090_LINBPGA_SHIFT		0
428685e4215SJerry Wong #define M98090_LINBPGA_WIDTH		3
429685e4215SJerry Wong #define M98090_LINBPGA_NUM		6
430685e4215SJerry Wong 
431685e4215SJerry Wong /*
432685e4215SJerry Wong  * M98090_REG_INPUT_MODE
433685e4215SJerry Wong  */
434685e4215SJerry Wong #define M98090_EXTBUFA_MASK		(1<<7)
435685e4215SJerry Wong #define M98090_EXTBUFA_SHIFT		7
436685e4215SJerry Wong #define M98090_EXTBUFA_WIDTH		1
437685e4215SJerry Wong #define M98090_EXTBUFA_NUM		(1<<M98090_EXTBUFA_WIDTH)
438685e4215SJerry Wong #define M98090_EXTBUFB_MASK		(1<<6)
439685e4215SJerry Wong #define M98090_EXTBUFB_SHIFT		6
440685e4215SJerry Wong #define M98090_EXTBUFB_WIDTH		1
441685e4215SJerry Wong #define M98090_EXTBUFB_NUM		(1<<M98090_EXTBUFB_WIDTH)
442685e4215SJerry Wong #define M98090_EXTMIC_MASK		(3<<0)
443685e4215SJerry Wong #define M98090_EXTMIC_SHIFT		0
444685e4215SJerry Wong #define M98090_EXTMIC1_SHIFT		0
445685e4215SJerry Wong #define M98090_EXTMIC2_SHIFT		1
446685e4215SJerry Wong #define M98090_EXTMIC_WIDTH		2
447685e4215SJerry Wong #define M98090_EXTMIC_NONE		(0<<0)
448685e4215SJerry Wong #define M98090_EXTMIC_MIC1		(1<<0)
449685e4215SJerry Wong #define M98090_EXTMIC_MIC2		(2<<0)
450685e4215SJerry Wong 
451685e4215SJerry Wong /*
452685e4215SJerry Wong  * M98090_REG_MIC1_INPUT_LEVEL
453685e4215SJerry Wong  */
454685e4215SJerry Wong #define M98090_MIC_PA1EN_MASK		(3<<5)
455685e4215SJerry Wong #define M98090_MIC_PA1EN_SHIFT		5
456685e4215SJerry Wong #define M98090_MIC_PA1EN_WIDTH		2
457685e4215SJerry Wong #define M98090_MIC_PA1EN_NUM		3
458685e4215SJerry Wong #define M98090_MIC_PGAM1_MASK		(31<<0)
459685e4215SJerry Wong #define M98090_MIC_PGAM1_SHIFT		0
460685e4215SJerry Wong #define M98090_MIC_PGAM1_WIDTH		5
461685e4215SJerry Wong #define M98090_MIC_PGAM1_NUM		21
462685e4215SJerry Wong 
463685e4215SJerry Wong /*
464685e4215SJerry Wong  * M98090_REG_MIC2_INPUT_LEVEL
465685e4215SJerry Wong  */
466685e4215SJerry Wong #define M98090_MIC_PA2EN_MASK		(3<<5)
467685e4215SJerry Wong #define M98090_MIC_PA2EN_SHIFT		5
468685e4215SJerry Wong #define M98090_MIC_PA2EN_WIDTH		2
469685e4215SJerry Wong #define M98090_MIC_PA2EN_NUM		3
470685e4215SJerry Wong #define M98090_MIC_PGAM2_MASK		(31<<0)
471685e4215SJerry Wong #define M98090_MIC_PGAM2_SHIFT		0
472685e4215SJerry Wong #define M98090_MIC_PGAM2_WIDTH		5
473685e4215SJerry Wong #define M98090_MIC_PGAM2_NUM		21
474685e4215SJerry Wong 
475685e4215SJerry Wong /*
476685e4215SJerry Wong  * M98090_REG_MIC_BIAS_VOLTAGE
477685e4215SJerry Wong  */
478685e4215SJerry Wong #define M98090_MBVSEL_MASK		(3<<0)
479685e4215SJerry Wong #define M98090_MBVSEL_SHIFT		0
480685e4215SJerry Wong #define M98090_MBVSEL_WIDTH		2
481685e4215SJerry Wong #define M98090_MBVSEL_2V8		(3<<0)
482685e4215SJerry Wong #define M98090_MBVSEL_2V55		(2<<0)
483685e4215SJerry Wong #define M98090_MBVSEL_2V4		(1<<0)
484685e4215SJerry Wong #define M98090_MBVSEL_2V2		(0<<0)
485685e4215SJerry Wong 
486685e4215SJerry Wong /*
487685e4215SJerry Wong  * M98090_REG_DIGITAL_MIC_ENABLE
488685e4215SJerry Wong  */
489685e4215SJerry Wong #define M98090_MICCLK_MASK		(7<<4)
490685e4215SJerry Wong #define M98090_MICCLK_SHIFT		4
491685e4215SJerry Wong #define M98090_MICCLK_WIDTH		3
492685e4215SJerry Wong #define M98090_DIGMIC4_MASK		(1<<3)
493685e4215SJerry Wong #define M98090_DIGMIC4_SHIFT		3
494685e4215SJerry Wong #define M98090_DIGMIC4_WIDTH		1
495685e4215SJerry Wong #define M98090_DIGMIC4_NUM		(1<<M98090_DIGMIC4_WIDTH)
496685e4215SJerry Wong #define M98090_DIGMIC3_MASK		(1<<2)
497685e4215SJerry Wong #define M98090_DIGMIC3_SHIFT		2
498685e4215SJerry Wong #define M98090_DIGMIC3_WIDTH		1
499685e4215SJerry Wong #define M98090_DIGMIC3_NUM		(1<<M98090_DIGMIC3_WIDTH)
500685e4215SJerry Wong #define M98090_DIGMICR_MASK		(1<<1)
501685e4215SJerry Wong #define M98090_DIGMICR_SHIFT		1
502685e4215SJerry Wong #define M98090_DIGMICR_WIDTH		1
503685e4215SJerry Wong #define M98090_DIGMICR_NUM		(1<<M98090_DIGMICR_WIDTH)
504685e4215SJerry Wong #define M98090_DIGMICL_MASK		(1<<0)
505685e4215SJerry Wong #define M98090_DIGMICL_SHIFT		0
506685e4215SJerry Wong #define M98090_DIGMICL_WIDTH		1
507685e4215SJerry Wong #define M98090_DIGMICL_NUM		(1<<M98090_DIGMICL_WIDTH)
508685e4215SJerry Wong 
509685e4215SJerry Wong /*
510685e4215SJerry Wong  * M98090_REG_DIGITAL_MIC_CONFIG
511685e4215SJerry Wong  */
512685e4215SJerry Wong #define M98090_DMIC_COMP_MASK		(15<<4)
513685e4215SJerry Wong #define M98090_DMIC_COMP_SHIFT		4
514685e4215SJerry Wong #define M98090_DMIC_COMP_WIDTH		4
515685e4215SJerry Wong #define M98090_DMIC_COMP_NUM		(1<<M98090_DMIC_COMP_WIDTH)
516685e4215SJerry Wong #define M98090_DMIC_FREQ_MASK		(3<<0)
517685e4215SJerry Wong #define M98090_DMIC_FREQ_SHIFT		0
518685e4215SJerry Wong #define M98090_DMIC_FREQ_WIDTH		2
519685e4215SJerry Wong 
520685e4215SJerry Wong /*
521685e4215SJerry Wong  * M98090_REG_LEFT_ADC_MIXER
522685e4215SJerry Wong  */
523685e4215SJerry Wong #define M98090_MIXADL_MIC2_MASK		(1<<6)
524685e4215SJerry Wong #define M98090_MIXADL_MIC2_SHIFT	6
525685e4215SJerry Wong #define M98090_MIXADL_MIC2_WIDTH	1
526685e4215SJerry Wong #define M98090_MIXADL_MIC1_MASK		(1<<5)
527685e4215SJerry Wong #define M98090_MIXADL_MIC1_SHIFT	5
528685e4215SJerry Wong #define M98090_MIXADL_MIC1_WIDTH	1
529685e4215SJerry Wong #define M98090_MIXADL_LINEB_MASK	(1<<4)
530685e4215SJerry Wong #define M98090_MIXADL_LINEB_SHIFT	4
531685e4215SJerry Wong #define M98090_MIXADL_LINEB_WIDTH	1
532685e4215SJerry Wong #define M98090_MIXADL_LINEA_MASK	(1<<3)
533685e4215SJerry Wong #define M98090_MIXADL_LINEA_SHIFT	3
534685e4215SJerry Wong #define M98090_MIXADL_LINEA_WIDTH	1
535685e4215SJerry Wong #define M98090_MIXADL_IN65DIFF_MASK	(1<<2)
536685e4215SJerry Wong #define M98090_MIXADL_IN65DIFF_SHIFT	2
537685e4215SJerry Wong #define M98090_MIXADL_IN65DIFF_WIDTH	1
538685e4215SJerry Wong #define M98090_MIXADL_IN34DIFF_MASK	(1<<1)
539685e4215SJerry Wong #define M98090_MIXADL_IN34DIFF_SHIFT	1
540685e4215SJerry Wong #define M98090_MIXADL_IN34DIFF_WIDTH	1
541685e4215SJerry Wong #define M98090_MIXADL_IN12DIFF_MASK	(1<<0)
542685e4215SJerry Wong #define M98090_MIXADL_IN12DIFF_SHIFT	0
543685e4215SJerry Wong #define M98090_MIXADL_IN12DIFF_WIDTH	1
544685e4215SJerry Wong #define M98090_MIXADL_MASK		(255<<0)
545685e4215SJerry Wong #define M98090_MIXADL_SHIFT		0
546685e4215SJerry Wong #define M98090_MIXADL_WIDTH		8
547685e4215SJerry Wong 
548685e4215SJerry Wong /*
549685e4215SJerry Wong  * M98090_REG_RIGHT_ADC_MIXER
550685e4215SJerry Wong  */
551685e4215SJerry Wong #define M98090_MIXADR_MIC2_MASK		(1<<6)
552685e4215SJerry Wong #define M98090_MIXADR_MIC2_SHIFT	6
553685e4215SJerry Wong #define M98090_MIXADR_MIC2_WIDTH	1
554685e4215SJerry Wong #define M98090_MIXADR_MIC1_MASK		(1<<5)
555685e4215SJerry Wong #define M98090_MIXADR_MIC1_SHIFT	5
556685e4215SJerry Wong #define M98090_MIXADR_MIC1_WIDTH	1
557685e4215SJerry Wong #define M98090_MIXADR_LINEB_MASK	(1<<4)
558685e4215SJerry Wong #define M98090_MIXADR_LINEB_SHIFT	4
559685e4215SJerry Wong #define M98090_MIXADR_LINEB_WIDTH	1
560685e4215SJerry Wong #define M98090_MIXADR_LINEA_MASK	(1<<3)
561685e4215SJerry Wong #define M98090_MIXADR_LINEA_SHIFT	3
562685e4215SJerry Wong #define M98090_MIXADR_LINEA_WIDTH	1
563685e4215SJerry Wong #define M98090_MIXADR_IN65DIFF_MASK	(1<<2)
564685e4215SJerry Wong #define M98090_MIXADR_IN65DIFF_SHIFT	2
565685e4215SJerry Wong #define M98090_MIXADR_IN65DIFF_WIDTH	1
566685e4215SJerry Wong #define M98090_MIXADR_IN34DIFF_MASK	(1<<1)
567685e4215SJerry Wong #define M98090_MIXADR_IN34DIFF_SHIFT	1
568685e4215SJerry Wong #define M98090_MIXADR_IN34DIFF_WIDTH	1
569685e4215SJerry Wong #define M98090_MIXADR_IN12DIFF_MASK	(1<<0)
570685e4215SJerry Wong #define M98090_MIXADR_IN12DIFF_SHIFT	0
571685e4215SJerry Wong #define M98090_MIXADR_IN12DIFF_WIDTH	1
572685e4215SJerry Wong #define M98090_MIXADR_MASK		(255<<0)
573685e4215SJerry Wong #define M98090_MIXADR_SHIFT		0
574685e4215SJerry Wong #define M98090_MIXADR_WIDTH		8
575685e4215SJerry Wong 
576685e4215SJerry Wong /*
577685e4215SJerry Wong  * M98090_REG_LEFT_ADC_LEVEL
578685e4215SJerry Wong  */
579685e4215SJerry Wong #define M98090_AVLG_MASK		(7<<4)
580685e4215SJerry Wong #define M98090_AVLG_SHIFT		4
581685e4215SJerry Wong #define M98090_AVLG_WIDTH		3
582685e4215SJerry Wong #define M98090_AVLG_NUM			(1<<M98090_AVLG_WIDTH)
583685e4215SJerry Wong #define M98090_AVL_MASK			(15<<0)
584685e4215SJerry Wong #define M98090_AVL_SHIFT		0
585685e4215SJerry Wong #define M98090_AVL_WIDTH		4
586685e4215SJerry Wong #define M98090_AVL_NUM			(1<<M98090_AVL_WIDTH)
587685e4215SJerry Wong 
588685e4215SJerry Wong /*
589685e4215SJerry Wong  * M98090_REG_RIGHT_ADC_LEVEL
590685e4215SJerry Wong  */
591685e4215SJerry Wong #define M98090_AVRG_MASK		(7<<4)
592685e4215SJerry Wong #define M98090_AVRG_SHIFT		4
593685e4215SJerry Wong #define M98090_AVRG_WIDTH		3
594685e4215SJerry Wong #define M98090_AVRG_NUM			(1<<M98090_AVRG_WIDTH)
595685e4215SJerry Wong #define M98090_AVR_MASK			(15<<0)
596685e4215SJerry Wong #define M98090_AVR_SHIFT		0
597685e4215SJerry Wong #define M98090_AVR_WIDTH		4
598685e4215SJerry Wong #define M98090_AVR_NUM			(1<<M98090_AVR_WIDTH)
599685e4215SJerry Wong 
600685e4215SJerry Wong /*
601685e4215SJerry Wong  * M98090_REG_ADC_BIQUAD_LEVEL
602685e4215SJerry Wong  */
603685e4215SJerry Wong #define M98090_AVBQ_MASK		(15<<0)
604685e4215SJerry Wong #define M98090_AVBQ_SHIFT		0
605685e4215SJerry Wong #define M98090_AVBQ_WIDTH		4
606685e4215SJerry Wong #define M98090_AVBQ_NUM			(1<<M98090_AVBQ_WIDTH)
607685e4215SJerry Wong 
608685e4215SJerry Wong /*
609685e4215SJerry Wong  * M98090_REG_ADC_SIDETONE
610685e4215SJerry Wong  */
611685e4215SJerry Wong #define M98090_DSTSR_MASK		(1<<7)
612685e4215SJerry Wong #define M98090_DSTSR_SHIFT		7
613685e4215SJerry Wong #define M98090_DSTSR_WIDTH		1
614685e4215SJerry Wong #define M98090_DSTSL_MASK		(1<<6)
615685e4215SJerry Wong #define M98090_DSTSL_SHIFT		6
616685e4215SJerry Wong #define M98090_DSTSL_WIDTH		1
617685e4215SJerry Wong #define M98090_DVST_MASK		(31<<0)
618685e4215SJerry Wong #define M98090_DVST_SHIFT		0
619685e4215SJerry Wong #define M98090_DVST_WIDTH		5
620685e4215SJerry Wong #define M98090_DVST_NUM			31
621685e4215SJerry Wong 
622685e4215SJerry Wong /*
623685e4215SJerry Wong  * M98090_REG_SYSTEM_CLOCK
624685e4215SJerry Wong  */
625685e4215SJerry Wong #define M98090_PSCLK_MASK		(3<<4)
626685e4215SJerry Wong #define M98090_PSCLK_SHIFT		4
627685e4215SJerry Wong #define M98090_PSCLK_WIDTH		2
628685e4215SJerry Wong #define M98090_PSCLK_DISABLED		(0<<4)
629685e4215SJerry Wong #define M98090_PSCLK_DIV1		(1<<4)
630685e4215SJerry Wong #define M98090_PSCLK_DIV2		(2<<4)
631685e4215SJerry Wong #define M98090_PSCLK_DIV4		(3<<4)
632685e4215SJerry Wong 
633685e4215SJerry Wong /*
634685e4215SJerry Wong  * M98090_REG_CLOCK_MODE
635685e4215SJerry Wong  */
636685e4215SJerry Wong #define M98090_FREQ_MASK		(15<<4)
637685e4215SJerry Wong #define M98090_FREQ_SHIFT		4
638685e4215SJerry Wong #define M98090_FREQ_WIDTH		4
639685e4215SJerry Wong #define M98090_USE_M1_MASK		(1<<0)
640685e4215SJerry Wong #define M98090_USE_M1_SHIFT		0
641685e4215SJerry Wong #define M98090_USE_M1_WIDTH		1
642685e4215SJerry Wong #define M98090_USE_M1_NUM		(1<<M98090_USE_M1_WIDTH)
643685e4215SJerry Wong 
644685e4215SJerry Wong /*
645685e4215SJerry Wong  * M98090_REG_CLOCK_RATIO_NI_MSB
646685e4215SJerry Wong  */
647685e4215SJerry Wong #define M98090_NI_HI_MASK		(127<<0)
648685e4215SJerry Wong #define M98090_NI_HI_SHIFT		0
649685e4215SJerry Wong #define M98090_NI_HI_WIDTH		7
650685e4215SJerry Wong #define M98090_NI_HI_NUM		(1<<M98090_NI_HI_WIDTH)
651685e4215SJerry Wong 
652685e4215SJerry Wong /*
653685e4215SJerry Wong  * M98090_REG_CLOCK_RATIO_NI_LSB
654685e4215SJerry Wong  */
655685e4215SJerry Wong #define M98090_NI_LO_MASK		(255<<0)
656685e4215SJerry Wong #define M98090_NI_LO_SHIFT		0
657685e4215SJerry Wong #define M98090_NI_LO_WIDTH		8
658685e4215SJerry Wong #define M98090_NI_LO_NUM		(1<<M98090_NI_LO_WIDTH)
659685e4215SJerry Wong 
660685e4215SJerry Wong /*
661685e4215SJerry Wong  * M98090_REG_CLOCK_RATIO_MI_MSB
662685e4215SJerry Wong  */
663685e4215SJerry Wong #define M98090_MI_HI_MASK		(255<<0)
664685e4215SJerry Wong #define M98090_MI_HI_SHIFT		0
665685e4215SJerry Wong #define M98090_MI_HI_WIDTH		8
666685e4215SJerry Wong #define M98090_MI_HI_NUM		(1<<M98090_MI_HI_WIDTH)
667685e4215SJerry Wong 
668685e4215SJerry Wong /*
669685e4215SJerry Wong  * M98090_REG_CLOCK_RATIO_MI_LSB
670685e4215SJerry Wong  */
671685e4215SJerry Wong #define M98090_MI_LO_MASK		(255<<0)
672685e4215SJerry Wong #define M98090_MI_LO_SHIFT		0
673685e4215SJerry Wong #define M98090_MI_LO_WIDTH		8
674685e4215SJerry Wong #define M98090_MI_LO_NUM		(1<<M98090_MI_LO_WIDTH)
675685e4215SJerry Wong 
676685e4215SJerry Wong /*
677685e4215SJerry Wong  * M98090_REG_MASTER_MODE
678685e4215SJerry Wong  */
679685e4215SJerry Wong #define M98090_MAS_MASK			(1<<7)
680685e4215SJerry Wong #define M98090_MAS_SHIFT		7
681685e4215SJerry Wong #define M98090_MAS_WIDTH		1
682685e4215SJerry Wong #define M98090_BSEL_MASK		(1<<0)
683685e4215SJerry Wong #define M98090_BSEL_SHIFT		0
684685e4215SJerry Wong #define M98090_BSEL_WIDTH		1
685685e4215SJerry Wong #define M98090_BSEL_32			(1<<0)
686685e4215SJerry Wong #define M98090_BSEL_48			(2<<0)
687685e4215SJerry Wong #define M98090_BSEL_64			(3<<0)
688685e4215SJerry Wong 
689685e4215SJerry Wong /*
690685e4215SJerry Wong  * M98090_REG_INTERFACE_FORMAT
691685e4215SJerry Wong  */
692685e4215SJerry Wong #define M98090_RJ_MASK			(1<<5)
693685e4215SJerry Wong #define M98090_RJ_SHIFT			5
694685e4215SJerry Wong #define M98090_RJ_WIDTH			1
695685e4215SJerry Wong #define M98090_WCI_MASK			(1<<4)
696685e4215SJerry Wong #define M98090_WCI_SHIFT		4
697685e4215SJerry Wong #define M98090_WCI_WIDTH		1
698685e4215SJerry Wong #define M98090_BCI_MASK			(1<<3)
699685e4215SJerry Wong #define M98090_BCI_SHIFT		3
700685e4215SJerry Wong #define M98090_BCI_WIDTH		1
701685e4215SJerry Wong #define M98090_DLY_MASK			(1<<2)
702685e4215SJerry Wong #define M98090_DLY_SHIFT		2
703685e4215SJerry Wong #define M98090_DLY_WIDTH		1
704685e4215SJerry Wong #define M98090_WS_MASK			(3<<0)
705685e4215SJerry Wong #define M98090_WS_SHIFT			0
706685e4215SJerry Wong #define M98090_WS_WIDTH			2
707685e4215SJerry Wong #define M98090_WS_NUM			(1<<M98090_WS_WIDTH)
708685e4215SJerry Wong 
709685e4215SJerry Wong /*
710685e4215SJerry Wong  * M98090_REG_TDM_CONTROL
711685e4215SJerry Wong  */
712685e4215SJerry Wong #define M98090_FSW_MASK			(1<<1)
713685e4215SJerry Wong #define M98090_FSW_SHIFT		1
714685e4215SJerry Wong #define M98090_FSW_WIDTH		1
715685e4215SJerry Wong #define M98090_TDM_MASK			(1<<0)
716685e4215SJerry Wong #define M98090_TDM_SHIFT		0
717685e4215SJerry Wong #define M98090_TDM_WIDTH		1
718685e4215SJerry Wong #define M98090_TDM_NUM			(1<<M98090_TDM_WIDTH)
719685e4215SJerry Wong 
720685e4215SJerry Wong /*
721685e4215SJerry Wong  * M98090_REG_TDM_FORMAT
722685e4215SJerry Wong  */
723685e4215SJerry Wong #define M98090_TDM_SLOTL_MASK		(3<<6)
724685e4215SJerry Wong #define M98090_TDM_SLOTL_SHIFT		6
725685e4215SJerry Wong #define M98090_TDM_SLOTL_WIDTH		2
726685e4215SJerry Wong #define M98090_TDM_SLOTL_NUM		(1<<M98090_TDM_SLOTL_WIDTH)
727685e4215SJerry Wong #define M98090_TDM_SLOTR_MASK		(3<<4)
728685e4215SJerry Wong #define M98090_TDM_SLOTR_SHIFT		4
729685e4215SJerry Wong #define M98090_TDM_SLOTR_WIDTH		2
730685e4215SJerry Wong #define M98090_TDM_SLOTR_NUM		(1<<M98090_TDM_SLOTR_WIDTH)
731685e4215SJerry Wong #define M98090_TDM_SLOTDLY_MASK		(15<<0)
732685e4215SJerry Wong #define M98090_TDM_SLOTDLY_SHIFT	0
733685e4215SJerry Wong #define M98090_TDM_SLOTDLY_WIDTH	4
734685e4215SJerry Wong #define M98090_TDM_SLOTDLY_NUM		(1<<M98090_TDM_SLOTDLY_WIDTH)
735685e4215SJerry Wong 
736685e4215SJerry Wong /*
737685e4215SJerry Wong  * M98090_REG_IO_CONFIGURATION
738685e4215SJerry Wong  */
739685e4215SJerry Wong #define M98090_LTEN_MASK		(1<<5)
740685e4215SJerry Wong #define M98090_LTEN_SHIFT		5
741685e4215SJerry Wong #define M98090_LTEN_WIDTH		1
742685e4215SJerry Wong #define M98090_LTEN_NUM			(1<<M98090_LTEN_WIDTH)
743685e4215SJerry Wong #define M98090_LBEN_MASK		(1<<4)
744685e4215SJerry Wong #define M98090_LBEN_SHIFT		4
745685e4215SJerry Wong #define M98090_LBEN_WIDTH		1
746685e4215SJerry Wong #define M98090_LBEN_NUM			(1<<M98090_LBEN_WIDTH)
747685e4215SJerry Wong #define M98090_DMONO_MASK		(1<<3)
748685e4215SJerry Wong #define M98090_DMONO_SHIFT		3
749685e4215SJerry Wong #define M98090_DMONO_WIDTH		1
750685e4215SJerry Wong #define M98090_DMONO_NUM		(1<<M98090_DMONO_WIDTH)
751685e4215SJerry Wong #define M98090_HIZOFF_MASK		(1<<2)
752685e4215SJerry Wong #define M98090_HIZOFF_SHIFT		2
753685e4215SJerry Wong #define M98090_HIZOFF_WIDTH		1
754685e4215SJerry Wong #define M98090_HIZOFF_NUM		(1<<M98090_HIZOFF_WIDTH)
755685e4215SJerry Wong #define M98090_SDOEN_MASK		(1<<1)
756685e4215SJerry Wong #define M98090_SDOEN_SHIFT		1
757685e4215SJerry Wong #define M98090_SDOEN_WIDTH		1
758685e4215SJerry Wong #define M98090_SDOEN_NUM		(1<<M98090_SDOEN_WIDTH)
759685e4215SJerry Wong #define M98090_SDIEN_MASK		(1<<0)
760685e4215SJerry Wong #define M98090_SDIEN_SHIFT		0
761685e4215SJerry Wong #define M98090_SDIEN_WIDTH		1
762685e4215SJerry Wong #define M98090_SDIEN_NUM		(1<<M98090_SDIEN_WIDTH)
763685e4215SJerry Wong 
764685e4215SJerry Wong /*
765685e4215SJerry Wong  * M98090_REG_FILTER_CONFIG
766685e4215SJerry Wong  */
767685e4215SJerry Wong #define M98090_MODE_MASK		(1<<7)
768685e4215SJerry Wong #define M98090_MODE_SHIFT		7
769685e4215SJerry Wong #define M98090_MODE_WIDTH		1
770685e4215SJerry Wong #define M98090_AHPF_MASK		(1<<6)
771685e4215SJerry Wong #define M98090_AHPF_SHIFT		6
772685e4215SJerry Wong #define M98090_AHPF_WIDTH		1
773685e4215SJerry Wong #define M98090_AHPF_NUM			(1<<M98090_AHPF_WIDTH)
774685e4215SJerry Wong #define M98090_DHPF_MASK		(1<<5)
775685e4215SJerry Wong #define M98090_DHPF_SHIFT		5
776685e4215SJerry Wong #define M98090_DHPF_WIDTH		1
777685e4215SJerry Wong #define M98090_DHPF_NUM			(1<<M98090_DHPF_WIDTH)
778685e4215SJerry Wong #define M98090_DHF_MASK			(1<<4)
779685e4215SJerry Wong #define M98090_DHF_SHIFT		4
780685e4215SJerry Wong #define M98090_DHF_WIDTH		1
781685e4215SJerry Wong #define M98090_FLT_DMIC34MODE_MASK	(1<<3)
782685e4215SJerry Wong #define M98090_FLT_DMIC34MODE_SHIFT	3
783685e4215SJerry Wong #define M98090_FLT_DMIC34MODE_WIDTH	1
784685e4215SJerry Wong #define M98090_FLT_DMIC34HPF_MASK	(1<<2)
785685e4215SJerry Wong #define M98090_FLT_DMIC34HPF_SHIFT	2
786685e4215SJerry Wong #define M98090_FLT_DMIC34HPF_WIDTH	1
787685e4215SJerry Wong #define M98090_FLT_DMIC34HPF_NUM	(1<<M98090_FLT_DMIC34HPF_WIDTH)
788685e4215SJerry Wong 
789685e4215SJerry Wong /*
790685e4215SJerry Wong  * M98090_REG_DAI_PLAYBACK_LEVEL
791685e4215SJerry Wong  */
792685e4215SJerry Wong #define M98090_DVM_MASK			(1<<7)
793685e4215SJerry Wong #define M98090_DVM_SHIFT		7
794685e4215SJerry Wong #define M98090_DVM_WIDTH		1
795685e4215SJerry Wong #define M98090_DVG_MASK			(3<<4)
796685e4215SJerry Wong #define M98090_DVG_SHIFT		4
797685e4215SJerry Wong #define M98090_DVG_WIDTH		2
798685e4215SJerry Wong #define M98090_DVG_NUM			(1<<M98090_DVG_WIDTH)
799685e4215SJerry Wong #define M98090_DV_MASK			(15<<0)
800685e4215SJerry Wong #define M98090_DV_SHIFT			0
801685e4215SJerry Wong #define M98090_DV_WIDTH			4
802685e4215SJerry Wong #define M98090_DV_NUM			(1<<M98090_DV_WIDTH)
803685e4215SJerry Wong 
804685e4215SJerry Wong /*
805685e4215SJerry Wong  * M98090_REG_DAI_PLAYBACK_LEVEL_EQ
806685e4215SJerry Wong  */
807685e4215SJerry Wong #define M98090_EQCLPN_MASK		(1<<4)
808685e4215SJerry Wong #define M98090_EQCLPN_SHIFT		4
809685e4215SJerry Wong #define M98090_EQCLPN_WIDTH		1
810685e4215SJerry Wong #define M98090_EQCLPN_NUM		(1<<M98090_EQCLPN_WIDTH)
811685e4215SJerry Wong #define M98090_DVEQ_MASK		(15<<0)
812685e4215SJerry Wong #define M98090_DVEQ_SHIFT		0
813685e4215SJerry Wong #define M98090_DVEQ_WIDTH		4
814685e4215SJerry Wong #define M98090_DVEQ_NUM			(1<<M98090_DVEQ_WIDTH)
815685e4215SJerry Wong 
816685e4215SJerry Wong /*
817685e4215SJerry Wong  * M98090_REG_LEFT_HP_MIXER
818685e4215SJerry Wong  */
819685e4215SJerry Wong #define M98090_MIXHPL_MIC2_MASK		(1<<5)
820685e4215SJerry Wong #define M98090_MIXHPL_MIC2_SHIFT	5
821685e4215SJerry Wong #define M98090_MIXHPL_MIC2_WIDTH	1
822685e4215SJerry Wong #define M98090_MIXHPL_MIC1_MASK		(1<<4)
823685e4215SJerry Wong #define M98090_MIXHPL_MIC1_SHIFT	4
824685e4215SJerry Wong #define M98090_MIXHPL_MIC1_WIDTH	1
825685e4215SJerry Wong #define M98090_MIXHPL_LINEB_MASK	(1<<3)
826685e4215SJerry Wong #define M98090_MIXHPL_LINEB_SHIFT	3
827685e4215SJerry Wong #define M98090_MIXHPL_LINEB_WIDTH	1
828685e4215SJerry Wong #define M98090_MIXHPL_LINEA_MASK	(1<<2)
829685e4215SJerry Wong #define M98090_MIXHPL_LINEA_SHIFT	2
830685e4215SJerry Wong #define M98090_MIXHPL_LINEA_WIDTH	1
831685e4215SJerry Wong #define M98090_MIXHPL_DACR_MASK		(1<<1)
832685e4215SJerry Wong #define M98090_MIXHPL_DACR_SHIFT	1
833685e4215SJerry Wong #define M98090_MIXHPL_DACR_WIDTH	1
834685e4215SJerry Wong #define M98090_MIXHPL_DACL_MASK		(1<<0)
835685e4215SJerry Wong #define M98090_MIXHPL_DACL_SHIFT	0
836685e4215SJerry Wong #define M98090_MIXHPL_DACL_WIDTH	1
837685e4215SJerry Wong #define M98090_MIXHPL_MASK		(63<<0)
838685e4215SJerry Wong #define M98090_MIXHPL_SHIFT		0
839685e4215SJerry Wong #define M98090_MIXHPL_WIDTH		6
840685e4215SJerry Wong 
841685e4215SJerry Wong /*
842685e4215SJerry Wong  * M98090_REG_RIGHT_HP_MIXER
843685e4215SJerry Wong  */
844685e4215SJerry Wong #define M98090_MIXHPR_MIC2_MASK		(1<<5)
845685e4215SJerry Wong #define M98090_MIXHPR_MIC2_SHIFT	5
846685e4215SJerry Wong #define M98090_MIXHPR_MIC2_WIDTH	1
847685e4215SJerry Wong #define M98090_MIXHPR_MIC1_MASK		(1<<4)
848685e4215SJerry Wong #define M98090_MIXHPR_MIC1_SHIFT	4
849685e4215SJerry Wong #define M98090_MIXHPR_MIC1_WIDTH	1
850685e4215SJerry Wong #define M98090_MIXHPR_LINEB_MASK	(1<<3)
851685e4215SJerry Wong #define M98090_MIXHPR_LINEB_SHIFT	3
852685e4215SJerry Wong #define M98090_MIXHPR_LINEB_WIDTH	1
853685e4215SJerry Wong #define M98090_MIXHPR_LINEA_MASK	(1<<2)
854685e4215SJerry Wong #define M98090_MIXHPR_LINEA_SHIFT	2
855685e4215SJerry Wong #define M98090_MIXHPR_LINEA_WIDTH	1
856685e4215SJerry Wong #define M98090_MIXHPR_DACR_MASK		(1<<1)
857685e4215SJerry Wong #define M98090_MIXHPR_DACR_SHIFT	1
858685e4215SJerry Wong #define M98090_MIXHPR_DACR_WIDTH	1
859685e4215SJerry Wong #define M98090_MIXHPR_DACL_MASK		(1<<0)
860685e4215SJerry Wong #define M98090_MIXHPR_DACL_SHIFT	0
861685e4215SJerry Wong #define M98090_MIXHPR_DACL_WIDTH	1
862685e4215SJerry Wong #define M98090_MIXHPR_MASK		(63<<0)
863685e4215SJerry Wong #define M98090_MIXHPR_SHIFT		0
864685e4215SJerry Wong #define M98090_MIXHPR_WIDTH		6
865685e4215SJerry Wong 
866685e4215SJerry Wong /*
867685e4215SJerry Wong  * M98090_REG_HP_CONTROL
868685e4215SJerry Wong  */
869685e4215SJerry Wong #define M98090_MIXHPRSEL_MASK		(1<<5)
870685e4215SJerry Wong #define M98090_MIXHPRSEL_SHIFT		5
871685e4215SJerry Wong #define M98090_MIXHPRSEL_WIDTH		1
872685e4215SJerry Wong #define M98090_MIXHPLSEL_MASK		(1<<4)
873685e4215SJerry Wong #define M98090_MIXHPLSEL_SHIFT		4
874685e4215SJerry Wong #define M98090_MIXHPLSEL_WIDTH		1
875685e4215SJerry Wong #define M98090_MIXHPRG_MASK		(3<<2)
876685e4215SJerry Wong #define M98090_MIXHPRG_SHIFT		2
877685e4215SJerry Wong #define M98090_MIXHPRG_WIDTH		2
878685e4215SJerry Wong #define M98090_MIXHPRG_NUM		(1<<M98090_MIXHPRG_WIDTH)
879685e4215SJerry Wong #define M98090_MIXHPLG_MASK		(3<<0)
880685e4215SJerry Wong #define M98090_MIXHPLG_SHIFT		0
881685e4215SJerry Wong #define M98090_MIXHPLG_WIDTH		2
882685e4215SJerry Wong #define M98090_MIXHPLG_NUM		(1<<M98090_MIXHPLG_WIDTH)
883685e4215SJerry Wong 
884685e4215SJerry Wong /*
885685e4215SJerry Wong  * M98090_REG_LEFT_HP_VOLUME
886685e4215SJerry Wong  */
887685e4215SJerry Wong #define M98090_HPLM_MASK		(1<<7)
888685e4215SJerry Wong #define M98090_HPLM_SHIFT		7
889685e4215SJerry Wong #define M98090_HPLM_WIDTH		1
890685e4215SJerry Wong #define M98090_HPVOLL_MASK		(31<<0)
891685e4215SJerry Wong #define M98090_HPVOLL_SHIFT		0
892685e4215SJerry Wong #define M98090_HPVOLL_WIDTH		5
893685e4215SJerry Wong #define M98090_HPVOLL_NUM		(1<<M98090_HPVOLL_WIDTH)
894685e4215SJerry Wong 
895685e4215SJerry Wong /*
896685e4215SJerry Wong  * M98090_REG_RIGHT_HP_VOLUME
897685e4215SJerry Wong  */
898685e4215SJerry Wong #define M98090_HPRM_MASK		(1<<7)
899685e4215SJerry Wong #define M98090_HPRM_SHIFT		7
900685e4215SJerry Wong #define M98090_HPRM_WIDTH		1
901685e4215SJerry Wong #define M98090_HPVOLR_MASK		(31<<0)
902685e4215SJerry Wong #define M98090_HPVOLR_SHIFT		0
903685e4215SJerry Wong #define M98090_HPVOLR_WIDTH		5
904685e4215SJerry Wong #define M98090_HPVOLR_NUM		(1<<M98090_HPVOLR_WIDTH)
905685e4215SJerry Wong 
906685e4215SJerry Wong /*
907685e4215SJerry Wong  * M98090_REG_LEFT_SPK_MIXER
908685e4215SJerry Wong  */
909685e4215SJerry Wong #define M98090_MIXSPL_MIC2_MASK		(1<<5)
910685e4215SJerry Wong #define M98090_MIXSPL_MIC2_SHIFT	5
911685e4215SJerry Wong #define M98090_MIXSPL_MIC2_WIDTH	1
912685e4215SJerry Wong #define M98090_MIXSPL_MIC1_MASK		(1<<4)
913685e4215SJerry Wong #define M98090_MIXSPL_MIC1_SHIFT	4
914685e4215SJerry Wong #define M98090_MIXSPL_MIC1_WIDTH	1
915685e4215SJerry Wong #define M98090_MIXSPL_LINEB_MASK	(1<<3)
916685e4215SJerry Wong #define M98090_MIXSPL_LINEB_SHIFT	3
917685e4215SJerry Wong #define M98090_MIXSPL_LINEB_WIDTH	1
918685e4215SJerry Wong #define M98090_MIXSPL_LINEA_MASK	(1<<2)
919685e4215SJerry Wong #define M98090_MIXSPL_LINEA_SHIFT	2
920685e4215SJerry Wong #define M98090_MIXSPL_LINEA_WIDTH	1
921685e4215SJerry Wong #define M98090_MIXSPL_DACR_MASK		(1<<1)
922685e4215SJerry Wong #define M98090_MIXSPL_DACR_SHIFT	1
923685e4215SJerry Wong #define M98090_MIXSPL_DACR_WIDTH	1
924685e4215SJerry Wong #define M98090_MIXSPL_DACL_MASK		(1<<0)
925685e4215SJerry Wong #define M98090_MIXSPL_DACL_SHIFT	0
926685e4215SJerry Wong #define M98090_MIXSPL_DACL_WIDTH	1
927685e4215SJerry Wong #define M98090_MIXSPL_MASK		(63<<0)
928685e4215SJerry Wong #define M98090_MIXSPL_SHIFT		0
929685e4215SJerry Wong #define M98090_MIXSPL_WIDTH		6
930685e4215SJerry Wong #define M98090_MIXSPR_DACR_MASK		(1<<1)
931685e4215SJerry Wong #define M98090_MIXSPR_DACR_SHIFT	1
932685e4215SJerry Wong #define M98090_MIXSPR_DACR_WIDTH	1
933685e4215SJerry Wong 
934685e4215SJerry Wong 
935685e4215SJerry Wong /*
936685e4215SJerry Wong  * M98090_REG_RIGHT_SPK_MIXER
937685e4215SJerry Wong  */
938685e4215SJerry Wong #define M98090_SPK_SLAVE_MASK		(1<<6)
939685e4215SJerry Wong #define M98090_SPK_SLAVE_SHIFT		6
940685e4215SJerry Wong #define M98090_SPK_SLAVE_WIDTH		1
941685e4215SJerry Wong #define M98090_MIXSPR_MIC2_MASK		(1<<5)
942685e4215SJerry Wong #define M98090_MIXSPR_MIC2_SHIFT	5
943685e4215SJerry Wong #define M98090_MIXSPR_MIC2_WIDTH	1
944685e4215SJerry Wong #define M98090_MIXSPR_MIC1_MASK		(1<<4)
945685e4215SJerry Wong #define M98090_MIXSPR_MIC1_SHIFT	4
946685e4215SJerry Wong #define M98090_MIXSPR_MIC1_WIDTH	1
947685e4215SJerry Wong #define M98090_MIXSPR_LINEB_MASK	(1<<3)
948685e4215SJerry Wong #define M98090_MIXSPR_LINEB_SHIFT	3
949685e4215SJerry Wong #define M98090_MIXSPR_LINEB_WIDTH	1
950685e4215SJerry Wong #define M98090_MIXSPR_LINEA_MASK	(1<<2)
951685e4215SJerry Wong #define M98090_MIXSPR_LINEA_SHIFT	2
952685e4215SJerry Wong #define M98090_MIXSPR_LINEA_WIDTH	1
953685e4215SJerry Wong #define M98090_MIXSPR_DACR_MASK		(1<<1)
954685e4215SJerry Wong #define M98090_MIXSPR_DACR_SHIFT	1
955685e4215SJerry Wong #define M98090_MIXSPR_DACR_WIDTH	1
956685e4215SJerry Wong #define M98090_MIXSPR_DACL_MASK		(1<<0)
957685e4215SJerry Wong #define M98090_MIXSPR_DACL_SHIFT	0
958685e4215SJerry Wong #define M98090_MIXSPR_DACL_WIDTH	1
959685e4215SJerry Wong #define M98090_MIXSPR_MASK		(63<<0)
960685e4215SJerry Wong #define M98090_MIXSPR_SHIFT		0
961685e4215SJerry Wong #define M98090_MIXSPR_WIDTH		6
962685e4215SJerry Wong 
963685e4215SJerry Wong /*
964685e4215SJerry Wong  * M98090_REG_SPK_CONTROL
965685e4215SJerry Wong  */
966685e4215SJerry Wong #define M98090_MIXSPRG_MASK		(3<<2)
967685e4215SJerry Wong #define M98090_MIXSPRG_SHIFT		2
968685e4215SJerry Wong #define M98090_MIXSPRG_WIDTH		2
969685e4215SJerry Wong #define M98090_MIXSPRG_NUM		(1<<M98090_MIXSPRG_WIDTH)
970685e4215SJerry Wong #define M98090_MIXSPLG_MASK		(3<<0)
971685e4215SJerry Wong #define M98090_MIXSPLG_SHIFT		0
972685e4215SJerry Wong #define M98090_MIXSPLG_WIDTH		2
973685e4215SJerry Wong #define M98090_MIXSPLG_NUM		(1<<M98090_MIXSPLG_WIDTH)
974685e4215SJerry Wong 
975685e4215SJerry Wong /*
976685e4215SJerry Wong  * M98090_REG_LEFT_SPK_VOLUME
977685e4215SJerry Wong  */
978685e4215SJerry Wong #define M98090_SPLM_MASK		(1<<7)
979685e4215SJerry Wong #define M98090_SPLM_SHIFT		7
980685e4215SJerry Wong #define M98090_SPLM_WIDTH		1
981685e4215SJerry Wong #define M98090_SPVOLL_MASK		(63<<0)
982685e4215SJerry Wong #define M98090_SPVOLL_SHIFT		0
983685e4215SJerry Wong #define M98090_SPVOLL_WIDTH		6
984685e4215SJerry Wong #define M98090_SPVOLL_NUM		40
985685e4215SJerry Wong 
986685e4215SJerry Wong /*
987685e4215SJerry Wong  * M98090_REG_RIGHT_SPK_VOLUME
988685e4215SJerry Wong  */
989685e4215SJerry Wong #define M98090_SPRM_MASK		(1<<7)
990685e4215SJerry Wong #define M98090_SPRM_SHIFT		7
991685e4215SJerry Wong #define M98090_SPRM_WIDTH		1
992685e4215SJerry Wong #define M98090_SPVOLR_MASK		(63<<0)
993685e4215SJerry Wong #define M98090_SPVOLR_SHIFT		0
994685e4215SJerry Wong #define M98090_SPVOLR_WIDTH		6
995685e4215SJerry Wong #define M98090_SPVOLR_NUM		40
996685e4215SJerry Wong 
997685e4215SJerry Wong /*
998685e4215SJerry Wong  * M98090_REG_DRC_TIMING
999685e4215SJerry Wong  */
1000685e4215SJerry Wong #define M98090_DRCEN_MASK		(1<<7)
1001685e4215SJerry Wong #define M98090_DRCEN_SHIFT		7
1002685e4215SJerry Wong #define M98090_DRCEN_WIDTH		1
1003685e4215SJerry Wong #define M98090_DRCEN_NUM		(1<<M98090_DRCEN_WIDTH)
1004685e4215SJerry Wong #define M98090_DRCRLS_MASK		(7<<4)
1005685e4215SJerry Wong #define M98090_DRCRLS_SHIFT		4
1006685e4215SJerry Wong #define M98090_DRCRLS_WIDTH		3
1007685e4215SJerry Wong #define M98090_DRCATK_MASK		(7<<0)
1008685e4215SJerry Wong #define M98090_DRCATK_SHIFT		0
1009685e4215SJerry Wong #define M98090_DRCATK_WIDTH		3
1010685e4215SJerry Wong 
1011685e4215SJerry Wong /*
1012685e4215SJerry Wong  * M98090_REG_DRC_COMPRESSOR
1013685e4215SJerry Wong  */
1014685e4215SJerry Wong #define M98090_DRCCMP_MASK		(7<<5)
1015685e4215SJerry Wong #define M98090_DRCCMP_SHIFT		5
1016685e4215SJerry Wong #define M98090_DRCCMP_WIDTH		3
1017685e4215SJerry Wong #define M98090_DRCTHC_MASK		(31<<0)
1018685e4215SJerry Wong #define M98090_DRCTHC_SHIFT		0
1019685e4215SJerry Wong #define M98090_DRCTHC_WIDTH		5
1020685e4215SJerry Wong #define M98090_DRCTHC_NUM		(1<<M98090_DRCTHC_WIDTH)
1021685e4215SJerry Wong 
1022685e4215SJerry Wong /*
1023685e4215SJerry Wong  * M98090_REG_DRC_EXPANDER
1024685e4215SJerry Wong  */
1025685e4215SJerry Wong #define M98090_DRCEXP_MASK		(7<<5)
1026685e4215SJerry Wong #define M98090_DRCEXP_SHIFT		5
1027685e4215SJerry Wong #define M98090_DRCEXP_WIDTH		3
1028685e4215SJerry Wong #define M98090_DRCTHE_MASK		(31<<0)
1029685e4215SJerry Wong #define M98090_DRCTHE_SHIFT		0
1030685e4215SJerry Wong #define M98090_DRCTHE_WIDTH		5
1031685e4215SJerry Wong #define M98090_DRCTHE_NUM		(1<<M98090_DRCTHE_WIDTH)
1032685e4215SJerry Wong 
1033685e4215SJerry Wong /*
1034685e4215SJerry Wong  * M98090_REG_DRC_GAIN
1035685e4215SJerry Wong  */
1036685e4215SJerry Wong #define M98090_DRCG_MASK		(31<<0)
1037685e4215SJerry Wong #define M98090_DRCG_SHIFT		0
1038685e4215SJerry Wong #define M98090_DRCG_WIDTH		5
1039685e4215SJerry Wong #define M98090_DRCG_NUM			13
1040685e4215SJerry Wong 
1041685e4215SJerry Wong /*
1042685e4215SJerry Wong  * M98090_REG_RCV_LOUTL_MIXER
1043685e4215SJerry Wong  */
1044685e4215SJerry Wong #define M98090_MIXRCVL_MIC2_MASK	(1<<5)
1045685e4215SJerry Wong #define M98090_MIXRCVL_MIC2_SHIFT	5
1046685e4215SJerry Wong #define M98090_MIXRCVL_MIC2_WIDTH	1
1047685e4215SJerry Wong #define M98090_MIXRCVL_MIC1_MASK	(1<<4)
1048685e4215SJerry Wong #define M98090_MIXRCVL_MIC1_SHIFT	4
1049685e4215SJerry Wong #define M98090_MIXRCVL_MIC1_WIDTH	1
1050685e4215SJerry Wong #define M98090_MIXRCVL_LINEB_MASK	(1<<3)
1051685e4215SJerry Wong #define M98090_MIXRCVL_LINEB_SHIFT	3
1052685e4215SJerry Wong #define M98090_MIXRCVL_LINEB_WIDTH	1
1053685e4215SJerry Wong #define M98090_MIXRCVL_LINEA_MASK	(1<<2)
1054685e4215SJerry Wong #define M98090_MIXRCVL_LINEA_SHIFT	2
1055685e4215SJerry Wong #define M98090_MIXRCVL_LINEA_WIDTH	1
1056685e4215SJerry Wong #define M98090_MIXRCVL_DACR_MASK	(1<<1)
1057685e4215SJerry Wong #define M98090_MIXRCVL_DACR_SHIFT	1
1058685e4215SJerry Wong #define M98090_MIXRCVL_DACR_WIDTH	1
1059685e4215SJerry Wong #define M98090_MIXRCVL_DACL_MASK	(1<<0)
1060685e4215SJerry Wong #define M98090_MIXRCVL_DACL_SHIFT	0
1061685e4215SJerry Wong #define M98090_MIXRCVL_DACL_WIDTH	1
1062685e4215SJerry Wong #define M98090_MIXRCVL_MASK		(63<<0)
1063685e4215SJerry Wong #define M98090_MIXRCVL_SHIFT		0
1064685e4215SJerry Wong #define M98090_MIXRCVL_WIDTH		6
1065685e4215SJerry Wong 
1066685e4215SJerry Wong /*
1067685e4215SJerry Wong  * M98090_REG_RCV_LOUTL_CONTROL
1068685e4215SJerry Wong  */
1069685e4215SJerry Wong #define M98090_MIXRCVLG_MASK		(3<<0)
1070685e4215SJerry Wong #define M98090_MIXRCVLG_SHIFT		0
1071685e4215SJerry Wong #define M98090_MIXRCVLG_WIDTH		2
1072685e4215SJerry Wong #define M98090_MIXRCVLG_NUM		(1<<M98090_MIXRCVLG_WIDTH)
1073685e4215SJerry Wong 
1074685e4215SJerry Wong /*
1075685e4215SJerry Wong  * M98090_REG_RCV_LOUTL_VOLUME
1076685e4215SJerry Wong  */
1077685e4215SJerry Wong #define M98090_RCVLM_MASK		(1<<7)
1078685e4215SJerry Wong #define M98090_RCVLM_SHIFT		7
1079685e4215SJerry Wong #define M98090_RCVLM_WIDTH		1
1080685e4215SJerry Wong #define M98090_RCVLVOL_MASK		(31<<0)
1081685e4215SJerry Wong #define M98090_RCVLVOL_SHIFT		0
1082685e4215SJerry Wong #define M98090_RCVLVOL_WIDTH		5
1083685e4215SJerry Wong #define M98090_RCVLVOL_NUM		(1<<M98090_RCVLVOL_WIDTH)
1084685e4215SJerry Wong 
1085685e4215SJerry Wong /*
1086685e4215SJerry Wong  * M98090_REG_LOUTR_MIXER
1087685e4215SJerry Wong  */
1088685e4215SJerry Wong #define M98090_LINMOD_MASK		(1<<7)
1089685e4215SJerry Wong #define M98090_LINMOD_SHIFT		7
1090685e4215SJerry Wong #define M98090_LINMOD_WIDTH		1
1091685e4215SJerry Wong #define M98090_MIXRCVR_MIC2_MASK	(1<<5)
1092685e4215SJerry Wong #define M98090_MIXRCVR_MIC2_SHIFT	5
1093685e4215SJerry Wong #define M98090_MIXRCVR_MIC2_WIDTH	1
1094685e4215SJerry Wong #define M98090_MIXRCVR_MIC1_MASK	(1<<4)
1095685e4215SJerry Wong #define M98090_MIXRCVR_MIC1_SHIFT	4
1096685e4215SJerry Wong #define M98090_MIXRCVR_MIC1_WIDTH	1
1097685e4215SJerry Wong #define M98090_MIXRCVR_LINEB_MASK	(1<<3)
1098685e4215SJerry Wong #define M98090_MIXRCVR_LINEB_SHIFT	3
1099685e4215SJerry Wong #define M98090_MIXRCVR_LINEB_WIDTH	1
1100685e4215SJerry Wong #define M98090_MIXRCVR_LINEA_MASK	(1<<2)
1101685e4215SJerry Wong #define M98090_MIXRCVR_LINEA_SHIFT	2
1102685e4215SJerry Wong #define M98090_MIXRCVR_LINEA_WIDTH	1
1103685e4215SJerry Wong #define M98090_MIXRCVR_DACR_MASK	(1<<1)
1104685e4215SJerry Wong #define M98090_MIXRCVR_DACR_SHIFT	1
1105685e4215SJerry Wong #define M98090_MIXRCVR_DACR_WIDTH	1
1106685e4215SJerry Wong #define M98090_MIXRCVR_DACL_MASK	(1<<0)
1107685e4215SJerry Wong #define M98090_MIXRCVR_DACL_SHIFT	0
1108685e4215SJerry Wong #define M98090_MIXRCVR_DACL_WIDTH	1
1109685e4215SJerry Wong #define M98090_MIXRCVR_MASK		(63<<0)
1110685e4215SJerry Wong #define M98090_MIXRCVR_SHIFT		0
1111685e4215SJerry Wong #define M98090_MIXRCVR_WIDTH		6
1112685e4215SJerry Wong 
1113685e4215SJerry Wong /*
1114685e4215SJerry Wong  * M98090_REG_LOUTR_CONTROL
1115685e4215SJerry Wong  */
1116685e4215SJerry Wong #define M98090_MIXRCVRG_MASK		(3<<0)
1117685e4215SJerry Wong #define M98090_MIXRCVRG_SHIFT		0
1118685e4215SJerry Wong #define M98090_MIXRCVRG_WIDTH		2
1119685e4215SJerry Wong #define M98090_MIXRCVRG_NUM		(1<<M98090_MIXRCVRG_WIDTH)
1120685e4215SJerry Wong 
1121685e4215SJerry Wong /*
1122685e4215SJerry Wong  * M98090_REG_LOUTR_VOLUME
1123685e4215SJerry Wong  */
1124685e4215SJerry Wong #define M98090_RCVRM_MASK		(1<<7)
1125685e4215SJerry Wong #define M98090_RCVRM_SHIFT		7
1126685e4215SJerry Wong #define M98090_RCVRM_WIDTH		1
1127685e4215SJerry Wong #define M98090_RCVRVOL_MASK		(31<<0)
1128685e4215SJerry Wong #define M98090_RCVRVOL_SHIFT		0
1129685e4215SJerry Wong #define M98090_RCVRVOL_WIDTH		5
1130685e4215SJerry Wong #define M98090_RCVRVOL_NUM		(1<<M98090_RCVRVOL_WIDTH)
1131685e4215SJerry Wong 
1132685e4215SJerry Wong /*
1133685e4215SJerry Wong  * M98090_REG_JACK_DETECT
1134685e4215SJerry Wong  */
1135685e4215SJerry Wong #define M98090_JDETEN_MASK		(1<<7)
1136685e4215SJerry Wong #define M98090_JDETEN_SHIFT		7
1137685e4215SJerry Wong #define M98090_JDETEN_WIDTH		1
1138685e4215SJerry Wong #define M98090_JDWK_MASK		(1<<6)
1139685e4215SJerry Wong #define M98090_JDWK_SHIFT		6
1140685e4215SJerry Wong #define M98090_JDWK_WIDTH		1
1141685e4215SJerry Wong #define M98090_JDEB_MASK		(3<<0)
1142685e4215SJerry Wong #define M98090_JDEB_SHIFT		0
1143685e4215SJerry Wong #define M98090_JDEB_WIDTH		2
1144685e4215SJerry Wong #define M98090_JDEB_25MS		(0<<0)
1145685e4215SJerry Wong #define M98090_JDEB_50MS		(1<<0)
1146685e4215SJerry Wong #define M98090_JDEB_100MS		(2<<0)
1147685e4215SJerry Wong #define M98090_JDEB_200MS		(3<<0)
1148685e4215SJerry Wong 
1149685e4215SJerry Wong /*
1150685e4215SJerry Wong  * M98090_REG_INPUT_ENABLE
1151685e4215SJerry Wong  */
1152685e4215SJerry Wong #define M98090_MBEN_MASK		(1<<4)
1153685e4215SJerry Wong #define M98090_MBEN_SHIFT		4
1154685e4215SJerry Wong #define M98090_MBEN_WIDTH		1
1155685e4215SJerry Wong #define M98090_LINEAEN_MASK		(1<<3)
1156685e4215SJerry Wong #define M98090_LINEAEN_SHIFT		3
1157685e4215SJerry Wong #define M98090_LINEAEN_WIDTH		1
1158685e4215SJerry Wong #define M98090_LINEBEN_MASK		(1<<2)
1159685e4215SJerry Wong #define M98090_LINEBEN_SHIFT		2
1160685e4215SJerry Wong #define M98090_LINEBEN_WIDTH		1
1161685e4215SJerry Wong #define M98090_ADREN_MASK		(1<<1)
1162685e4215SJerry Wong #define M98090_ADREN_SHIFT		1
1163685e4215SJerry Wong #define M98090_ADREN_WIDTH		1
1164685e4215SJerry Wong #define M98090_ADLEN_MASK		(1<<0)
1165685e4215SJerry Wong #define M98090_ADLEN_SHIFT		0
1166685e4215SJerry Wong #define M98090_ADLEN_WIDTH		1
1167685e4215SJerry Wong 
1168685e4215SJerry Wong /*
1169685e4215SJerry Wong  * M98090_REG_OUTPUT_ENABLE
1170685e4215SJerry Wong  */
1171685e4215SJerry Wong #define M98090_HPREN_MASK		(1<<7)
1172685e4215SJerry Wong #define M98090_HPREN_SHIFT		7
1173685e4215SJerry Wong #define M98090_HPREN_WIDTH		1
1174685e4215SJerry Wong #define M98090_HPLEN_MASK		(1<<6)
1175685e4215SJerry Wong #define M98090_HPLEN_SHIFT		6
1176685e4215SJerry Wong #define M98090_HPLEN_WIDTH		1
1177685e4215SJerry Wong #define M98090_SPREN_MASK		(1<<5)
1178685e4215SJerry Wong #define M98090_SPREN_SHIFT		5
1179685e4215SJerry Wong #define M98090_SPREN_WIDTH		1
1180685e4215SJerry Wong #define M98090_SPLEN_MASK		(1<<4)
1181685e4215SJerry Wong #define M98090_SPLEN_SHIFT		4
1182685e4215SJerry Wong #define M98090_SPLEN_WIDTH		1
1183685e4215SJerry Wong #define M98090_RCVLEN_MASK		(1<<3)
1184685e4215SJerry Wong #define M98090_RCVLEN_SHIFT		3
1185685e4215SJerry Wong #define M98090_RCVLEN_WIDTH		1
1186685e4215SJerry Wong #define M98090_RCVREN_MASK		(1<<2)
1187685e4215SJerry Wong #define M98090_RCVREN_SHIFT		2
1188685e4215SJerry Wong #define M98090_RCVREN_WIDTH		1
1189685e4215SJerry Wong #define M98090_DAREN_MASK		(1<<1)
1190685e4215SJerry Wong #define M98090_DAREN_SHIFT		1
1191685e4215SJerry Wong #define M98090_DAREN_WIDTH		1
1192685e4215SJerry Wong #define M98090_DALEN_MASK		(1<<0)
1193685e4215SJerry Wong #define M98090_DALEN_SHIFT		0
1194685e4215SJerry Wong #define M98090_DALEN_WIDTH		1
1195685e4215SJerry Wong 
1196685e4215SJerry Wong /*
1197685e4215SJerry Wong  * M98090_REG_LEVEL_CONTROL
1198685e4215SJerry Wong  */
1199685e4215SJerry Wong #define M98090_ZDENN_MASK		(1<<2)
1200685e4215SJerry Wong #define M98090_ZDENN_SHIFT		2
1201685e4215SJerry Wong #define M98090_ZDENN_WIDTH		1
1202685e4215SJerry Wong #define M98090_ZDENN_NUM		(1<<M98090_ZDENN_WIDTH)
1203685e4215SJerry Wong #define M98090_VS2ENN_MASK		(1<<1)
1204685e4215SJerry Wong #define M98090_VS2ENN_SHIFT		1
1205685e4215SJerry Wong #define M98090_VS2ENN_WIDTH		1
1206685e4215SJerry Wong #define M98090_VS2ENN_NUM		(1<<M98090_VS2ENN_WIDTH)
1207685e4215SJerry Wong #define M98090_VSENN_MASK		(1<<0)
1208685e4215SJerry Wong #define M98090_VSENN_SHIFT		0
1209685e4215SJerry Wong #define M98090_VSENN_WIDTH		1
1210685e4215SJerry Wong #define M98090_VSENN_NUM		(1<<M98090_VSENN_WIDTH)
1211685e4215SJerry Wong 
1212685e4215SJerry Wong /*
1213685e4215SJerry Wong  * M98090_REG_DSP_FILTER_ENABLE
1214685e4215SJerry Wong  */
1215685e4215SJerry Wong #define M98090_DMIC34BQEN_MASK		(1<<4)
1216685e4215SJerry Wong #define M98090_DMIC34BQEN_SHIFT		4
1217685e4215SJerry Wong #define M98090_DMIC34BQEN_WIDTH		1
1218685e4215SJerry Wong #define M98090_DMIC34BQEN_NUM		(1<<M98090_DMIC34BQEN_WIDTH)
1219685e4215SJerry Wong #define M98090_ADCBQEN_MASK		(1<<3)
1220685e4215SJerry Wong #define M98090_ADCBQEN_SHIFT		3
1221685e4215SJerry Wong #define M98090_ADCBQEN_WIDTH		1
1222685e4215SJerry Wong #define M98090_ADCBQEN_NUM		(1<<M98090_ADCBQEN_WIDTH)
1223685e4215SJerry Wong #define M98090_EQ3BANDEN_MASK		(1<<2)
1224685e4215SJerry Wong #define M98090_EQ3BANDEN_SHIFT		2
1225685e4215SJerry Wong #define M98090_EQ3BANDEN_WIDTH		1
1226685e4215SJerry Wong #define M98090_EQ3BANDEN_NUM		(1<<M98090_EQ3BANDEN_WIDTH)
1227685e4215SJerry Wong #define M98090_EQ5BANDEN_MASK		(1<<1)
1228685e4215SJerry Wong #define M98090_EQ5BANDEN_SHIFT		1
1229685e4215SJerry Wong #define M98090_EQ5BANDEN_WIDTH		1
1230685e4215SJerry Wong #define M98090_EQ5BANDEN_NUM		(1<<M98090_EQ5BANDEN_WIDTH)
1231685e4215SJerry Wong #define M98090_EQ7BANDEN_MASK		(1<<0)
1232685e4215SJerry Wong #define M98090_EQ7BANDEN_SHIFT		0
1233685e4215SJerry Wong #define M98090_EQ7BANDEN_WIDTH		1
1234685e4215SJerry Wong #define M98090_EQ7BANDEN_NUM		(1<<M98090_EQ7BANDEN_WIDTH)
1235685e4215SJerry Wong 
1236685e4215SJerry Wong /*
1237685e4215SJerry Wong  * M98090_REG_BIAS_CONTROL
1238685e4215SJerry Wong  */
1239685e4215SJerry Wong #define M98090_VCM_MODE_MASK		(1<<0)
1240685e4215SJerry Wong #define M98090_VCM_MODE_SHIFT		0
1241685e4215SJerry Wong #define M98090_VCM_MODE_WIDTH		1
1242685e4215SJerry Wong #define M98090_VCM_MODE_NUM		(1<<M98090_VCM_MODE_WIDTH)
1243685e4215SJerry Wong 
1244685e4215SJerry Wong /*
1245685e4215SJerry Wong  * M98090_REG_DAC_CONTROL
1246685e4215SJerry Wong  */
1247685e4215SJerry Wong #define M98090_PERFMODE_MASK		(1<<1)
1248685e4215SJerry Wong #define M98090_PERFMODE_SHIFT		1
1249685e4215SJerry Wong #define M98090_PERFMODE_WIDTH		1
1250685e4215SJerry Wong #define M98090_PERFMODE_NUM		(1<<M98090_PERFMODE_WIDTH)
1251685e4215SJerry Wong #define M98090_DACHP_MASK		(1<<0)
1252685e4215SJerry Wong #define M98090_DACHP_SHIFT		0
1253685e4215SJerry Wong #define M98090_DACHP_WIDTH		1
1254685e4215SJerry Wong #define M98090_DACHP_NUM		(1<<M98090_DACHP_WIDTH)
1255685e4215SJerry Wong 
1256685e4215SJerry Wong /*
1257685e4215SJerry Wong  * M98090_REG_ADC_CONTROL
1258685e4215SJerry Wong  */
1259685e4215SJerry Wong #define M98090_OSR128_MASK		(1<<2)
1260685e4215SJerry Wong #define M98090_OSR128_SHIFT		2
1261685e4215SJerry Wong #define M98090_OSR128_WIDTH		1
1262685e4215SJerry Wong #define M98090_ADCDITHER_MASK		(1<<1)
1263685e4215SJerry Wong #define M98090_ADCDITHER_SHIFT		1
1264685e4215SJerry Wong #define M98090_ADCDITHER_WIDTH		1
1265685e4215SJerry Wong #define M98090_ADCDITHER_NUM		(1<<M98090_ADCDITHER_WIDTH)
1266685e4215SJerry Wong #define M98090_ADCHP_MASK		(1<<0)
1267685e4215SJerry Wong #define M98090_ADCHP_SHIFT		0
1268685e4215SJerry Wong #define M98090_ADCHP_WIDTH		1
1269685e4215SJerry Wong #define M98090_ADCHP_NUM		(1<<M98090_ADCHP_WIDTH)
1270685e4215SJerry Wong 
1271685e4215SJerry Wong /*
1272685e4215SJerry Wong  * M98090_REG_DEVICE_SHUTDOWN
1273685e4215SJerry Wong  */
1274685e4215SJerry Wong #define M98090_SHDNN_MASK		(1<<7)
1275685e4215SJerry Wong #define M98090_SHDNN_SHIFT		7
1276685e4215SJerry Wong #define M98090_SHDNN_WIDTH		1
1277685e4215SJerry Wong 
1278685e4215SJerry Wong /*
1279685e4215SJerry Wong  * M98090_REG_EQUALIZER_BASE
1280685e4215SJerry Wong  */
1281685e4215SJerry Wong #define M98090_B0_1_HI_MASK		(255<<0)
1282685e4215SJerry Wong #define M98090_B0_1_HI_SHIFT		0
1283685e4215SJerry Wong #define M98090_B0_1_HI_WIDTH		8
1284685e4215SJerry Wong #define M98090_B0_1_MID_MASK		(255<<0)
1285685e4215SJerry Wong #define M98090_B0_1_MID_SHIFT		0
1286685e4215SJerry Wong #define M98090_B0_1_MID_WIDTH		8
1287685e4215SJerry Wong #define M98090_B0_1_LO_MASK		(255<<0)
1288685e4215SJerry Wong #define M98090_B0_1_LO_SHIFT		0
1289685e4215SJerry Wong #define M98090_B0_1_LO_WIDTH		8
1290685e4215SJerry Wong #define M98090_B1_1_HI_MASK		(255<<0)
1291685e4215SJerry Wong #define M98090_B1_1_HI_SHIFT		0
1292685e4215SJerry Wong #define M98090_B1_1_HI_WIDTH		8
1293685e4215SJerry Wong #define M98090_B1_1_MID_MASK		(255<<0)
1294685e4215SJerry Wong #define M98090_B1_1_MID_SHIFT		0
1295685e4215SJerry Wong #define M98090_B1_1_MID_WIDTH		8
1296685e4215SJerry Wong #define M98090_B1_1_LO_MASK		(255<<0)
1297685e4215SJerry Wong #define M98090_B1_1_LO_SHIFT		0
1298685e4215SJerry Wong #define M98090_B1_1_LO_WIDTH		8
1299685e4215SJerry Wong #define M98090_B2_1_HI_MASK		(255<<0)
1300685e4215SJerry Wong #define M98090_B2_1_HI_SHIFT		0
1301685e4215SJerry Wong #define M98090_B2_1_HI_WIDTH		8
1302685e4215SJerry Wong #define M98090_B2_1_MID_MASK		(255<<0)
1303685e4215SJerry Wong #define M98090_B2_1_MID_SHIFT		0
1304685e4215SJerry Wong #define M98090_B2_1_MID_WIDTH		8
1305685e4215SJerry Wong #define M98090_B2_1_LO_MASK		(255<<0)
1306685e4215SJerry Wong #define M98090_B2_1_LO_SHIFT		0
1307685e4215SJerry Wong #define M98090_B2_1_LO_WIDTH		8
1308685e4215SJerry Wong #define M98090_A1_1_HI_MASK		(255<<0)
1309685e4215SJerry Wong #define M98090_A1_1_HI_SHIFT		0
1310685e4215SJerry Wong #define M98090_A1_1_HI_WIDTH		8
1311685e4215SJerry Wong #define M98090_A1_1_MID_MASK		(255<<0)
1312685e4215SJerry Wong #define M98090_A1_1_MID_SHIFT		0
1313685e4215SJerry Wong #define M98090_A1_1_MID_WIDTH		8
1314685e4215SJerry Wong #define M98090_A1_1_LO_MASK		(255<<0)
1315685e4215SJerry Wong #define M98090_A1_1_LO_SHIFT		0
1316685e4215SJerry Wong #define M98090_A1_1_LO_WIDTH		8
1317685e4215SJerry Wong #define M98090_A2_1_HI_MASK		(255<<0)
1318685e4215SJerry Wong #define M98090_A2_1_HI_SHIFT		0
1319685e4215SJerry Wong #define M98090_A2_1_HI_WIDTH		8
1320685e4215SJerry Wong #define M98090_A2_1_MID_MASK		(255<<0)
1321685e4215SJerry Wong #define M98090_A2_1_MID_SHIFT		0
1322685e4215SJerry Wong #define M98090_A2_1_MID_WIDTH		8
1323685e4215SJerry Wong #define M98090_A2_1_LO_MASK		(255<<0)
1324685e4215SJerry Wong #define M98090_A2_1_LO_SHIFT		0
1325685e4215SJerry Wong #define M98090_A2_1_LO_WIDTH		8
1326685e4215SJerry Wong 
1327685e4215SJerry Wong #define M98090_COEFS_PER_BAND		5
1328685e4215SJerry Wong #define M98090_COEFS_BLK_SZ		(M98090_COEFS_PER_BAND * 3)
1329685e4215SJerry Wong #define M98090_COEFS_MAX_SZ		(M98090_COEFS_BLK_SZ * 7)
1330685e4215SJerry Wong 
1331685e4215SJerry Wong /*
1332685e4215SJerry Wong  * M98090_REG_RECORD_BIQUAD_BASE
1333685e4215SJerry Wong  */
1334685e4215SJerry Wong #define M98090_REC_B0_HI_MASK		(255<<0)
1335685e4215SJerry Wong #define M98090_REC_B0_HI_SHIFT		0
1336685e4215SJerry Wong #define M98090_REC_B0_HI_WIDTH		8
1337685e4215SJerry Wong #define M98090_REC_B0_MID_MASK		(255<<0)
1338685e4215SJerry Wong #define M98090_REC_B0_MID_SHIFT		0
1339685e4215SJerry Wong #define M98090_REC_B0_MID_WIDTH		8
1340685e4215SJerry Wong #define M98090_REC_B0_LO_MASK		(255<<0)
1341685e4215SJerry Wong #define M98090_REC_B0_LO_SHIFT		0
1342685e4215SJerry Wong #define M98090_REC_B0_LO_WIDTH		8
1343685e4215SJerry Wong #define M98090_REC_B1_HI_MASK		(255<<0)
1344685e4215SJerry Wong #define M98090_REC_B1_HI_SHIFT		0
1345685e4215SJerry Wong #define M98090_REC_B1_HI_WIDTH		8
1346685e4215SJerry Wong #define M98090_REC_B1_MID_MASK		(255<<0)
1347685e4215SJerry Wong #define M98090_REC_B1_MID_SHIFT		0
1348685e4215SJerry Wong #define M98090_REC_B1_MID_WIDTH		8
1349685e4215SJerry Wong #define M98090_REC_B1_LO_MASK		(255<<0)
1350685e4215SJerry Wong #define M98090_REC_B1_LO_SHIFT		0
1351685e4215SJerry Wong #define M98090_REC_B1_LO_WIDTH		8
1352685e4215SJerry Wong #define M98090_REC_B2_HI_MASK		(255<<0)
1353685e4215SJerry Wong #define M98090_REC_B2_HI_SHIFT		0
1354685e4215SJerry Wong #define M98090_REC_B2_HI_WIDTH		8
1355685e4215SJerry Wong #define M98090_REC_B2_MID_MASK		(255<<0)
1356685e4215SJerry Wong #define M98090_REC_B2_MID_SHIFT		0
1357685e4215SJerry Wong #define M98090_REC_B2_MID_WIDTH		8
1358685e4215SJerry Wong #define M98090_REC_B2_LO_MASK		(255<<0)
1359685e4215SJerry Wong #define M98090_REC_B2_LO_SHIFT		0
1360685e4215SJerry Wong #define M98090_REC_B2_LO_WIDTH		8
1361685e4215SJerry Wong #define M98090_REC_A1_HI_MASK		(255<<0)
1362685e4215SJerry Wong #define M98090_REC_A1_HI_SHIFT		0
1363685e4215SJerry Wong #define M98090_REC_A1_HI_WIDTH		8
1364685e4215SJerry Wong #define M98090_REC_A1_MID_MASK		(255<<0)
1365685e4215SJerry Wong #define M98090_REC_A1_MID_SHIFT		0
1366685e4215SJerry Wong #define M98090_REC_A1_MID_WIDTH		8
1367685e4215SJerry Wong #define M98090_REC_A1_LO_MASK		(255<<0)
1368685e4215SJerry Wong #define M98090_REC_A1_LO_SHIFT		0
1369685e4215SJerry Wong #define M98090_REC_A1_LO_WIDTH		8
1370685e4215SJerry Wong #define M98090_REC_A2_HI_MASK		(255<<0)
1371685e4215SJerry Wong #define M98090_REC_A2_HI_SHIFT		0
1372685e4215SJerry Wong #define M98090_REC_A2_HI_WIDTH		8
1373685e4215SJerry Wong #define M98090_REC_A2_MID_MASK		(255<<0)
1374685e4215SJerry Wong #define M98090_REC_A2_MID_SHIFT		0
1375685e4215SJerry Wong #define M98090_REC_A2_MID_WIDTH		8
1376685e4215SJerry Wong #define M98090_REC_A2_LO_MASK		(255<<0)
1377685e4215SJerry Wong #define M98090_REC_A2_LO_SHIFT		0
1378685e4215SJerry Wong #define M98090_REC_A2_LO_WIDTH		8
1379685e4215SJerry Wong 
1380685e4215SJerry Wong /*
1381685e4215SJerry Wong  * M98090_REG_DMIC3_VOLUME
1382685e4215SJerry Wong  */
1383685e4215SJerry Wong #define M98090_DMIC_AV3G_MASK		(7<<4)
1384685e4215SJerry Wong #define M98090_DMIC_AV3G_SHIFT		4
1385685e4215SJerry Wong #define M98090_DMIC_AV3G_WIDTH		3
1386685e4215SJerry Wong #define M98090_DMIC_AV3G_NUM		(1<<M98090_DMIC_AV3G_WIDTH)
1387685e4215SJerry Wong #define M98090_DMIC_AV3_MASK		(15<<0)
1388685e4215SJerry Wong #define M98090_DMIC_AV3_SHIFT		0
1389685e4215SJerry Wong #define M98090_DMIC_AV3_WIDTH		4
1390685e4215SJerry Wong #define M98090_DMIC_AV3_NUM		(1<<M98090_DMIC_AV3_WIDTH)
1391685e4215SJerry Wong 
1392685e4215SJerry Wong /*
1393685e4215SJerry Wong  * M98090_REG_DMIC4_VOLUME
1394685e4215SJerry Wong  */
1395685e4215SJerry Wong #define M98090_DMIC_AV4G_MASK		(7<<4)
1396685e4215SJerry Wong #define M98090_DMIC_AV4G_SHIFT		4
1397685e4215SJerry Wong #define M98090_DMIC_AV4G_WIDTH		3
1398685e4215SJerry Wong #define M98090_DMIC_AV4G_NUM		(1<<M98090_DMIC_AV4G_WIDTH)
1399685e4215SJerry Wong #define M98090_DMIC_AV4_MASK		(15<<0)
1400685e4215SJerry Wong #define M98090_DMIC_AV4_SHIFT		0
1401685e4215SJerry Wong #define M98090_DMIC_AV4_WIDTH		4
1402685e4215SJerry Wong #define M98090_DMIC_AV4_NUM		(1<<M98090_DMIC_AV4_WIDTH)
1403685e4215SJerry Wong 
1404685e4215SJerry Wong /*
1405685e4215SJerry Wong  * M98090_REG_DMIC34_BQ_PREATTEN
1406685e4215SJerry Wong  */
1407685e4215SJerry Wong #define M98090_AV34BQ_MASK		(15<<0)
1408685e4215SJerry Wong #define M98090_AV34BQ_SHIFT		0
1409685e4215SJerry Wong #define M98090_AV34BQ_WIDTH		4
1410685e4215SJerry Wong #define M98090_AV34BQ_NUM		(1<<M98090_AV34BQ_WIDTH)
1411685e4215SJerry Wong 
1412685e4215SJerry Wong /*
1413685e4215SJerry Wong  * M98090_REG_RECORD_TDM_SLOT
1414685e4215SJerry Wong  */
1415685e4215SJerry Wong #define M98090_TDM_SLOTADCL_MASK	(3<<6)
1416685e4215SJerry Wong #define M98090_TDM_SLOTADCL_SHIFT	6
1417685e4215SJerry Wong #define M98090_TDM_SLOTADCL_WIDTH	2
1418685e4215SJerry Wong #define M98090_TDM_SLOTADCL_NUM		(1<<M98090_TDM_SLOTADCL_WIDTH)
1419685e4215SJerry Wong #define M98090_TDM_SLOTADCR_MASK	(3<<4)
1420685e4215SJerry Wong #define M98090_TDM_SLOTADCR_SHIFT	4
1421685e4215SJerry Wong #define M98090_TDM_SLOTADCR_WIDTH	2
1422685e4215SJerry Wong #define M98090_TDM_SLOTADCR_NUM		(1<<M98090_TDM_SLOTADCR_WIDTH)
1423685e4215SJerry Wong #define M98090_TDM_SLOTDMIC3_MASK	(3<<2)
1424685e4215SJerry Wong #define M98090_TDM_SLOTDMIC3_SHIFT	2
1425685e4215SJerry Wong #define M98090_TDM_SLOTDMIC3_WIDTH	2
1426685e4215SJerry Wong #define M98090_TDM_SLOTDMIC3_NUM	(1<<M98090_TDM_SLOTDMIC3_WIDTH)
1427685e4215SJerry Wong #define M98090_TDM_SLOTDMIC4_MASK	(3<<0)
1428685e4215SJerry Wong #define M98090_TDM_SLOTDMIC4_SHIFT	0
1429685e4215SJerry Wong #define M98090_TDM_SLOTDMIC4_WIDTH	2
1430685e4215SJerry Wong #define M98090_TDM_SLOTDMIC4_NUM	(1<<M98090_TDM_SLOTDMIC4_WIDTH)
1431685e4215SJerry Wong 
1432685e4215SJerry Wong /*
1433685e4215SJerry Wong  * M98090_REG_SAMPLE_RATE
1434685e4215SJerry Wong  */
1435685e4215SJerry Wong #define M98090_DMIC34_ZEROPAD_MASK	(1<<4)
1436685e4215SJerry Wong #define M98090_DMIC34_ZEROPAD_SHIFT	4
1437685e4215SJerry Wong #define M98090_DMIC34_ZEROPAD_WIDTH	1
1438685e4215SJerry Wong #define M98090_DMIC34_ZEROPAD_NUM	(1<<M98090_DIGMIC4_WIDTH)
1439685e4215SJerry Wong #define M98090_DMIC34_SRDIV_MASK	(7<<0)
1440685e4215SJerry Wong #define M98090_DMIC34_SRDIV_SHIFT	0
1441685e4215SJerry Wong #define M98090_DMIC34_SRDIV_WIDTH	3
1442685e4215SJerry Wong 
1443685e4215SJerry Wong /*
1444685e4215SJerry Wong  * M98090_REG_DMIC34_BIQUAD_BASE
1445685e4215SJerry Wong  */
1446685e4215SJerry Wong #define M98090_DMIC34_B0_HI_MASK	(255<<0)
1447685e4215SJerry Wong #define M98090_DMIC34_B0_HI_SHIFT	0
1448685e4215SJerry Wong #define M98090_DMIC34_B0_HI_WIDTH	8
1449685e4215SJerry Wong #define M98090_DMIC34_B0_MID_MASK	(255<<0)
1450685e4215SJerry Wong #define M98090_DMIC34_B0_MID_SHIFT	0
1451685e4215SJerry Wong #define M98090_DMIC34_B0_MID_WIDTH	8
1452685e4215SJerry Wong #define M98090_DMIC34_B0_LO_MASK	(255<<0)
1453685e4215SJerry Wong #define M98090_DMIC34_B0_LO_SHIFT	0
1454685e4215SJerry Wong #define M98090_DMIC34_B0_LO_WIDTH	8
1455685e4215SJerry Wong #define M98090_DMIC34_B1_HI_MASK	(255<<0)
1456685e4215SJerry Wong #define M98090_DMIC34_B1_HI_SHIFT	0
1457685e4215SJerry Wong #define M98090_DMIC34_B1_HI_WIDTH	8
1458685e4215SJerry Wong #define M98090_DMIC34_B1_MID_MASK	(255<<0)
1459685e4215SJerry Wong #define M98090_DMIC34_B1_MID_SHIFT	0
1460685e4215SJerry Wong #define M98090_DMIC34_B1_MID_WIDTH	8
1461685e4215SJerry Wong #define M98090_DMIC34_B1_LO_MASK	(255<<0)
1462685e4215SJerry Wong #define M98090_DMIC34_B1_LO_SHIFT	0
1463685e4215SJerry Wong #define M98090_DMIC34_B1_LO_WIDTH	8
1464685e4215SJerry Wong #define M98090_DMIC34_B2_HI_MASK	(255<<0)
1465685e4215SJerry Wong #define M98090_DMIC34_B2_HI_SHIFT	0
1466685e4215SJerry Wong #define M98090_DMIC34_B2_HI_WIDTH	8
1467685e4215SJerry Wong #define M98090_DMIC34_B2_MID_MASK	(255<<0)
1468685e4215SJerry Wong #define M98090_DMIC34_B2_MID_SHIFT	0
1469685e4215SJerry Wong #define M98090_DMIC34_B2_MID_WIDTH	8
1470685e4215SJerry Wong #define M98090_DMIC34_B2_LO_MASK	(255<<0)
1471685e4215SJerry Wong #define M98090_DMIC34_B2_LO_SHIFT	0
1472685e4215SJerry Wong #define M98090_DMIC34_B2_LO_WIDTH	8
1473685e4215SJerry Wong #define M98090_DMIC34_A1_HI_MASK	(255<<0)
1474685e4215SJerry Wong #define M98090_DMIC34_A1_HI_SHIFT	0
1475685e4215SJerry Wong #define M98090_DMIC34_A1_HI_WIDTH	8
1476685e4215SJerry Wong #define M98090_DMIC34_A1_MID_MASK	(255<<0)
1477685e4215SJerry Wong #define M98090_DMIC34_A1_MID_SHIFT	0
1478685e4215SJerry Wong #define M98090_DMIC34_A1_MID_WIDTH	8
1479685e4215SJerry Wong #define M98090_DMIC34_A1_LO_MASK	(255<<0)
1480685e4215SJerry Wong #define M98090_DMIC34_A1_LO_SHIFT	0
1481685e4215SJerry Wong #define M98090_DMIC34_A1_LO_WIDTH	8
1482685e4215SJerry Wong #define M98090_DMIC34_A2_HI_MASK	(255<<0)
1483685e4215SJerry Wong #define M98090_DMIC34_A2_HI_SHIFT	0
1484685e4215SJerry Wong #define M98090_DMIC34_A2_HI_WIDTH	8
1485685e4215SJerry Wong #define M98090_DMIC34_A2_MID_MASK	(255<<0)
1486685e4215SJerry Wong #define M98090_DMIC34_A2_MID_SHIFT	0
1487685e4215SJerry Wong #define M98090_DMIC34_A2_MID_WIDTH	8
1488685e4215SJerry Wong #define M98090_DMIC34_A2_LO_MASK	(255<<0)
1489685e4215SJerry Wong #define M98090_DMIC34_A2_LO_SHIFT	0
1490685e4215SJerry Wong #define M98090_DMIC34_A2_LO_WIDTH	8
1491685e4215SJerry Wong 
1492685e4215SJerry Wong #define M98090_JACK_STATE_NO_HEADSET	0
1493685e4215SJerry Wong #define M98090_JACK_STATE_NO_HEADSET_2	1
1494685e4215SJerry Wong #define M98090_JACK_STATE_HEADPHONE	2
1495685e4215SJerry Wong #define M98090_JACK_STATE_HEADSET	3
1496685e4215SJerry Wong 
1497685e4215SJerry Wong /*
1498685e4215SJerry Wong  * M98090_REG_REVISION_ID
1499685e4215SJerry Wong  */
1500685e4215SJerry Wong #define M98090_REVID_MASK		(255<<0)
1501685e4215SJerry Wong #define M98090_REVID_SHIFT		0
1502685e4215SJerry Wong #define M98090_REVID_WIDTH		8
1503685e4215SJerry Wong #define M98090_REVID_NUM		(1<<M98090_REVID_WIDTH)
1504685e4215SJerry Wong 
1505685e4215SJerry Wong #define M98090_BYTE1(w) ((w >> 8) & 0xff)
1506685e4215SJerry Wong #define M98090_BYTE0(w) (w & 0xff)
1507685e4215SJerry Wong 
1508685e4215SJerry Wong /* Silicon revision number */
1509685e4215SJerry Wong #define M98090_REVA			0x40
1510685e4215SJerry Wong #define M98091_REVA			0x50
1511685e4215SJerry Wong 
1512685e4215SJerry Wong enum max98090_type {
1513685e4215SJerry Wong 	MAX98090,
1514685e4215SJerry Wong 	MAX98091,
1515685e4215SJerry Wong };
1516685e4215SJerry Wong 
1517685e4215SJerry Wong struct max98090_cdata {
1518685e4215SJerry Wong 	unsigned int rate;
1519685e4215SJerry Wong 	unsigned int fmt;
1520685e4215SJerry Wong };
1521685e4215SJerry Wong 
1522685e4215SJerry Wong struct max98090_priv {
1523685e4215SJerry Wong 	struct regmap *regmap;
1524685e4215SJerry Wong 	struct snd_soc_codec *codec;
1525685e4215SJerry Wong 	enum max98090_type devtype;
1526685e4215SJerry Wong 	struct max98090_pdata *pdata;
1527b10ab7b8STushar Behera 	struct clk *mclk;
1528685e4215SJerry Wong 	unsigned int sysclk;
1529685e4215SJerry Wong 	unsigned int bclk;
1530685e4215SJerry Wong 	unsigned int lrclk;
1531685e4215SJerry Wong 	struct max98090_cdata dai[1];
1532685e4215SJerry Wong 	int irq;
1533685e4215SJerry Wong 	int jack_state;
1534685e4215SJerry Wong 	struct delayed_work jack_work;
1535*b8a3ee82SJarkko Nikula 	struct delayed_work pll_det_enable_work;
1536*b8a3ee82SJarkko Nikula 	struct work_struct pll_det_disable_work;
1537*b8a3ee82SJarkko Nikula 	struct work_struct pll_work;
1538685e4215SJerry Wong 	struct snd_soc_jack *jack;
1539685e4215SJerry Wong 	unsigned int dai_fmt;
1540685e4215SJerry Wong 	int tdm_slots;
1541685e4215SJerry Wong 	int tdm_width;
1542685e4215SJerry Wong 	u8 lin_state;
1543685e4215SJerry Wong 	unsigned int pa1en;
1544685e4215SJerry Wong 	unsigned int pa2en;
1545685e4215SJerry Wong 	unsigned int extmic_mux;
1546685e4215SJerry Wong 	unsigned int sidetone;
1547541423ddSLiam Girdwood 	bool master;
1548685e4215SJerry Wong };
1549685e4215SJerry Wong 
1550685e4215SJerry Wong int max98090_mic_detect(struct snd_soc_codec *codec,
1551685e4215SJerry Wong 	struct snd_soc_jack *jack);
1552685e4215SJerry Wong 
1553685e4215SJerry Wong #endif
1554