xref: /openbmc/linux/sound/soc/codecs/cs53l30.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2de9b1214SNicolin Chen /*
3de9b1214SNicolin Chen  * ALSA SoC CS53L30 codec driver
4de9b1214SNicolin Chen  *
5de9b1214SNicolin Chen  * Copyright 2015 Cirrus Logic, Inc.
6de9b1214SNicolin Chen  *
7de9b1214SNicolin Chen  * Author: Paul Handrigan <Paul.Handrigan@cirrus.com>,
8de9b1214SNicolin Chen  *         Tim Howe <Tim.Howe@cirrus.com>
9de9b1214SNicolin Chen  */
10de9b1214SNicolin Chen 
11de9b1214SNicolin Chen #ifndef __CS53L30_H__
12de9b1214SNicolin Chen #define __CS53L30_H__
13de9b1214SNicolin Chen 
14de9b1214SNicolin Chen /* I2C Registers */
15de9b1214SNicolin Chen #define CS53L30_DEVID_AB	0x01	 /* Device ID A & B [RO]. */
16de9b1214SNicolin Chen #define CS53L30_DEVID_CD	0x02     /* Device ID C & D [RO]. */
17de9b1214SNicolin Chen #define CS53L30_DEVID_E		0x03     /* Device ID E [RO]. */
18de9b1214SNicolin Chen #define CS53L30_REVID		0x05     /* Revision ID [RO]. */
19de9b1214SNicolin Chen #define CS53L30_PWRCTL		0x06     /* Power Control. */
20de9b1214SNicolin Chen #define CS53L30_MCLKCTL		0x07     /* MCLK Control. */
21de9b1214SNicolin Chen #define CS53L30_INT_SR_CTL	0x08     /* Internal Sample Rate Control. */
22de9b1214SNicolin Chen #define CS53L30_MICBIAS_CTL	0x0A     /* Mic Bias Control. */
23de9b1214SNicolin Chen #define CS53L30_ASPCFG_CTL	0x0C     /* ASP Config Control. */
24de9b1214SNicolin Chen #define CS53L30_ASP_CTL1	0x0D     /* ASP1 Control. */
25de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_CTL1	0x0E     /* ASP1 TDM TX Control 1 */
26de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_CTL2	0x0F     /* ASP1 TDM TX Control 2 */
27de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_CTL3	0x10     /* ASP1 TDM TX Control 3 */
28de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_CTL4	0x11     /* ASP1 TDM TX Control 4 */
29de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_EN1	0x12     /* ASP1 TDM TX Enable 1 */
30de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_EN2	0x13     /* ASP1 TDM TX Enable 2 */
31de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_EN3	0x14     /* ASP1 TDM TX Enable 3 */
32de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_EN4	0x15     /* ASP1 TDM TX Enable 4 */
33de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_EN5	0x16     /* ASP1 TDM TX Enable 5 */
34de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_EN6	0x17     /* ASP1 TDM TX Enable 6 */
35de9b1214SNicolin Chen #define CS53L30_ASP_CTL2	0x18     /* ASP2 Control. */
36de9b1214SNicolin Chen #define CS53L30_SFT_RAMP	0x1A     /* Soft Ramp Control. */
37de9b1214SNicolin Chen #define CS53L30_LRCK_CTL1	0x1B     /* LRCK Control 1. */
38de9b1214SNicolin Chen #define CS53L30_LRCK_CTL2	0x1C     /* LRCK Control 2. */
39de9b1214SNicolin Chen #define CS53L30_MUTEP_CTL1	0x1F     /* Mute Pin Control 1. */
40de9b1214SNicolin Chen #define CS53L30_MUTEP_CTL2	0x20     /* Mute Pin Control 2. */
41de9b1214SNicolin Chen #define CS53L30_INBIAS_CTL1	0x21     /* Input Bias Control 1. */
42de9b1214SNicolin Chen #define CS53L30_INBIAS_CTL2	0x22     /* Input Bias Control 2. */
43de9b1214SNicolin Chen #define CS53L30_DMIC1_STR_CTL   0x23     /* DMIC1 Stereo Control. */
44de9b1214SNicolin Chen #define CS53L30_DMIC2_STR_CTL   0x24     /* DMIC2 Stereo Control. */
45de9b1214SNicolin Chen #define CS53L30_ADCDMIC1_CTL1   0x25     /* ADC1/DMIC1 Control 1. */
46de9b1214SNicolin Chen #define CS53L30_ADCDMIC1_CTL2   0x26     /* ADC1/DMIC1 Control 2. */
47de9b1214SNicolin Chen #define CS53L30_ADC1_CTL3	0x27     /* ADC1 Control 3. */
48de9b1214SNicolin Chen #define CS53L30_ADC1_NG_CTL	0x28     /* ADC1 Noise Gate Control. */
49de9b1214SNicolin Chen #define CS53L30_ADC1A_AFE_CTL	0x29     /* ADC1A AFE Control. */
50de9b1214SNicolin Chen #define CS53L30_ADC1B_AFE_CTL	0x2A     /* ADC1B AFE Control. */
51de9b1214SNicolin Chen #define CS53L30_ADC1A_DIG_VOL	0x2B     /* ADC1A Digital Volume. */
52de9b1214SNicolin Chen #define CS53L30_ADC1B_DIG_VOL	0x2C     /* ADC1B Digital Volume. */
53de9b1214SNicolin Chen #define CS53L30_ADCDMIC2_CTL1   0x2D     /* ADC2/DMIC2 Control 1. */
54de9b1214SNicolin Chen #define CS53L30_ADCDMIC2_CTL2   0x2E     /* ADC2/DMIC2 Control 2. */
55de9b1214SNicolin Chen #define CS53L30_ADC2_CTL3	0x2F     /* ADC2 Control 3. */
56de9b1214SNicolin Chen #define CS53L30_ADC2_NG_CTL	0x30     /* ADC2 Noise Gate Control. */
57de9b1214SNicolin Chen #define CS53L30_ADC2A_AFE_CTL	0x31     /* ADC2A AFE Control. */
58de9b1214SNicolin Chen #define CS53L30_ADC2B_AFE_CTL	0x32     /* ADC2B AFE Control. */
59de9b1214SNicolin Chen #define CS53L30_ADC2A_DIG_VOL	0x33     /* ADC2A Digital Volume. */
60de9b1214SNicolin Chen #define CS53L30_ADC2B_DIG_VOL	0x34     /* ADC2B Digital Volume. */
61de9b1214SNicolin Chen #define CS53L30_INT_MASK	0x35     /* Interrupt Mask. */
62de9b1214SNicolin Chen #define CS53L30_IS		0x36     /* Interrupt Status. */
63de9b1214SNicolin Chen #define CS53L30_MAX_REGISTER	0x36
64de9b1214SNicolin Chen 
65de9b1214SNicolin Chen #define CS53L30_TDM_SLOT_MAX		4
66de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_CTL(x)	(CS53L30_ASP_TDMTX_CTL1 + (x))
67de9b1214SNicolin Chen /* x : index for registers; n : index for slot; 8 slots per register */
68de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_ENx(x)	(CS53L30_ASP_TDMTX_EN6 - (x))
69de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_ENn(n)	CS53L30_ASP_TDMTX_ENx((n) >> 3)
70de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_ENx_MAX	6
71de9b1214SNicolin Chen 
72de9b1214SNicolin Chen /* Device ID */
73de9b1214SNicolin Chen #define CS53L30_DEVID		0x53A30
74de9b1214SNicolin Chen 
75de9b1214SNicolin Chen /* PDN_DONE Poll Maximum
76de9b1214SNicolin Chen  * If soft ramp is set it will take much longer to power down
77de9b1214SNicolin Chen  * the system.
78de9b1214SNicolin Chen  */
79de9b1214SNicolin Chen #define CS53L30_PDN_POLL_MAX	90
80de9b1214SNicolin Chen 
81de9b1214SNicolin Chen /* Bitfield Definitions */
82de9b1214SNicolin Chen 
83de9b1214SNicolin Chen /* R6 (0x06) CS53L30_PWRCTL - Power Control */
84de9b1214SNicolin Chen #define CS53L30_PDN_ULP_SHIFT		7
85de9b1214SNicolin Chen #define CS53L30_PDN_ULP_MASK		(1 << CS53L30_PDN_ULP_SHIFT)
86de9b1214SNicolin Chen #define CS53L30_PDN_ULP			(1 << CS53L30_PDN_ULP_SHIFT)
87de9b1214SNicolin Chen #define CS53L30_PDN_LP_SHIFT		6
88de9b1214SNicolin Chen #define CS53L30_PDN_LP_MASK		(1 << CS53L30_PDN_LP_SHIFT)
89de9b1214SNicolin Chen #define CS53L30_PDN_LP			(1 << CS53L30_PDN_LP_SHIFT)
90de9b1214SNicolin Chen #define CS53L30_DISCHARGE_FILT_SHIFT	5
91de9b1214SNicolin Chen #define CS53L30_DISCHARGE_FILT_MASK	(1 << CS53L30_DISCHARGE_FILT_SHIFT)
92de9b1214SNicolin Chen #define CS53L30_DISCHARGE_FILT		(1 << CS53L30_DISCHARGE_FILT_SHIFT)
93de9b1214SNicolin Chen #define CS53L30_THMS_PDN_SHIFT		4
94de9b1214SNicolin Chen #define CS53L30_THMS_PDN_MASK		(1 << CS53L30_THMS_PDN_SHIFT)
95de9b1214SNicolin Chen #define CS53L30_THMS_PDN		(1 << CS53L30_THMS_PDN_SHIFT)
96de9b1214SNicolin Chen 
97de9b1214SNicolin Chen #define CS53L30_PWRCTL_DEFAULT		(CS53L30_THMS_PDN)
98de9b1214SNicolin Chen 
99de9b1214SNicolin Chen /* R7 (0x07) CS53L30_MCLKCTL - MCLK Control */
100de9b1214SNicolin Chen #define CS53L30_MCLK_DIS_SHIFT		7
101de9b1214SNicolin Chen #define CS53L30_MCLK_DIS_MASK		(1 << CS53L30_MCLK_DIS_SHIFT)
102de9b1214SNicolin Chen #define CS53L30_MCLK_DIS		(1 << CS53L30_MCLK_DIS_SHIFT)
103de9b1214SNicolin Chen #define CS53L30_MCLK_INT_SCALE_SHIFT	6
104de9b1214SNicolin Chen #define CS53L30_MCLK_INT_SCALE_MASK	(1 << CS53L30_MCLK_INT_SCALE_SHIFT)
105de9b1214SNicolin Chen #define CS53L30_MCLK_INT_SCALE		(1 << CS53L30_MCLK_INT_SCALE_SHIFT)
106de9b1214SNicolin Chen #define CS53L30_DMIC_DRIVE_SHIFT	5
107de9b1214SNicolin Chen #define CS53L30_DMIC_DRIVE_MASK		(1 << CS53L30_DMIC_DRIVE_SHIFT)
108de9b1214SNicolin Chen #define CS53L30_DMIC_DRIVE		(1 << CS53L30_DMIC_DRIVE_SHIFT)
109de9b1214SNicolin Chen #define CS53L30_MCLK_DIV_SHIFT		2
110de9b1214SNicolin Chen #define CS53L30_MCLK_DIV_WIDTH		2
111de9b1214SNicolin Chen #define CS53L30_MCLK_DIV_MASK		(((1 << CS53L30_MCLK_DIV_WIDTH) - 1) << CS53L30_MCLK_DIV_SHIFT)
112de9b1214SNicolin Chen #define CS53L30_MCLK_DIV_BY_1		(0x0 << CS53L30_MCLK_DIV_SHIFT)
113de9b1214SNicolin Chen #define CS53L30_MCLK_DIV_BY_2		(0x1 << CS53L30_MCLK_DIV_SHIFT)
114de9b1214SNicolin Chen #define CS53L30_MCLK_DIV_BY_3		(0x2 << CS53L30_MCLK_DIV_SHIFT)
115de9b1214SNicolin Chen #define CS53L30_SYNC_EN_SHIFT		1
116de9b1214SNicolin Chen #define CS53L30_SYNC_EN_MASK		(1 << CS53L30_SYNC_EN_SHIFT)
117de9b1214SNicolin Chen #define CS53L30_SYNC_EN			(1 << CS53L30_SYNC_EN_SHIFT)
118de9b1214SNicolin Chen 
119de9b1214SNicolin Chen #define CS53L30_MCLKCTL_DEFAULT		(CS53L30_MCLK_DIV_BY_2)
120de9b1214SNicolin Chen 
121de9b1214SNicolin Chen /* R8 (0x08) CS53L30_INT_SR_CTL - Internal Sample Rate Control */
122de9b1214SNicolin Chen #define CS53L30_INTRNL_FS_RATIO_SHIFT	4
123de9b1214SNicolin Chen #define CS53L30_INTRNL_FS_RATIO_MASK	(1 << CS53L30_INTRNL_FS_RATIO_SHIFT)
124de9b1214SNicolin Chen #define CS53L30_INTRNL_FS_RATIO		(1 << CS53L30_INTRNL_FS_RATIO_SHIFT)
125de9b1214SNicolin Chen #define CS53L30_MCLK_19MHZ_EN_SHIFT	0
126de9b1214SNicolin Chen #define CS53L30_MCLK_19MHZ_EN_MASK	(1 << CS53L30_MCLK_19MHZ_EN_SHIFT)
127de9b1214SNicolin Chen #define CS53L30_MCLK_19MHZ_EN		(1 << CS53L30_MCLK_19MHZ_EN_SHIFT)
128de9b1214SNicolin Chen 
129de9b1214SNicolin Chen /* 0x6 << 1 is reserved bits */
130de9b1214SNicolin Chen #define CS53L30_INT_SR_CTL_DEFAULT	(CS53L30_INTRNL_FS_RATIO | 0x6 << 1)
131de9b1214SNicolin Chen 
132de9b1214SNicolin Chen /* R10 (0x0A) CS53L30_MICBIAS_CTL - Mic Bias Control */
133de9b1214SNicolin Chen #define CS53L30_MIC4_BIAS_PDN_SHIFT	7
134de9b1214SNicolin Chen #define CS53L30_MIC4_BIAS_PDN_MASK	(1 << CS53L30_MIC4_BIAS_PDN_SHIFT)
135de9b1214SNicolin Chen #define CS53L30_MIC4_BIAS_PDN		(1 << CS53L30_MIC4_BIAS_PDN_SHIFT)
136de9b1214SNicolin Chen #define CS53L30_MIC3_BIAS_PDN_SHIFT	6
137de9b1214SNicolin Chen #define CS53L30_MIC3_BIAS_PDN_MASK	(1 << CS53L30_MIC3_BIAS_PDN_SHIFT)
138de9b1214SNicolin Chen #define CS53L30_MIC3_BIAS_PDN		(1 << CS53L30_MIC3_BIAS_PDN_SHIFT)
139de9b1214SNicolin Chen #define CS53L30_MIC2_BIAS_PDN_SHIFT	5
140de9b1214SNicolin Chen #define CS53L30_MIC2_BIAS_PDN_MASK	(1 << CS53L30_MIC2_BIAS_PDN_SHIFT)
141de9b1214SNicolin Chen #define CS53L30_MIC2_BIAS_PDN		(1 << CS53L30_MIC2_BIAS_PDN_SHIFT)
142de9b1214SNicolin Chen #define CS53L30_MIC1_BIAS_PDN_SHIFT	4
143de9b1214SNicolin Chen #define CS53L30_MIC1_BIAS_PDN_MASK	(1 << CS53L30_MIC1_BIAS_PDN_SHIFT)
144de9b1214SNicolin Chen #define CS53L30_MIC1_BIAS_PDN		(1 << CS53L30_MIC1_BIAS_PDN_SHIFT)
145de9b1214SNicolin Chen #define CS53L30_MICx_BIAS_PDN		(0xf << CS53L30_MIC1_BIAS_PDN_SHIFT)
146de9b1214SNicolin Chen #define CS53L30_VP_MIN_SHIFT		2
147de9b1214SNicolin Chen #define CS53L30_VP_MIN_MASK		(1 << CS53L30_VP_MIN_SHIFT)
148de9b1214SNicolin Chen #define CS53L30_VP_MIN			(1 << CS53L30_VP_MIN_SHIFT)
149de9b1214SNicolin Chen #define CS53L30_MIC_BIAS_CTRL_SHIFT	0
150de9b1214SNicolin Chen #define CS53L30_MIC_BIAS_CTRL_WIDTH	2
151de9b1214SNicolin Chen #define CS53L30_MIC_BIAS_CTRL_MASK	(((1 << CS53L30_MIC_BIAS_CTRL_WIDTH) - 1) << CS53L30_MIC_BIAS_CTRL_SHIFT)
152de9b1214SNicolin Chen #define CS53L30_MIC_BIAS_CTRL_HIZ	(0 << CS53L30_MIC_BIAS_CTRL_SHIFT)
153de9b1214SNicolin Chen #define CS53L30_MIC_BIAS_CTRL_1V8	(1 << CS53L30_MIC_BIAS_CTRL_SHIFT)
154de9b1214SNicolin Chen #define CS53L30_MIC_BIAS_CTRL_2V75	(2 << CS53L30_MIC_BIAS_CTRL_SHIFT)
155de9b1214SNicolin Chen 
156de9b1214SNicolin Chen #define CS53L30_MICBIAS_CTL_DEFAULT	(CS53L30_MICx_BIAS_PDN | CS53L30_VP_MIN)
157de9b1214SNicolin Chen 
158de9b1214SNicolin Chen /* R12 (0x0C) CS53L30_ASPCFG_CTL - ASP Configuration Control */
159de9b1214SNicolin Chen #define CS53L30_ASP_MS_SHIFT		7
160de9b1214SNicolin Chen #define CS53L30_ASP_MS_MASK		(1 << CS53L30_ASP_MS_SHIFT)
161de9b1214SNicolin Chen #define CS53L30_ASP_MS			(1 << CS53L30_ASP_MS_SHIFT)
162de9b1214SNicolin Chen #define CS53L30_ASP_SCLK_INV_SHIFT	4
163de9b1214SNicolin Chen #define CS53L30_ASP_SCLK_INV_MASK	(1 << CS53L30_ASP_SCLK_INV_SHIFT)
164de9b1214SNicolin Chen #define CS53L30_ASP_SCLK_INV		(1 << CS53L30_ASP_SCLK_INV_SHIFT)
165de9b1214SNicolin Chen #define CS53L30_ASP_RATE_SHIFT		0
166de9b1214SNicolin Chen #define CS53L30_ASP_RATE_WIDTH		4
167de9b1214SNicolin Chen #define CS53L30_ASP_RATE_MASK		(((1 << CS53L30_ASP_RATE_WIDTH) - 1) << CS53L30_ASP_RATE_SHIFT)
168de9b1214SNicolin Chen #define CS53L30_ASP_RATE_48K		(0xc << CS53L30_ASP_RATE_SHIFT)
169de9b1214SNicolin Chen 
170de9b1214SNicolin Chen #define CS53L30_ASPCFG_CTL_DEFAULT	(CS53L30_ASP_RATE_48K)
171de9b1214SNicolin Chen 
172de9b1214SNicolin Chen /* R13/R24 (0x0D/0x18) CS53L30_ASP_CTL1 & CS53L30_ASP_CTL2 - ASP Control 1~2 */
173de9b1214SNicolin Chen #define CS53L30_ASP_TDM_PDN_SHIFT	7
174de9b1214SNicolin Chen #define CS53L30_ASP_TDM_PDN_MASK	(1 << CS53L30_ASP_TDM_PDN_SHIFT)
175de9b1214SNicolin Chen #define CS53L30_ASP_TDM_PDN		(1 << CS53L30_ASP_TDM_PDN_SHIFT)
176de9b1214SNicolin Chen #define CS53L30_ASP_SDOUTx_PDN_SHIFT	6
177de9b1214SNicolin Chen #define CS53L30_ASP_SDOUTx_PDN_MASK	(1 << CS53L30_ASP_SDOUTx_PDN_SHIFT)
178de9b1214SNicolin Chen #define CS53L30_ASP_SDOUTx_PDN		(1 << CS53L30_ASP_SDOUTx_PDN_SHIFT)
179de9b1214SNicolin Chen #define CS53L30_ASP_3ST_SHIFT		5
180de9b1214SNicolin Chen #define CS53L30_ASP_3ST_MASK		(1 << CS53L30_ASP_3ST_SHIFT)
181de9b1214SNicolin Chen #define CS53L30_ASP_3ST			(1 << CS53L30_ASP_3ST_SHIFT)
182de9b1214SNicolin Chen #define CS53L30_SHIFT_LEFT_SHIFT	4
183de9b1214SNicolin Chen #define CS53L30_SHIFT_LEFT_MASK		(1 << CS53L30_SHIFT_LEFT_SHIFT)
184de9b1214SNicolin Chen #define CS53L30_SHIFT_LEFT		(1 << CS53L30_SHIFT_LEFT_SHIFT)
185de9b1214SNicolin Chen #define CS53L30_ASP_SDOUTx_DRIVE_SHIFT	0
186de9b1214SNicolin Chen #define CS53L30_ASP_SDOUTx_DRIVE_MASK	(1 << CS53L30_ASP_SDOUTx_DRIVE_SHIFT)
187de9b1214SNicolin Chen #define CS53L30_ASP_SDOUTx_DRIVE	(1 << CS53L30_ASP_SDOUTx_DRIVE_SHIFT)
188de9b1214SNicolin Chen 
189de9b1214SNicolin Chen #define CS53L30_ASP_CTL1_DEFAULT	(CS53L30_ASP_TDM_PDN)
190de9b1214SNicolin Chen #define CS53L30_ASP_CTL2_DEFAULT	(0)
191de9b1214SNicolin Chen 
192de9b1214SNicolin Chen /* R14 (0x0E) ~ R17 (0x11) CS53L30_ASP_TDMTX_CTLx - ASP TDM TX Control 1~4 */
193de9b1214SNicolin Chen #define CS53L30_ASP_CHx_TX_STATE_SHIFT	7
194de9b1214SNicolin Chen #define CS53L30_ASP_CHx_TX_STATE_MASK	(1 << CS53L30_ASP_CHx_TX_STATE_SHIFT)
195de9b1214SNicolin Chen #define CS53L30_ASP_CHx_TX_STATE	(1 << CS53L30_ASP_CHx_TX_STATE_SHIFT)
196de9b1214SNicolin Chen #define CS53L30_ASP_CHx_TX_LOC_SHIFT	0
197de9b1214SNicolin Chen #define CS53L30_ASP_CHx_TX_LOC_WIDTH	6
198de9b1214SNicolin Chen #define CS53L30_ASP_CHx_TX_LOC_MASK	(((1 << CS53L30_ASP_CHx_TX_LOC_WIDTH) - 1) << CS53L30_ASP_CHx_TX_LOC_SHIFT)
199de9b1214SNicolin Chen #define CS53L30_ASP_CHx_TX_LOC_MAX	(47 << CS53L30_ASP_CHx_TX_LOC_SHIFT)
200de9b1214SNicolin Chen #define CS53L30_ASP_CHx_TX_LOC(x)	((x) << CS53L30_ASP_CHx_TX_LOC_SHIFT)
201de9b1214SNicolin Chen 
202de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_CTLx_DEFAULT	(CS53L30_ASP_CHx_TX_LOC_MAX)
203de9b1214SNicolin Chen 
204de9b1214SNicolin Chen /* R18 (0x12) ~ R23 (0x17) CS53L30_ASP_TDMTX_ENx - ASP TDM TX Enable 1~6 */
205de9b1214SNicolin Chen #define CS53L30_ASP_TDMTX_ENx_DEFAULT	(0)
206de9b1214SNicolin Chen 
207de9b1214SNicolin Chen /* R26 (0x1A) CS53L30_SFT_RAMP - Soft Ramp Control */
208de9b1214SNicolin Chen #define CS53L30_DIGSFT_SHIFT		5
209de9b1214SNicolin Chen #define CS53L30_DIGSFT_MASK		(1 << CS53L30_DIGSFT_SHIFT)
210de9b1214SNicolin Chen #define CS53L30_DIGSFT			(1 << CS53L30_DIGSFT_SHIFT)
211de9b1214SNicolin Chen 
212de9b1214SNicolin Chen #define CS53L30_SFT_RMP_DEFAULT		(0)
213de9b1214SNicolin Chen 
214de9b1214SNicolin Chen /* R28 (0x1C) CS53L30_LRCK_CTL2 - LRCK Control 2 */
215de9b1214SNicolin Chen #define CS53L30_LRCK_50_NPW_SHIFT	3
216de9b1214SNicolin Chen #define CS53L30_LRCK_50_NPW_MASK	(1 << CS53L30_LRCK_50_NPW_SHIFT)
217de9b1214SNicolin Chen #define CS53L30_LRCK_50_NPW		(1 << CS53L30_LRCK_50_NPW_SHIFT)
218de9b1214SNicolin Chen #define CS53L30_LRCK_TPWH_SHIFT		0
219de9b1214SNicolin Chen #define CS53L30_LRCK_TPWH_WIDTH		3
220de9b1214SNicolin Chen #define CS53L30_LRCK_TPWH_MASK		(((1 << CS53L30_LRCK_TPWH_WIDTH) - 1) << CS53L30_LRCK_TPWH_SHIFT)
221de9b1214SNicolin Chen #define CS53L30_LRCK_TPWH(x)		(((x) << CS53L30_LRCK_TPWH_SHIFT) & CS53L30_LRCK_TPWH_MASK)
222de9b1214SNicolin Chen 
223de9b1214SNicolin Chen #define CS53L30_LRCK_CTLx_DEFAULT	(0)
224de9b1214SNicolin Chen 
225de9b1214SNicolin Chen /* R31 (0x1F) CS53L30_MUTEP_CTL1 - MUTE Pin Control 1 */
226de9b1214SNicolin Chen #define CS53L30_MUTE_PDN_ULP_SHIFT	7
227de9b1214SNicolin Chen #define CS53L30_MUTE_PDN_ULP_MASK	(1 << CS53L30_MUTE_PDN_ULP_SHIFT)
228de9b1214SNicolin Chen #define CS53L30_MUTE_PDN_ULP		(1 << CS53L30_MUTE_PDN_ULP_SHIFT)
229de9b1214SNicolin Chen #define CS53L30_MUTE_PDN_LP_SHIFT	6
230de9b1214SNicolin Chen #define CS53L30_MUTE_PDN_LP_MASK	(1 << CS53L30_MUTE_PDN_LP_SHIFT)
231de9b1214SNicolin Chen #define CS53L30_MUTE_PDN_LP		(1 << CS53L30_MUTE_PDN_LP_SHIFT)
232de9b1214SNicolin Chen #define CS53L30_MUTE_M4B_PDN_SHIFT	4
233de9b1214SNicolin Chen #define CS53L30_MUTE_M4B_PDN_MASK	(1 << CS53L30_MUTE_M4B_PDN_SHIFT)
234de9b1214SNicolin Chen #define CS53L30_MUTE_M4B_PDN		(1 << CS53L30_MUTE_M4B_PDN_SHIFT)
235de9b1214SNicolin Chen #define CS53L30_MUTE_M3B_PDN_SHIFT	3
236de9b1214SNicolin Chen #define CS53L30_MUTE_M3B_PDN_MASK	(1 << CS53L30_MUTE_M3B_PDN_SHIFT)
237de9b1214SNicolin Chen #define CS53L30_MUTE_M3B_PDN		(1 << CS53L30_MUTE_M3B_PDN_SHIFT)
238de9b1214SNicolin Chen #define CS53L30_MUTE_M2B_PDN_SHIFT	2
239de9b1214SNicolin Chen #define CS53L30_MUTE_M2B_PDN_MASK	(1 << CS53L30_MUTE_M2B_PDN_SHIFT)
240de9b1214SNicolin Chen #define CS53L30_MUTE_M2B_PDN		(1 << CS53L30_MUTE_M2B_PDN_SHIFT)
241de9b1214SNicolin Chen #define CS53L30_MUTE_M1B_PDN_SHIFT	1
242de9b1214SNicolin Chen #define CS53L30_MUTE_M1B_PDN_MASK	(1 << CS53L30_MUTE_M1B_PDN_SHIFT)
243de9b1214SNicolin Chen #define CS53L30_MUTE_M1B_PDN		(1 << CS53L30_MUTE_M1B_PDN_SHIFT)
244de9b1214SNicolin Chen /* Note: be careful - x starts from 0 */
245de9b1214SNicolin Chen #define CS53L30_MUTE_MxB_PDN_SHIFT(x)	(CS53L30_MUTE_M1B_PDN_SHIFT + (x))
246de9b1214SNicolin Chen #define CS53L30_MUTE_MxB_PDN_MASK(x)	(1 << CS53L30_MUTE_MxB_PDN_SHIFT(x))
247de9b1214SNicolin Chen #define CS53L30_MUTE_MxB_PDN(x)		(1 << CS53L30_MUTE_MxB_PDN_SHIFT(x))
248de9b1214SNicolin Chen #define CS53L30_MUTE_MB_ALL_PDN_SHIFT	0
249de9b1214SNicolin Chen #define CS53L30_MUTE_MB_ALL_PDN_MASK	(1 << CS53L30_MUTE_MB_ALL_PDN_SHIFT)
250de9b1214SNicolin Chen #define CS53L30_MUTE_MB_ALL_PDN		(1 << CS53L30_MUTE_MB_ALL_PDN_SHIFT)
251de9b1214SNicolin Chen 
25205f33bc5SNicolin Chen #define CS53L30_MUTEP_CTL1_MUTEALL	(0xdf)
253de9b1214SNicolin Chen #define CS53L30_MUTEP_CTL1_DEFAULT	(0)
254de9b1214SNicolin Chen 
255de9b1214SNicolin Chen /* R32 (0x20) CS53L30_MUTEP_CTL2 - MUTE Pin Control 2 */
256de9b1214SNicolin Chen #define CS53L30_MUTE_PIN_POLARITY_SHIFT	7
257de9b1214SNicolin Chen #define CS53L30_MUTE_PIN_POLARITY_MASK	(1 << CS53L30_MUTE_PIN_POLARITY_SHIFT)
258de9b1214SNicolin Chen #define CS53L30_MUTE_PIN_POLARITY	(1 << CS53L30_MUTE_PIN_POLARITY_SHIFT)
259de9b1214SNicolin Chen #define CS53L30_MUTE_ASP_TDM_PDN_SHIFT	6
260de9b1214SNicolin Chen #define CS53L30_MUTE_ASP_TDM_PDN_MASK	(1 << CS53L30_MUTE_ASP_TDM_PDN_SHIFT)
261de9b1214SNicolin Chen #define CS53L30_MUTE_ASP_TDM_PDN	(1 << CS53L30_MUTE_ASP_TDM_PDN_SHIFT)
262de9b1214SNicolin Chen #define CS53L30_MUTE_ASP_SDOUT2_PDN_SHIFT 5
263de9b1214SNicolin Chen #define CS53L30_MUTE_ASP_SDOUT2_PDN_MASK (1 << CS53L30_MUTE_ASP_SDOUT2_PDN_SHIFT)
264de9b1214SNicolin Chen #define CS53L30_MUTE_ASP_SDOUT2_PDN	(1 << CS53L30_MUTE_ASP_SDOUT2_PDN_SHIFT)
265de9b1214SNicolin Chen #define CS53L30_MUTE_ASP_SDOUT1_PDN_SHIFT 4
266de9b1214SNicolin Chen #define CS53L30_MUTE_ASP_SDOUT1_PDN_MASK (1 << CS53L30_MUTE_ASP_SDOUT1_PDN_SHIFT)
267de9b1214SNicolin Chen #define CS53L30_MUTE_ASP_SDOUT1_PDN	(1 << CS53L30_MUTE_ASP_SDOUT1_PDN_SHIFT)
268de9b1214SNicolin Chen /* Note: be careful - x starts from 0 */
269de9b1214SNicolin Chen #define CS53L30_MUTE_ASP_SDOUTx_PDN_SHIFT(x) ((x) + CS53L30_MUTE_ASP_SDOUT1_PDN_SHIFT)
270de9b1214SNicolin Chen #define CS53L30_MUTE_ASP_SDOUTx_PDN_MASK(x) (1 << CS53L30_MUTE_ASP_SDOUTx_PDN_SHIFT(x))
271de9b1214SNicolin Chen #define CS53L30_MUTE_ASP_SDOUTx_PDN	(1 << CS53L30_MUTE_ASP_SDOUTx_PDN_SHIFT(x))
272de9b1214SNicolin Chen #define CS53L30_MUTE_ADC2B_PDN_SHIFT	3
273de9b1214SNicolin Chen #define CS53L30_MUTE_ADC2B_PDN_MASK	(1 << CS53L30_MUTE_ADC2B_PDN_SHIFT)
274de9b1214SNicolin Chen #define CS53L30_MUTE_ADC2B_PDN		(1 << CS53L30_MUTE_ADC2B_PDN_SHIFT)
275de9b1214SNicolin Chen #define CS53L30_MUTE_ADC2A_PDN_SHIFT	2
276de9b1214SNicolin Chen #define CS53L30_MUTE_ADC2A_PDN_MASK	(1 << CS53L30_MUTE_ADC2A_PDN_SHIFT)
277de9b1214SNicolin Chen #define CS53L30_MUTE_ADC2A_PDN		(1 << CS53L30_MUTE_ADC2A_PDN_SHIFT)
278de9b1214SNicolin Chen #define CS53L30_MUTE_ADC1B_PDN_SHIFT	1
279de9b1214SNicolin Chen #define CS53L30_MUTE_ADC1B_PDN_MASK	(1 << CS53L30_MUTE_ADC1B_PDN_SHIFT)
280de9b1214SNicolin Chen #define CS53L30_MUTE_ADC1B_PDN		(1 << CS53L30_MUTE_ADC1B_PDN_SHIFT)
281de9b1214SNicolin Chen #define CS53L30_MUTE_ADC1A_PDN_SHIFT	0
282de9b1214SNicolin Chen #define CS53L30_MUTE_ADC1A_PDN_MASK	(1 << CS53L30_MUTE_ADC1A_PDN_SHIFT)
283de9b1214SNicolin Chen #define CS53L30_MUTE_ADC1A_PDN		(1 << CS53L30_MUTE_ADC1A_PDN_SHIFT)
284de9b1214SNicolin Chen 
285de9b1214SNicolin Chen #define CS53L30_MUTEP_CTL2_DEFAULT	(CS53L30_MUTE_PIN_POLARITY)
286de9b1214SNicolin Chen 
287de9b1214SNicolin Chen /* R33 (0x21) CS53L30_INBIAS_CTL1 - Input Bias Control 1 */
288de9b1214SNicolin Chen #define CS53L30_IN4M_BIAS_SHIFT		6
289de9b1214SNicolin Chen #define CS53L30_IN4M_BIAS_WIDTH		2
290de9b1214SNicolin Chen #define CS53L30_IN4M_BIAS_MASK		(((1 << CS53L30_IN4M_BIAS_WIDTH) - 1) << CS53L30_IN4M_BIAS_SHIFT)
291de9b1214SNicolin Chen #define CS53L30_IN4M_BIAS_OPEN		(0 << CS53L30_IN4M_BIAS_SHIFT)
292de9b1214SNicolin Chen #define CS53L30_IN4M_BIAS_PULL_DOWN	(1 << CS53L30_IN4M_BIAS_SHIFT)
293de9b1214SNicolin Chen #define CS53L30_IN4M_BIAS_VCM		(2 << CS53L30_IN4M_BIAS_SHIFT)
294de9b1214SNicolin Chen #define CS53L30_IN4P_BIAS_SHIFT		4
295de9b1214SNicolin Chen #define CS53L30_IN4P_BIAS_WIDTH		2
296de9b1214SNicolin Chen #define CS53L30_IN4P_BIAS_MASK		(((1 << CS53L30_IN4P_BIAS_WIDTH) - 1) << CS53L30_IN4P_BIAS_SHIFT)
297de9b1214SNicolin Chen #define CS53L30_IN4P_BIAS_OPEN		(0 << CS53L30_IN4P_BIAS_SHIFT)
298de9b1214SNicolin Chen #define CS53L30_IN4P_BIAS_PULL_DOWN	(1 << CS53L30_IN4P_BIAS_SHIFT)
299de9b1214SNicolin Chen #define CS53L30_IN4P_BIAS_VCM		(2 << CS53L30_IN4P_BIAS_SHIFT)
300de9b1214SNicolin Chen #define CS53L30_IN3M_BIAS_SHIFT		2
301de9b1214SNicolin Chen #define CS53L30_IN3M_BIAS_WIDTH		2
302de9b1214SNicolin Chen #define CS53L30_IN3M_BIAS_MASK		(((1 << CS53L30_IN3M_BIAS_WIDTH) - 1) << CS53L30_IN4M_BIAS_SHIFT)
303de9b1214SNicolin Chen #define CS53L30_IN3M_BIAS_OPEN		(0 << CS53L30_IN3M_BIAS_SHIFT)
304de9b1214SNicolin Chen #define CS53L30_IN3M_BIAS_PULL_DOWN	(1 << CS53L30_IN3M_BIAS_SHIFT)
305de9b1214SNicolin Chen #define CS53L30_IN3M_BIAS_VCM		(2 << CS53L30_IN3M_BIAS_SHIFT)
306de9b1214SNicolin Chen #define CS53L30_IN3P_BIAS_SHIFT		0
307de9b1214SNicolin Chen #define CS53L30_IN3P_BIAS_WIDTH		2
308de9b1214SNicolin Chen #define CS53L30_IN3P_BIAS_MASK		(((1 << CS53L30_IN3P_BIAS_WIDTH) - 1) << CS53L30_IN3P_BIAS_SHIFT)
309de9b1214SNicolin Chen #define CS53L30_IN3P_BIAS_OPEN		(0 << CS53L30_IN3P_BIAS_SHIFT)
310de9b1214SNicolin Chen #define CS53L30_IN3P_BIAS_PULL_DOWN	(1 << CS53L30_IN3P_BIAS_SHIFT)
311de9b1214SNicolin Chen #define CS53L30_IN3P_BIAS_VCM		(2 << CS53L30_IN3P_BIAS_SHIFT)
312de9b1214SNicolin Chen 
313de9b1214SNicolin Chen #define CS53L30_INBIAS_CTL1_DEFAULT	(CS53L30_IN4M_BIAS_VCM | CS53L30_IN4P_BIAS_VCM |\
314de9b1214SNicolin Chen 					 CS53L30_IN3M_BIAS_VCM | CS53L30_IN3P_BIAS_VCM)
315de9b1214SNicolin Chen 
316de9b1214SNicolin Chen /* R34 (0x22) CS53L30_INBIAS_CTL2 - Input Bias Control 2 */
317de9b1214SNicolin Chen #define CS53L30_IN2M_BIAS_SHIFT		6
318de9b1214SNicolin Chen #define CS53L30_IN2M_BIAS_WIDTH		2
319de9b1214SNicolin Chen #define CS53L30_IN2M_BIAS_MASK		(((1 << CS53L30_IN2M_BIAS_WIDTH) - 1) << CS53L30_IN2M_BIAS_SHIFT)
320de9b1214SNicolin Chen #define CS53L30_IN2M_BIAS_OPEN		(0 << CS53L30_IN2M_BIAS_SHIFT)
321de9b1214SNicolin Chen #define CS53L30_IN2M_BIAS_PULL_DOWN	(1 << CS53L30_IN2M_BIAS_SHIFT)
322de9b1214SNicolin Chen #define CS53L30_IN2M_BIAS_VCM		(2 << CS53L30_IN2M_BIAS_SHIFT)
323de9b1214SNicolin Chen #define CS53L30_IN2P_BIAS_SHIFT		4
324de9b1214SNicolin Chen #define CS53L30_IN2P_BIAS_WIDTH		2
325de9b1214SNicolin Chen #define CS53L30_IN2P_BIAS_MASK		(((1 << CS53L30_IN2P_BIAS_WIDTH) - 1) << CS53L30_IN2P_BIAS_SHIFT)
326de9b1214SNicolin Chen #define CS53L30_IN2P_BIAS_OPEN		(0 << CS53L30_IN2P_BIAS_SHIFT)
327de9b1214SNicolin Chen #define CS53L30_IN2P_BIAS_PULL_DOWN	(1 << CS53L30_IN2P_BIAS_SHIFT)
328de9b1214SNicolin Chen #define CS53L30_IN2P_BIAS_VCM		(2 << CS53L30_IN2P_BIAS_SHIFT)
329de9b1214SNicolin Chen #define CS53L30_IN1M_BIAS_SHIFT		2
330de9b1214SNicolin Chen #define CS53L30_IN1M_BIAS_WIDTH		2
331de9b1214SNicolin Chen #define CS53L30_IN1M_BIAS_MASK		(((1 << CS53L30_IN1M_BIAS_WIDTH) - 1) << CS53L30_IN1M_BIAS_SHIFT)
332de9b1214SNicolin Chen #define CS53L30_IN1M_BIAS_OPEN		(0 << CS53L30_IN1M_BIAS_SHIFT)
333de9b1214SNicolin Chen #define CS53L30_IN1M_BIAS_PULL_DOWN	(1 << CS53L30_IN1M_BIAS_SHIFT)
334de9b1214SNicolin Chen #define CS53L30_IN1M_BIAS_VCM		(2 << CS53L30_IN1M_BIAS_SHIFT)
335de9b1214SNicolin Chen #define CS53L30_IN1P_BIAS_SHIFT		0
336de9b1214SNicolin Chen #define CS53L30_IN1P_BIAS_WIDTH		2
337de9b1214SNicolin Chen #define CS53L30_IN1P_BIAS_MASK		(((1 << CS53L30_IN1P_BIAS_WIDTH) - 1) << CS53L30_IN1P_BIAS_SHIFT)
338de9b1214SNicolin Chen #define CS53L30_IN1P_BIAS_OPEN		(0 << CS53L30_IN1P_BIAS_SHIFT)
339de9b1214SNicolin Chen #define CS53L30_IN1P_BIAS_PULL_DOWN	(1 << CS53L30_IN1P_BIAS_SHIFT)
340de9b1214SNicolin Chen #define CS53L30_IN1P_BIAS_VCM		(2 << CS53L30_IN1P_BIAS_SHIFT)
341de9b1214SNicolin Chen 
342de9b1214SNicolin Chen #define CS53L30_INBIAS_CTL2_DEFAULT	(CS53L30_IN2M_BIAS_VCM | CS53L30_IN2P_BIAS_VCM |\
343de9b1214SNicolin Chen 					 CS53L30_IN1M_BIAS_VCM | CS53L30_IN1P_BIAS_VCM)
344de9b1214SNicolin Chen 
345de9b1214SNicolin Chen /* R35 (0x23) & R36 (0x24) CS53L30_DMICx_STR_CTL - DMIC1 & DMIC2 Stereo Control */
346de9b1214SNicolin Chen #define CS53L30_DMICx_STEREO_ENB_SHIFT	5
347de9b1214SNicolin Chen #define CS53L30_DMICx_STEREO_ENB_MASK	(1 << CS53L30_DMICx_STEREO_ENB_SHIFT)
348de9b1214SNicolin Chen #define CS53L30_DMICx_STEREO_ENB	(1 << CS53L30_DMICx_STEREO_ENB_SHIFT)
349de9b1214SNicolin Chen 
350de9b1214SNicolin Chen /* 0x88 and 0xCC are reserved bits */
351de9b1214SNicolin Chen #define CS53L30_DMIC1_STR_CTL_DEFAULT	(CS53L30_DMICx_STEREO_ENB | 0x88)
352de9b1214SNicolin Chen #define CS53L30_DMIC2_STR_CTL_DEFAULT	(CS53L30_DMICx_STEREO_ENB | 0xCC)
353de9b1214SNicolin Chen 
354de9b1214SNicolin Chen /* R37/R45 (0x25/0x2D) CS53L30_ADCDMICx_CTL1 - ADC1/DMIC1 & ADC2/DMIC2 Control 1 */
355de9b1214SNicolin Chen #define CS53L30_ADCxB_PDN_SHIFT		7
356de9b1214SNicolin Chen #define CS53L30_ADCxB_PDN_MASK		(1 << CS53L30_ADCxB_PDN_SHIFT)
357de9b1214SNicolin Chen #define CS53L30_ADCxB_PDN		(1 << CS53L30_ADCxB_PDN_SHIFT)
358de9b1214SNicolin Chen #define CS53L30_ADCxA_PDN_SHIFT		6
359de9b1214SNicolin Chen #define CS53L30_ADCxA_PDN_MASK		(1 << CS53L30_ADCxA_PDN_SHIFT)
360de9b1214SNicolin Chen #define CS53L30_ADCxA_PDN		(1 << CS53L30_ADCxA_PDN_SHIFT)
361de9b1214SNicolin Chen #define CS53L30_DMICx_PDN_SHIFT		2
362de9b1214SNicolin Chen #define CS53L30_DMICx_PDN_MASK		(1 << CS53L30_DMICx_PDN_SHIFT)
363de9b1214SNicolin Chen #define CS53L30_DMICx_PDN		(1 << CS53L30_DMICx_PDN_SHIFT)
364de9b1214SNicolin Chen #define CS53L30_DMICx_SCLK_DIV_SHIFT	1
365de9b1214SNicolin Chen #define CS53L30_DMICx_SCLK_DIV_MASK	(1 << CS53L30_DMICx_SCLK_DIV_SHIFT)
366de9b1214SNicolin Chen #define CS53L30_DMICx_SCLK_DIV		(1 << CS53L30_DMICx_SCLK_DIV_SHIFT)
367de9b1214SNicolin Chen #define CS53L30_CH_TYPE_SHIFT		0
368de9b1214SNicolin Chen #define CS53L30_CH_TYPE_MASK		(1 << CS53L30_CH_TYPE_SHIFT)
369de9b1214SNicolin Chen #define CS53L30_CH_TYPE			(1 << CS53L30_CH_TYPE_SHIFT)
370de9b1214SNicolin Chen 
371de9b1214SNicolin Chen #define CS53L30_ADCDMICx_PDN_MASK	0xFF
372de9b1214SNicolin Chen #define CS53L30_ADCDMICx_CTL1_DEFAULT	(CS53L30_DMICx_PDN)
373de9b1214SNicolin Chen 
374de9b1214SNicolin Chen /* R38/R46 (0x26/0x2E) CS53L30_ADCDMICx_CTL2 - ADC1/DMIC1 & ADC2/DMIC2 Control 2 */
375de9b1214SNicolin Chen #define CS53L30_ADCx_NOTCH_DIS_SHIFT	7
376de9b1214SNicolin Chen #define CS53L30_ADCx_NOTCH_DIS_MASK	(1 << CS53L30_ADCx_NOTCH_DIS_SHIFT)
377de9b1214SNicolin Chen #define CS53L30_ADCx_NOTCH_DIS		(1 << CS53L30_ADCx_NOTCH_DIS_SHIFT)
378de9b1214SNicolin Chen #define CS53L30_ADCxB_INV_SHIFT		5
379de9b1214SNicolin Chen #define CS53L30_ADCxB_INV_MASK		(1 << CS53L30_ADCxB_INV_SHIFT)
380de9b1214SNicolin Chen #define CS53L30_ADCxB_INV		(1 << CS53L30_ADCxB_INV_SHIFT)
381de9b1214SNicolin Chen #define CS53L30_ADCxA_INV_SHIFT		4
382de9b1214SNicolin Chen #define CS53L30_ADCxA_INV_MASK		(1 << CS53L30_ADCxA_INV_SHIFT)
383de9b1214SNicolin Chen #define CS53L30_ADCxA_INV		(1 << CS53L30_ADCxA_INV_SHIFT)
384de9b1214SNicolin Chen #define CS53L30_ADCxB_DIG_BOOST_SHIFT	1
385de9b1214SNicolin Chen #define CS53L30_ADCxB_DIG_BOOST_MASK	(1 << CS53L30_ADCxB_DIG_BOOST_SHIFT)
386de9b1214SNicolin Chen #define CS53L30_ADCxB_DIG_BOOST		(1 << CS53L30_ADCxB_DIG_BOOST_SHIFT)
387de9b1214SNicolin Chen #define CS53L30_ADCxA_DIG_BOOST_SHIFT	0
388de9b1214SNicolin Chen #define CS53L30_ADCxA_DIG_BOOST_MASK	(1 << CS53L30_ADCxA_DIG_BOOST_SHIFT)
389de9b1214SNicolin Chen #define CS53L30_ADCxA_DIG_BOOST		(1 << CS53L30_ADCxA_DIG_BOOST_SHIFT)
390de9b1214SNicolin Chen 
391de9b1214SNicolin Chen #define CS53L30_ADCDMIC1_CTL2_DEFAULT	(0)
392de9b1214SNicolin Chen 
393de9b1214SNicolin Chen /* R39/R47 (0x27/0x2F) CS53L30_ADCx_CTL3 - ADC1/ADC2 Control 3 */
394de9b1214SNicolin Chen #define CS53L30_ADCx_HPF_EN_SHIFT	3
395de9b1214SNicolin Chen #define CS53L30_ADCx_HPF_EN_MASK	(1 << CS53L30_ADCx_HPF_EN_SHIFT)
396de9b1214SNicolin Chen #define CS53L30_ADCx_HPF_EN		(1 << CS53L30_ADCx_HPF_EN_SHIFT)
397de9b1214SNicolin Chen #define CS53L30_ADCx_HPF_CF_SHIFT	1
398de9b1214SNicolin Chen #define CS53L30_ADCx_HPF_CF_WIDTH	2
399de9b1214SNicolin Chen #define CS53L30_ADCx_HPF_CF_MASK	(((1 << CS53L30_ADCx_HPF_CF_WIDTH) - 1) << CS53L30_ADCx_HPF_CF_SHIFT)
400de9b1214SNicolin Chen #define CS53L30_ADCx_HPF_CF_1HZ86	(0 << CS53L30_ADCx_HPF_CF_SHIFT)
401de9b1214SNicolin Chen #define CS53L30_ADCx_HPF_CF_120HZ	(1 << CS53L30_ADCx_HPF_CF_SHIFT)
402de9b1214SNicolin Chen #define CS53L30_ADCx_HPF_CF_235HZ	(2 << CS53L30_ADCx_HPF_CF_SHIFT)
403de9b1214SNicolin Chen #define CS53L30_ADCx_HPF_CF_466HZ	(3 << CS53L30_ADCx_HPF_CF_SHIFT)
404de9b1214SNicolin Chen #define CS53L30_ADCx_NG_ALL_SHIFT	0
405de9b1214SNicolin Chen #define CS53L30_ADCx_NG_ALL_MASK	(1 << CS53L30_ADCx_NG_ALL_SHIFT)
406de9b1214SNicolin Chen #define CS53L30_ADCx_NG_ALL		(1 << CS53L30_ADCx_NG_ALL_SHIFT)
407de9b1214SNicolin Chen 
408de9b1214SNicolin Chen #define CS53L30_ADCx_CTL3_DEFAULT	(CS53L30_ADCx_HPF_EN)
409de9b1214SNicolin Chen 
410de9b1214SNicolin Chen /* R40/R48 (0x28/0x30) CS53L30_ADCx_NG_CTL - ADC1/ADC2 Noise Gate Control */
411de9b1214SNicolin Chen #define CS53L30_ADCxB_NG_SHIFT		7
412de9b1214SNicolin Chen #define CS53L30_ADCxB_NG_MASK		(1 << CS53L30_ADCxB_NG_SHIFT)
413de9b1214SNicolin Chen #define CS53L30_ADCxB_NG		(1 << CS53L30_ADCxB_NG_SHIFT)
414de9b1214SNicolin Chen #define CS53L30_ADCxA_NG_SHIFT		6
415de9b1214SNicolin Chen #define CS53L30_ADCxA_NG_MASK		(1 << CS53L30_ADCxA_NG_SHIFT)
416de9b1214SNicolin Chen #define CS53L30_ADCxA_NG		(1 << CS53L30_ADCxA_NG_SHIFT)
417de9b1214SNicolin Chen #define CS53L30_ADCx_NG_BOOST_SHIFT	5
418de9b1214SNicolin Chen #define CS53L30_ADCx_NG_BOOST_MASK	(1 << CS53L30_ADCx_NG_BOOST_SHIFT)
419de9b1214SNicolin Chen #define CS53L30_ADCx_NG_BOOST		(1 << CS53L30_ADCx_NG_BOOST_SHIFT)
420de9b1214SNicolin Chen #define CS53L30_ADCx_NG_THRESH_SHIFT	2
421de9b1214SNicolin Chen #define CS53L30_ADCx_NG_THRESH_WIDTH	3
422de9b1214SNicolin Chen #define CS53L30_ADCx_NG_THRESH_MASK	(((1 << CS53L30_ADCx_NG_THRESH_WIDTH) - 1) << CS53L30_ADCx_NG_THRESH_SHIFT)
423de9b1214SNicolin Chen #define CS53L30_ADCx_NG_DELAY_SHIFT	0
424de9b1214SNicolin Chen #define CS53L30_ADCx_NG_DELAY_WIDTH	2
425de9b1214SNicolin Chen #define CS53L30_ADCx_NG_DELAY_MASK	(((1 << CS53L30_ADCx_NG_DELAY_WIDTH) - 1) << CS53L30_ADCx_NG_DELAY_SHIFT)
426de9b1214SNicolin Chen 
427de9b1214SNicolin Chen #define CS53L30_ADCx_NG_CTL_DEFAULT	(0)
428de9b1214SNicolin Chen 
429de9b1214SNicolin Chen /* R41/R42/R49/R50 (0x29/0x2A/0x31/0x32) CS53L30_ADCxy_AFE_CTL - ADC1A/1B/2A/2B AFE Control */
430de9b1214SNicolin Chen #define CS53L30_ADCxy_PREAMP_SHIFT	6
431de9b1214SNicolin Chen #define CS53L30_ADCxy_PREAMP_WIDTH	2
432de9b1214SNicolin Chen #define CS53L30_ADCxy_PREAMP_MASK	(((1 << CS53L30_ADCxy_PREAMP_WIDTH) - 1) << CS53L30_ADCxy_PREAMP_SHIFT)
433de9b1214SNicolin Chen #define CS53L30_ADCxy_PGA_VOL_SHIFT	0
434de9b1214SNicolin Chen #define CS53L30_ADCxy_PGA_VOL_WIDTH	6
435de9b1214SNicolin Chen #define CS53L30_ADCxy_PGA_VOL_MASK	(((1 << CS53L30_ADCxy_PGA_VOL_WIDTH) - 1) << CS53L30_ADCxy_PGA_VOL_SHIFT)
436de9b1214SNicolin Chen 
437de9b1214SNicolin Chen #define CS53L30_ADCxy_AFE_CTL_DEFAULT	(0)
438de9b1214SNicolin Chen 
439de9b1214SNicolin Chen /* R43/R44/R51/R52 (0x2B/0x2C/0x33/0x34) CS53L30_ADCxy_DIG_VOL - ADC1A/1B/2A/2B Digital Volume */
440de9b1214SNicolin Chen #define CS53L30_ADCxy_VOL_MUTE		(0x80)
441de9b1214SNicolin Chen 
442de9b1214SNicolin Chen #define CS53L30_ADCxy_DIG_VOL_DEFAULT	(0x0)
443de9b1214SNicolin Chen 
444de9b1214SNicolin Chen /* CS53L30_INT */
445de9b1214SNicolin Chen #define CS53L30_PDN_DONE		(1 << 7)
446de9b1214SNicolin Chen #define CS53L30_THMS_TRIP		(1 << 6)
447de9b1214SNicolin Chen #define CS53L30_SYNC_DONE		(1 << 5)
448de9b1214SNicolin Chen #define CS53L30_ADC2B_OVFL		(1 << 4)
449de9b1214SNicolin Chen #define CS53L30_ADC2A_OVFL		(1 << 3)
450de9b1214SNicolin Chen #define CS53L30_ADC1B_OVFL		(1 << 2)
451de9b1214SNicolin Chen #define CS53L30_ADC1A_OVFL		(1 << 1)
452de9b1214SNicolin Chen #define CS53L30_MUTE_PIN		(1 << 0)
453de9b1214SNicolin Chen #define CS53L30_DEVICE_INT_MASK		0xFF
454de9b1214SNicolin Chen 
455de9b1214SNicolin Chen #endif	/* __CS53L30_H__ */
456