xref: /linux/sound/soc/codecs/wcd939x.h (revision be2af391cea018eaea61f929eaef9394c78faaf2)
1*be2af391SNeil Armstrong /* SPDX-License-Identifier: GPL-2.0-only */
2*be2af391SNeil Armstrong /*
3*be2af391SNeil Armstrong  * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
4*be2af391SNeil Armstrong  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
5*be2af391SNeil Armstrong  */
6*be2af391SNeil Armstrong 
7*be2af391SNeil Armstrong #ifndef __WCD939X_H__
8*be2af391SNeil Armstrong #define __WCD939X_H__
9*be2af391SNeil Armstrong #include <linux/soundwire/sdw.h>
10*be2af391SNeil Armstrong #include <linux/soundwire/sdw_type.h>
11*be2af391SNeil Armstrong 
12*be2af391SNeil Armstrong #define WCD939X_BASE					   (0x3000)
13*be2af391SNeil Armstrong #define WCD939X_ANA_PAGE				   (0x3000)
14*be2af391SNeil Armstrong #define WCD939X_ANA_BIAS				   (0x3001)
15*be2af391SNeil Armstrong #define WCD939X_BIAS_ANALOG_BIAS_EN	BIT(7)
16*be2af391SNeil Armstrong #define WCD939X_BIAS_PRECHRG_EN	BIT(6)
17*be2af391SNeil Armstrong #define WCD939X_BIAS_PRECHRG_CTL_MODE	BIT(5)
18*be2af391SNeil Armstrong #define WCD939X_ANA_RX_SUPPLIES				   (0x3008)
19*be2af391SNeil Armstrong #define WCD939X_RX_SUPPLIES_VPOS_EN	BIT(7)
20*be2af391SNeil Armstrong #define WCD939X_RX_SUPPLIES_VNEG_EN	BIT(6)
21*be2af391SNeil Armstrong #define WCD939X_RX_SUPPLIES_VPOS_PWR_LVL	BIT(3)
22*be2af391SNeil Armstrong #define WCD939X_RX_SUPPLIES_VNEG_PWR_LVL	BIT(2)
23*be2af391SNeil Armstrong #define WCD939X_RX_SUPPLIES_REGULATOR_MODE	BIT(1)
24*be2af391SNeil Armstrong #define WCD939X_RX_SUPPLIES_RX_BIAS_ENABLE	BIT(0)
25*be2af391SNeil Armstrong #define WCD939X_ANA_HPH					   (0x3009)
26*be2af391SNeil Armstrong #define WCD939X_HPH_HPHL_ENABLE	BIT(7)
27*be2af391SNeil Armstrong #define WCD939X_HPH_HPHR_ENABLE	BIT(6)
28*be2af391SNeil Armstrong #define WCD939X_HPH_HPHL_REF_ENABLE	BIT(5)
29*be2af391SNeil Armstrong #define WCD939X_HPH_HPHR_REF_ENABLE	BIT(4)
30*be2af391SNeil Armstrong #define WCD939X_HPH_PWR_LEVEL	GENMASK(3, 2)
31*be2af391SNeil Armstrong #define WCD939X_ANA_EAR					   (0x300a)
32*be2af391SNeil Armstrong #define WCD939X_ANA_EAR_COMPANDER_CTL			   (0x300b)
33*be2af391SNeil Armstrong #define WCD939X_EAR_COMPANDER_CTL_GAIN_OVRD_REG	BIT(7)
34*be2af391SNeil Armstrong #define WCD939X_EAR_COMPANDER_CTL_EAR_GAIN	GENMASK(6, 2)
35*be2af391SNeil Armstrong #define WCD939X_EAR_COMPANDER_CTL_COMP_DFF_BYP	BIT(1)
36*be2af391SNeil Armstrong #define WCD939X_EAR_COMPANDER_CTL_COMP_DFF_CLK_EDGE	BIT(0)
37*be2af391SNeil Armstrong #define WCD939X_ANA_TX_CH1				   (0x300e)
38*be2af391SNeil Armstrong #define WCD939X_ANA_TX_CH2				   (0x300f)
39*be2af391SNeil Armstrong #define WCD939X_TX_CH2_ENABLE	BIT(7)
40*be2af391SNeil Armstrong #define WCD939X_TX_CH2_HPF1_INIT	BIT(6)
41*be2af391SNeil Armstrong #define WCD939X_TX_CH2_HPF2_INIT	BIT(5)
42*be2af391SNeil Armstrong #define WCD939X_TX_CH2_GAIN	GENMASK(4, 0)
43*be2af391SNeil Armstrong #define WCD939X_ANA_TX_CH3				   (0x3010)
44*be2af391SNeil Armstrong #define WCD939X_ANA_TX_CH4				   (0x3011)
45*be2af391SNeil Armstrong #define WCD939X_TX_CH4_ENABLE	BIT(7)
46*be2af391SNeil Armstrong #define WCD939X_TX_CH4_HPF3_INIT	BIT(6)
47*be2af391SNeil Armstrong #define WCD939X_TX_CH4_HPF4_INIT	BIT(5)
48*be2af391SNeil Armstrong #define WCD939X_TX_CH4_GAIN	GENMASK(4, 0)
49*be2af391SNeil Armstrong #define WCD939X_ANA_MICB1_MICB2_DSP_EN_LOGIC		   (0x3012)
50*be2af391SNeil Armstrong #define WCD939X_ANA_MICB3_DSP_EN_LOGIC			   (0x3013)
51*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_MECH				   (0x3014)
52*be2af391SNeil Armstrong #define WCD939X_MBHC_MECH_L_DET_EN	BIT(7)
53*be2af391SNeil Armstrong #define WCD939X_MBHC_MECH_GND_DET_EN	BIT(6)
54*be2af391SNeil Armstrong #define WCD939X_MBHC_MECH_MECH_DETECT_TYPE	BIT(5)
55*be2af391SNeil Armstrong #define WCD939X_MBHC_MECH_HPHL_PLUG_TYPE	BIT(4)
56*be2af391SNeil Armstrong #define WCD939X_MBHC_MECH_GND_PLUG_TYPE	BIT(3)
57*be2af391SNeil Armstrong #define WCD939X_MBHC_MECH_MECH_HS_L_PULLUP_COMP_EN	BIT(2)
58*be2af391SNeil Armstrong #define WCD939X_MBHC_MECH_MECH_HS_G_PULLUP_COMP_EN	BIT(1)
59*be2af391SNeil Armstrong #define WCD939X_MBHC_MECH_SW_HPH_L_P_100K_TO_GND	BIT(0)
60*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_ELECT				   (0x3015)
61*be2af391SNeil Armstrong #define WCD939X_MBHC_ELECT_FSM_EN	BIT(7)
62*be2af391SNeil Armstrong #define WCD939X_MBHC_ELECT_BTNDET_ISRC_CTL	GENMASK(6, 4)
63*be2af391SNeil Armstrong #define WCD939X_MBHC_ELECT_ELECT_DET_TYPE	BIT(3)
64*be2af391SNeil Armstrong #define WCD939X_MBHC_ELECT_ELECT_SCHMT_ISRC_CTL	GENMASK(2, 1)
65*be2af391SNeil Armstrong #define WCD939X_MBHC_ELECT_BIAS_EN	BIT(0)
66*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_ZDET				   (0x3016)
67*be2af391SNeil Armstrong #define WCD939X_MBHC_ZDET_ZDET_L_MEAS_EN	BIT(7)
68*be2af391SNeil Armstrong #define WCD939X_MBHC_ZDET_ZDET_R_MEAS_EN	BIT(6)
69*be2af391SNeil Armstrong #define WCD939X_MBHC_ZDET_ZDET_CHG_EN	BIT(5)
70*be2af391SNeil Armstrong #define WCD939X_MBHC_ZDET_ZDET_ILEAK_COMP_EN	BIT(4)
71*be2af391SNeil Armstrong #define WCD939X_MBHC_ZDET_ELECT_ISRC_EN	BIT(1)
72*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_RESULT_1			   (0x3017)
73*be2af391SNeil Armstrong #define WCD939X_MBHC_RESULT_1_Z_RESULT_LSB	GENMASK(7, 0)
74*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_RESULT_2			   (0x3018)
75*be2af391SNeil Armstrong #define WCD939X_MBHC_RESULT_2_Z_RESULT_MSB	GENMASK(7, 0)
76*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_RESULT_3			   (0x3019)
77*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_BTN0				   (0x301a)
78*be2af391SNeil Armstrong #define WCD939X_MBHC_BTN0_VTH	GENMASK(7, 2)
79*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_BTN1				   (0x301b)
80*be2af391SNeil Armstrong #define WCD939X_MBHC_BTN1_VTH	GENMASK(7, 2)
81*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_BTN2				   (0x301c)
82*be2af391SNeil Armstrong #define WCD939X_MBHC_BTN2_VTH	GENMASK(7, 2)
83*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_BTN3				   (0x301d)
84*be2af391SNeil Armstrong #define WCD939X_MBHC_BTN3_VTH	GENMASK(7, 2)
85*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_BTN4				   (0x301e)
86*be2af391SNeil Armstrong #define WCD939X_MBHC_BTN4_VTH	GENMASK(7, 2)
87*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_BTN5				   (0x301f)
88*be2af391SNeil Armstrong #define WCD939X_MBHC_BTN5_VTH	GENMASK(7, 2)
89*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_BTN6				   (0x3020)
90*be2af391SNeil Armstrong #define WCD939X_MBHC_BTN6_VTH	GENMASK(7, 2)
91*be2af391SNeil Armstrong #define WCD939X_ANA_MBHC_BTN7				   (0x3021)
92*be2af391SNeil Armstrong #define WCD939X_MBHC_BTN7_VTH	GENMASK(7, 2)
93*be2af391SNeil Armstrong #define WCD939X_ANA_MICB1				   (0x3022)
94*be2af391SNeil Armstrong #define WCD939X_MICB1_ENABLE	GENMASK(7, 6)
95*be2af391SNeil Armstrong #define WCD939X_MICB1_VOUT_CTL	GENMASK(5, 0)
96*be2af391SNeil Armstrong #define WCD939X_ANA_MICB2				   (0x3023)
97*be2af391SNeil Armstrong #define WCD939X_MICB2_ENABLE	GENMASK(7, 6)
98*be2af391SNeil Armstrong #define WCD939X_MICB2_VOUT_CTL	GENMASK(5, 0)
99*be2af391SNeil Armstrong #define WCD939X_ANA_MICB2_RAMP				   (0x3024)
100*be2af391SNeil Armstrong #define WCD939X_MICB2_RAMP_RAMP_ENABLE	BIT(7)
101*be2af391SNeil Armstrong #define WCD939X_MICB2_RAMP_MB2_IN2P_SHORT_ENABLE	BIT(6)
102*be2af391SNeil Armstrong #define WCD939X_MICB2_RAMP_ALLSW_OVRD_ENABLE	BIT(5)
103*be2af391SNeil Armstrong #define WCD939X_MICB2_RAMP_SHIFT_CTL	GENMASK(4, 2)
104*be2af391SNeil Armstrong #define WCD939X_MICB2_RAMP_USB_MGDET_MICB2_RAMP	GENMASK(1, 0)
105*be2af391SNeil Armstrong #define WCD939X_ANA_MICB3				   (0x3025)
106*be2af391SNeil Armstrong #define WCD939X_MICB3_ENABLE	GENMASK(7, 6)
107*be2af391SNeil Armstrong #define WCD939X_MICB3_VOUT_CTL	GENMASK(5, 0)
108*be2af391SNeil Armstrong #define WCD939X_ANA_MICB4				   (0x3026)
109*be2af391SNeil Armstrong #define WCD939X_MICB4_ENABLE	GENMASK(7, 6)
110*be2af391SNeil Armstrong #define WCD939X_MICB4_VOUT_CTL	GENMASK(5, 0)
111*be2af391SNeil Armstrong #define WCD939X_BIAS_CTL				   (0x3028)
112*be2af391SNeil Armstrong #define WCD939X_BIAS_VBG_FINE_ADJ			   (0x3029)
113*be2af391SNeil Armstrong #define WCD939X_LDOL_VDDCX_ADJUST			   (0x3040)
114*be2af391SNeil Armstrong #define WCD939X_LDOL_DISABLE_LDOL			   (0x3041)
115*be2af391SNeil Armstrong #define WCD939X_MBHC_CTL_CLK				   (0x3056)
116*be2af391SNeil Armstrong #define WCD939X_MBHC_CTL_ANA				   (0x3057)
117*be2af391SNeil Armstrong #define WCD939X_MBHC_ZDET_VNEG_CTL			   (0x3058)
118*be2af391SNeil Armstrong #define WCD939X_MBHC_ZDET_BIAS_CTL			   (0x3059)
119*be2af391SNeil Armstrong #define WCD939X_MBHC_CTL_BCS				   (0x305a)
120*be2af391SNeil Armstrong #define WCD939X_MBHC_MOISTURE_DET_FSM_STATUS		   (0x305b)
121*be2af391SNeil Armstrong #define WCD939X_MBHC_TEST_CTL				   (0x305c)
122*be2af391SNeil Armstrong #define WCD939X_LDOH_MODE				   (0x3067)
123*be2af391SNeil Armstrong #define WCD939X_MODE_LDOH_EN	BIT(7)
124*be2af391SNeil Armstrong #define WCD939X_MODE_PWRDN_STATE	BIT(6)
125*be2af391SNeil Armstrong #define WCD939X_MODE_SLOWRAMP_EN	BIT(5)
126*be2af391SNeil Armstrong #define WCD939X_MODE_VOUT_ADJUST	GENMASK(4, 3)
127*be2af391SNeil Armstrong #define WCD939X_MODE_VOUT_COARSE_ADJ	GENMASK(2, 0)
128*be2af391SNeil Armstrong #define WCD939X_LDOH_BIAS				   (0x3068)
129*be2af391SNeil Armstrong #define WCD939X_LDOH_STB_LOADS				   (0x3069)
130*be2af391SNeil Armstrong #define WCD939X_LDOH_SLOWRAMP				   (0x306a)
131*be2af391SNeil Armstrong #define WCD939X_MICB1_TEST_CTL_1			   (0x306b)
132*be2af391SNeil Armstrong #define WCD939X_TEST_CTL_1_NOISE_FILT_RES_VAL	GENMASK(7, 5)
133*be2af391SNeil Armstrong #define WCD939X_TEST_CTL_1_EN_VREFGEN	BIT(4)
134*be2af391SNeil Armstrong #define WCD939X_TEST_CTL_1_EN_LDO	BIT(3)
135*be2af391SNeil Armstrong #define WCD939X_TEST_CTL_1_LDO_BLEEDER_I_CTRL	GENMASK(2, 0)
136*be2af391SNeil Armstrong #define WCD939X_MICB1_TEST_CTL_2			   (0x306c)
137*be2af391SNeil Armstrong #define WCD939X_TEST_CTL_2_IBIAS_VREFGEN	GENMASK(7, 6)
138*be2af391SNeil Armstrong #define WCD939X_TEST_CTL_2_INRUSH_CURRENT_FIX_DIS	BIT(5)
139*be2af391SNeil Armstrong #define WCD939X_TEST_CTL_2_IBIAS_LDO_DRIVER	GENMASK(2, 0)
140*be2af391SNeil Armstrong #define WCD939X_MICB1_TEST_CTL_3			   (0x306d)
141*be2af391SNeil Armstrong #define WCD939X_TEST_CTL_3_CFILT_REF_EN	BIT(7)
142*be2af391SNeil Armstrong #define WCD939X_TEST_CTL_3_RZ_LDO_VAL	GENMASK(6, 4)
143*be2af391SNeil Armstrong #define WCD939X_TEST_CTL_3_IBIAS_LDO_STG3	GENMASK(3, 2)
144*be2af391SNeil Armstrong #define WCD939X_TEST_CTL_3_ATEST_CTRL	GENMASK(1, 0)
145*be2af391SNeil Armstrong #define WCD939X_MICB2_TEST_CTL_1			   (0x306e)
146*be2af391SNeil Armstrong #define WCD939X_MICB2_TEST_CTL_2			   (0x306f)
147*be2af391SNeil Armstrong #define WCD939X_MICB2_TEST_CTL_3			   (0x3070)
148*be2af391SNeil Armstrong #define WCD939X_MICB3_TEST_CTL_1			   (0x3071)
149*be2af391SNeil Armstrong #define WCD939X_MICB3_TEST_CTL_2			   (0x3072)
150*be2af391SNeil Armstrong #define WCD939X_MICB3_TEST_CTL_3			   (0x3073)
151*be2af391SNeil Armstrong #define WCD939X_MICB4_TEST_CTL_1			   (0x3074)
152*be2af391SNeil Armstrong #define WCD939X_MICB4_TEST_CTL_2			   (0x3075)
153*be2af391SNeil Armstrong #define WCD939X_MICB4_TEST_CTL_3			   (0x3076)
154*be2af391SNeil Armstrong #define WCD939X_TX_COM_ADC_VCM				   (0x3077)
155*be2af391SNeil Armstrong #define WCD939X_TX_COM_BIAS_ATEST			   (0x3078)
156*be2af391SNeil Armstrong #define WCD939X_TX_COM_SPARE1				   (0x3079)
157*be2af391SNeil Armstrong #define WCD939X_TX_COM_SPARE2				   (0x307a)
158*be2af391SNeil Armstrong #define WCD939X_TX_COM_TXFE_DIV_CTL			   (0x307b)
159*be2af391SNeil Armstrong #define WCD939X_TX_COM_TXFE_DIV_START			   (0x307c)
160*be2af391SNeil Armstrong #define WCD939X_TX_COM_SPARE3				   (0x307d)
161*be2af391SNeil Armstrong #define WCD939X_TX_COM_SPARE4				   (0x307e)
162*be2af391SNeil Armstrong #define WCD939X_TX_1_2_TEST_EN				   (0x307f)
163*be2af391SNeil Armstrong #define WCD939X_TX_1_2_ADC_IB				   (0x3080)
164*be2af391SNeil Armstrong #define WCD939X_TX_1_2_ATEST_REFCTL			   (0x3081)
165*be2af391SNeil Armstrong #define WCD939X_TX_1_2_TEST_CTL				   (0x3082)
166*be2af391SNeil Armstrong #define WCD939X_TX_1_2_TEST_BLK_EN1			   (0x3083)
167*be2af391SNeil Armstrong #define WCD939X_TX_1_2_TXFE1_CLKDIV			   (0x3084)
168*be2af391SNeil Armstrong #define WCD939X_TX_1_2_SAR2_ERR				   (0x3085)
169*be2af391SNeil Armstrong #define WCD939X_TX_1_2_SAR1_ERR				   (0x3086)
170*be2af391SNeil Armstrong #define WCD939X_TX_3_4_TEST_EN				   (0x3087)
171*be2af391SNeil Armstrong #define WCD939X_TX_3_4_ADC_IB				   (0x3088)
172*be2af391SNeil Armstrong #define WCD939X_TX_3_4_ATEST_REFCTL			   (0x3089)
173*be2af391SNeil Armstrong #define WCD939X_TX_3_4_TEST_CTL				   (0x308a)
174*be2af391SNeil Armstrong #define WCD939X_TX_3_4_TEST_BLK_EN3			   (0x308b)
175*be2af391SNeil Armstrong #define WCD939X_TX_3_4_TXFE3_CLKDIV			   (0x308c)
176*be2af391SNeil Armstrong #define WCD939X_TX_3_4_SAR4_ERR				   (0x308d)
177*be2af391SNeil Armstrong #define WCD939X_TX_3_4_SAR3_ERR				   (0x308e)
178*be2af391SNeil Armstrong #define WCD939X_TX_3_4_TEST_BLK_EN2			   (0x308f)
179*be2af391SNeil Armstrong #define WCD939X_TEST_BLK_EN2_ADC2_INT1_EN	BIT(7)
180*be2af391SNeil Armstrong #define WCD939X_TEST_BLK_EN2_ADC2_INT2_EN	BIT(6)
181*be2af391SNeil Armstrong #define WCD939X_TEST_BLK_EN2_ADC2_SAR_EN	BIT(5)
182*be2af391SNeil Armstrong #define WCD939X_TEST_BLK_EN2_ADC2_CMGEN_EN	BIT(4)
183*be2af391SNeil Armstrong #define WCD939X_TEST_BLK_EN2_ADC2_CLKGEN_EN	BIT(3)
184*be2af391SNeil Armstrong #define WCD939X_TEST_BLK_EN2_ADC12_VREF_NONL2	GENMASK(2, 1)
185*be2af391SNeil Armstrong #define WCD939X_TEST_BLK_EN2_TXFE2_MBHC_CLKRST_EN	BIT(0)
186*be2af391SNeil Armstrong #define WCD939X_TX_3_4_TXFE2_CLKDIV			   (0x3090)
187*be2af391SNeil Armstrong #define WCD939X_TX_3_4_SPARE1				   (0x3091)
188*be2af391SNeil Armstrong #define WCD939X_TX_3_4_TEST_BLK_EN4			   (0x3092)
189*be2af391SNeil Armstrong #define WCD939X_TX_3_4_TXFE4_CLKDIV			   (0x3093)
190*be2af391SNeil Armstrong #define WCD939X_TX_3_4_SPARE2				   (0x3094)
191*be2af391SNeil Armstrong #define WCD939X_CLASSH_MODE_1				   (0x3097)
192*be2af391SNeil Armstrong #define WCD939X_CLASSH_MODE_2				   (0x3098)
193*be2af391SNeil Armstrong #define WCD939X_CLASSH_MODE_3				   (0x3099)
194*be2af391SNeil Armstrong #define WCD939X_CLASSH_CTRL_VCL_1			   (0x309a)
195*be2af391SNeil Armstrong #define WCD939X_CLASSH_CTRL_VCL_2			   (0x309b)
196*be2af391SNeil Armstrong #define WCD939X_CLASSH_CTRL_CCL_1			   (0x309c)
197*be2af391SNeil Armstrong #define WCD939X_CLASSH_CTRL_CCL_2			   (0x309d)
198*be2af391SNeil Armstrong #define WCD939X_CLASSH_CTRL_CCL_3			   (0x309e)
199*be2af391SNeil Armstrong #define WCD939X_CLASSH_CTRL_CCL_4			   (0x309f)
200*be2af391SNeil Armstrong #define WCD939X_CLASSH_CTRL_CCL_5			   (0x30a0)
201*be2af391SNeil Armstrong #define WCD939X_CLASSH_BUCK_TMUX_A_D			   (0x30a1)
202*be2af391SNeil Armstrong #define WCD939X_CLASSH_BUCK_SW_DRV_CNTL			   (0x30a2)
203*be2af391SNeil Armstrong #define WCD939X_CLASSH_SPARE				   (0x30a3)
204*be2af391SNeil Armstrong #define WCD939X_FLYBACK_EN				   (0x30a4)
205*be2af391SNeil Armstrong #define WCD939X_FLYBACK_VNEG_CTRL_1			   (0x30a5)
206*be2af391SNeil Armstrong #define WCD939X_FLYBACK_VNEG_CTRL_2			   (0x30a6)
207*be2af391SNeil Armstrong #define WCD939X_FLYBACK_VNEG_CTRL_3			   (0x30a7)
208*be2af391SNeil Armstrong #define WCD939X_FLYBACK_VNEG_CTRL_4			   (0x30a8)
209*be2af391SNeil Armstrong #define WCD939X_VNEG_CTRL_4_ILIM_SEL	GENMASK(7, 4)
210*be2af391SNeil Armstrong #define WCD939X_VNEG_CTRL_4_PW_BUF_POS	GENMASK(3, 2)
211*be2af391SNeil Armstrong #define WCD939X_VNEG_CTRL_4_PW_BUF_NEG	GENMASK(1, 0)
212*be2af391SNeil Armstrong #define WCD939X_FLYBACK_VNEG_CTRL_5			   (0x30a9)
213*be2af391SNeil Armstrong #define WCD939X_FLYBACK_VNEG_CTRL_6			   (0x30aa)
214*be2af391SNeil Armstrong #define WCD939X_FLYBACK_VNEG_CTRL_7			   (0x30ab)
215*be2af391SNeil Armstrong #define WCD939X_FLYBACK_VNEG_CTRL_8			   (0x30ac)
216*be2af391SNeil Armstrong #define WCD939X_FLYBACK_VNEG_CTRL_9			   (0x30ad)
217*be2af391SNeil Armstrong #define WCD939X_FLYBACK_VNEGDAC_CTRL_1			   (0x30ae)
218*be2af391SNeil Armstrong #define WCD939X_FLYBACK_VNEGDAC_CTRL_2			   (0x30af)
219*be2af391SNeil Armstrong #define WCD939X_FLYBACK_VNEGDAC_CTRL_3			   (0x30b0)
220*be2af391SNeil Armstrong #define WCD939X_FLYBACK_CTRL_1				   (0x30b1)
221*be2af391SNeil Armstrong #define WCD939X_FLYBACK_TEST_CTL			   (0x30b2)
222*be2af391SNeil Armstrong #define WCD939X_RX_AUX_SW_CTL				   (0x30b3)
223*be2af391SNeil Armstrong #define WCD939X_RX_PA_AUX_IN_CONN			   (0x30b4)
224*be2af391SNeil Armstrong #define WCD939X_RX_TIMER_DIV				   (0x30b5)
225*be2af391SNeil Armstrong #define WCD939X_RX_OCP_CTL				   (0x30b6)
226*be2af391SNeil Armstrong #define WCD939X_RX_OCP_COUNT				   (0x30b7)
227*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_EAR_DAC				   (0x30b8)
228*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_EAR_AMP				   (0x30b9)
229*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_HPH_LDO				   (0x30ba)
230*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_HPH_PA				   (0x30bb)
231*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_HPH_RDACBUFF_CNP2		   (0x30bc)
232*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_HPH_RDAC_LDO			   (0x30bd)
233*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_HPH_CNP1			   (0x30be)
234*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_HPH_LOWPOWER			   (0x30bf)
235*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_AUX_DAC				   (0x30c0)
236*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_AUX_AMP				   (0x30c1)
237*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_VNEGDAC_BLEEDER			   (0x30c2)
238*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_MISC				   (0x30c3)
239*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_BUCK_RST			   (0x30c4)
240*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_BUCK_VREF_ERRAMP		   (0x30c5)
241*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_FLYB_ERRAMP			   (0x30c6)
242*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_FLYB_BUFF			   (0x30c7)
243*be2af391SNeil Armstrong #define WCD939X_RX_BIAS_FLYB_MID_RST			   (0x30c8)
244*be2af391SNeil Armstrong #define WCD939X_HPH_L_STATUS				   (0x30c9)
245*be2af391SNeil Armstrong #define WCD939X_HPH_R_STATUS				   (0x30ca)
246*be2af391SNeil Armstrong #define WCD939X_HPH_CNP_EN				   (0x30cb)
247*be2af391SNeil Armstrong #define WCD939X_HPH_CNP_WG_CTL				   (0x30cc)
248*be2af391SNeil Armstrong #define WCD939X_HPH_CNP_WG_TIME				   (0x30cd)
249*be2af391SNeil Armstrong #define WCD939X_HPH_OCP_CTL				   (0x30ce)
250*be2af391SNeil Armstrong #define WCD939X_OCP_CTL_OCP_CURR_LIMIT	GENMASK(7, 5)
251*be2af391SNeil Armstrong #define WCD939X_OCP_CTL_OCP_FSM_EN	BIT(4)
252*be2af391SNeil Armstrong #define WCD939X_OCP_CTL_SPARE_BITS	BIT(3)
253*be2af391SNeil Armstrong #define WCD939X_OCP_CTL_SCD_OP_EN	BIT(1)
254*be2af391SNeil Armstrong #define WCD939X_HPH_AUTO_CHOP				   (0x30cf)
255*be2af391SNeil Armstrong #define WCD939X_HPH_CHOP_CTL				   (0x30d0)
256*be2af391SNeil Armstrong #define WCD939X_HPH_PA_CTL1				   (0x30d1)
257*be2af391SNeil Armstrong #define WCD939X_HPH_PA_CTL2				   (0x30d2)
258*be2af391SNeil Armstrong #define WCD939X_PA_CTL2_HPHPA_GND_R	BIT(6)
259*be2af391SNeil Armstrong #define WCD939X_PA_CTL2_HPHPA_GND_L	BIT(4)
260*be2af391SNeil Armstrong #define WCD939X_PA_CTL2_GM3_CASCODE_CTL_NORMAL	GENMASK(1, 0)
261*be2af391SNeil Armstrong #define WCD939X_HPH_L_EN				   (0x30d3)
262*be2af391SNeil Armstrong #define WCD939X_L_EN_CONST_SEL_L	GENMASK(7, 6)
263*be2af391SNeil Armstrong #define WCD939X_L_EN_GAIN_SOURCE_SEL	BIT(5)
264*be2af391SNeil Armstrong #define WCD939X_L_EN_SPARE_BITS	GENMASK(4, 0)
265*be2af391SNeil Armstrong #define WCD939X_HPH_L_TEST				   (0x30d4)
266*be2af391SNeil Armstrong #define WCD939X_HPH_L_ATEST				   (0x30d5)
267*be2af391SNeil Armstrong #define WCD939X_HPH_R_EN				   (0x30d6)
268*be2af391SNeil Armstrong #define WCD939X_R_EN_CONST_SEL_R	GENMASK(7, 6)
269*be2af391SNeil Armstrong #define WCD939X_R_EN_GAIN_SOURCE_SEL	BIT(5)
270*be2af391SNeil Armstrong #define WCD939X_R_EN_SPARE_BITS	GENMASK(4, 0)
271*be2af391SNeil Armstrong #define WCD939X_HPH_R_TEST				   (0x30d7)
272*be2af391SNeil Armstrong #define WCD939X_HPH_R_ATEST				   (0x30d8)
273*be2af391SNeil Armstrong #define WCD939X_R_ATEST_DACR_REF_ATEST1_CONN	BIT(7)
274*be2af391SNeil Armstrong #define WCD939X_R_ATEST_LDO1_R_ATEST2_CONN	BIT(6)
275*be2af391SNeil Armstrong #define WCD939X_R_ATEST_LDO_R_ATEST2_CAL	BIT(5)
276*be2af391SNeil Armstrong #define WCD939X_R_ATEST_LDO2_R_ATEST2_CONN	BIT(4)
277*be2af391SNeil Armstrong #define WCD939X_R_ATEST_LDO_1P65V_ATEST1_CONN	BIT(3)
278*be2af391SNeil Armstrong #define WCD939X_R_ATEST_HPH_GND_OVR	BIT(1)
279*be2af391SNeil Armstrong #define WCD939X_HPH_RDAC_CLK_CTL1			   (0x30d9)
280*be2af391SNeil Armstrong #define WCD939X_RDAC_CLK_CTL1_OPAMP_CHOP_CLK_EN	BIT(7)
281*be2af391SNeil Armstrong #define WCD939X_RDAC_CLK_CTL1_OPAMP_CHOP_CLK_DIV_CTRL	GENMASK(6, 4)
282*be2af391SNeil Armstrong #define WCD939X_RDAC_CLK_CTL1_SPARE_BITS	GENMASK(3, 0)
283*be2af391SNeil Armstrong #define WCD939X_HPH_RDAC_CLK_CTL2			   (0x30da)
284*be2af391SNeil Armstrong #define WCD939X_HPH_RDAC_LDO_CTL			   (0x30db)
285*be2af391SNeil Armstrong #define WCD939X_HPH_RDAC_CHOP_CLK_LP_CTL		   (0x30dc)
286*be2af391SNeil Armstrong #define WCD939X_HPH_REFBUFF_UHQA_CTL			   (0x30dd)
287*be2af391SNeil Armstrong #define WCD939X_REFBUFF_UHQA_CTL_SPARE_BITS	GENMASK(7, 6)
288*be2af391SNeil Armstrong #define WCD939X_REFBUFF_UHQA_CTL_HPH_VNEGREG2_COMP_CTL_OV	BIT(5)
289*be2af391SNeil Armstrong #define WCD939X_REFBUFF_UHQA_CTL_REFBUFN_RBIAS_ADJUST	BIT(4)
290*be2af391SNeil Armstrong #define WCD939X_REFBUFF_UHQA_CTL_REFBUFP_IOUT_CTL	GENMASK(3, 2)
291*be2af391SNeil Armstrong #define WCD939X_REFBUFF_UHQA_CTL_REFBUFN_IOUT_CTL	GENMASK(1, 0)
292*be2af391SNeil Armstrong #define WCD939X_HPH_REFBUFF_LP_CTL			   (0x30de)
293*be2af391SNeil Armstrong #define WCD939X_REFBUFF_LP_CTL_HPH_VNEGREG2_CURR_COMP	GENMASK(7, 6)
294*be2af391SNeil Armstrong #define WCD939X_REFBUFF_LP_CTL_SPARE_BITS	GENMASK(5, 4)
295*be2af391SNeil Armstrong #define WCD939X_REFBUFF_LP_CTL_EN_PREREF_FILT_STARTUP_CLKDIV	BIT(3)
296*be2af391SNeil Armstrong #define WCD939X_REFBUFF_LP_CTL_PREREF_FILT_STARTUP_CLKDIV_CTL	GENMASK(2, 1)
297*be2af391SNeil Armstrong #define WCD939X_REFBUFF_LP_CTL_PREREF_FILT_BYPASS	BIT(0)
298*be2af391SNeil Armstrong #define WCD939X_HPH_L_DAC_CTL				   (0x30df)
299*be2af391SNeil Armstrong #define WCD939X_HPH_R_DAC_CTL				   (0x30e0)
300*be2af391SNeil Armstrong #define WCD939X_HPH_SURGE_COMP_SEL			   (0x30e1)
301*be2af391SNeil Armstrong #define WCD939X_HPH_SURGE_EN				   (0x30e2)
302*be2af391SNeil Armstrong #define WCD939X_EN_EN_SURGE_PROTECTION_HPHL	BIT(7)
303*be2af391SNeil Armstrong #define WCD939X_EN_EN_SURGE_PROTECTION_HPHR	BIT(6)
304*be2af391SNeil Armstrong #define WCD939X_EN_SEL_SURGE_COMP_IQ	GENMASK(5, 4)
305*be2af391SNeil Armstrong #define WCD939X_EN_SURGE_VOLT_MODE_SHUTOFF_EN	BIT(3)
306*be2af391SNeil Armstrong #define WCD939X_EN_LATCH_INTR_OP_STG_HIZ_EN	BIT(2)
307*be2af391SNeil Armstrong #define WCD939X_EN_SURGE_LATCH_REG_RESET	BIT(1)
308*be2af391SNeil Armstrong #define WCD939X_EN_SWTICH_VN_VNDAC_NSURGE_EN	BIT(0)
309*be2af391SNeil Armstrong #define WCD939X_HPH_SURGE_MISC1				   (0x30e3)
310*be2af391SNeil Armstrong #define WCD939X_HPH_SURGE_STATUS			   (0x30e4)
311*be2af391SNeil Armstrong #define WCD939X_EAR_EN					   (0x30e9)
312*be2af391SNeil Armstrong #define WCD939X_EAR_PA_CON				   (0x30ea)
313*be2af391SNeil Armstrong #define WCD939X_EAR_SP_CON				   (0x30eb)
314*be2af391SNeil Armstrong #define WCD939X_EAR_DAC_CON				   (0x30ec)
315*be2af391SNeil Armstrong #define WCD939X_DAC_CON_DAC_SAMPLE_EDGE_SEL	BIT(7)
316*be2af391SNeil Armstrong #define WCD939X_DAC_CON_REF_DBG_EN	BIT(6)
317*be2af391SNeil Armstrong #define WCD939X_DAC_CON_REF_DBG_GAIN	GENMASK(5, 3)
318*be2af391SNeil Armstrong #define WCD939X_DAC_CON_GAIN_DAC	GENMASK(2, 1)
319*be2af391SNeil Armstrong #define WCD939X_DAC_CON_INV_DATA	BIT(0)
320*be2af391SNeil Armstrong #define WCD939X_EAR_CNP_FSM_CON				   (0x30ed)
321*be2af391SNeil Armstrong #define WCD939X_EAR_TEST_CTL				   (0x30ee)
322*be2af391SNeil Armstrong #define WCD939X_EAR_STATUS_REG_1			   (0x30ef)
323*be2af391SNeil Armstrong #define WCD939X_EAR_STATUS_REG_2			   (0x30f0)
324*be2af391SNeil Armstrong #define WCD939X_FLYBACK_NEW_CTRL_2			   (0x30f6)
325*be2af391SNeil Armstrong #define WCD939X_FLYBACK_NEW_CTRL_3			   (0x30f7)
326*be2af391SNeil Armstrong #define WCD939X_FLYBACK_NEW_CTRL_4			   (0x30f8)
327*be2af391SNeil Armstrong #define WCD939X_ANA_NEW_PAGE				   (0x3100)
328*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_ANA_HPH2			   (0x3101)
329*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_ANA_HPH3			   (0x3102)
330*be2af391SNeil Armstrong #define WCD939X_SLEEP_CTL				   (0x3103)
331*be2af391SNeil Armstrong #define WCD939X_SLEEP_WATCHDOG_CTL			   (0x3104)
332*be2af391SNeil Armstrong #define WCD939X_MBHC_NEW_ELECT_REM_CLAMP_CTL		   (0x311f)
333*be2af391SNeil Armstrong #define WCD939X_MBHC_NEW_CTL_1				   (0x3120)
334*be2af391SNeil Armstrong #define WCD939X_CTL_1_RCO_EN	BIT(7)
335*be2af391SNeil Armstrong #define WCD939X_CTL_1_ADC_MODE	BIT(4)
336*be2af391SNeil Armstrong #define WCD939X_CTL_1_ADC_ENABLE	BIT(3)
337*be2af391SNeil Armstrong #define WCD939X_CTL_1_DETECTION_DONE	BIT(2)
338*be2af391SNeil Armstrong #define WCD939X_CTL_1_BTN_DBNC_CTL	GENMASK(1, 0)
339*be2af391SNeil Armstrong #define WCD939X_MBHC_NEW_CTL_2				   (0x3121)
340*be2af391SNeil Armstrong #define WCD939X_CTL_2_MUX_CTL	GENMASK(6, 4)
341*be2af391SNeil Armstrong #define WCD939X_CTL_2_M_RTH_CTL	GENMASK(3, 2)
342*be2af391SNeil Armstrong #define WCD939X_CTL_2_HS_VREF_CTL	GENMASK(1, 0)
343*be2af391SNeil Armstrong #define WCD939X_MBHC_NEW_PLUG_DETECT_CTL		   (0x3122)
344*be2af391SNeil Armstrong #define WCD939X_MBHC_NEW_ZDET_ANA_CTL			   (0x3123)
345*be2af391SNeil Armstrong #define WCD939X_ZDET_ANA_CTL_AVERAGING_EN	BIT(7)
346*be2af391SNeil Armstrong #define WCD939X_ZDET_ANA_CTL_MAXV_CTL	GENMASK(6, 4)
347*be2af391SNeil Armstrong #define WCD939X_ZDET_ANA_CTL_RANGE_CTL	GENMASK(3, 0)
348*be2af391SNeil Armstrong #define WCD939X_MBHC_NEW_ZDET_RAMP_CTL			   (0x3124)
349*be2af391SNeil Armstrong #define WCD939X_ZDET_RAMP_CTL_ACC1_MIN_CTL	GENMASK(6, 4)
350*be2af391SNeil Armstrong #define WCD939X_ZDET_RAMP_CTL_TIME_CTL	GENMASK(3, 0)
351*be2af391SNeil Armstrong #define WCD939X_MBHC_NEW_FSM_STATUS			   (0x3125)
352*be2af391SNeil Armstrong #define WCD939X_FSM_STATUS_ADC_TIMEOUT	BIT(7)
353*be2af391SNeil Armstrong #define WCD939X_FSM_STATUS_ADC_COMPLETE	BIT(6)
354*be2af391SNeil Armstrong #define WCD939X_FSM_STATUS_HS_M_COMP_STATUS	BIT(5)
355*be2af391SNeil Armstrong #define WCD939X_FSM_STATUS_FAST_PRESS_FLAG_STATUS	BIT(4)
356*be2af391SNeil Armstrong #define WCD939X_FSM_STATUS_FAST_REMOVAL_FLAG_STATUS	BIT(3)
357*be2af391SNeil Armstrong #define WCD939X_FSM_STATUS_REMOVAL_FLAG_STATUS	BIT(2)
358*be2af391SNeil Armstrong #define WCD939X_FSM_STATUS_ELECT_REM_RT_STATUS	BIT(1)
359*be2af391SNeil Armstrong #define WCD939X_FSM_STATUS_BTN_STATUS	BIT(0)
360*be2af391SNeil Armstrong #define WCD939X_MBHC_NEW_ADC_RESULT			   (0x3126)
361*be2af391SNeil Armstrong #define WCD939X_ADC_RESULT_VALUE	GENMASK(7, 0)
362*be2af391SNeil Armstrong #define WCD939X_TX_NEW_CH12_MUX				   (0x3127)
363*be2af391SNeil Armstrong #define WCD939X_TX_NEW_CH34_MUX				   (0x3128)
364*be2af391SNeil Armstrong #define WCD939X_DIE_CRACK_DET_EN			   (0x312c)
365*be2af391SNeil Armstrong #define WCD939X_DIE_CRACK_DET_OUT			   (0x312d)
366*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_RDAC_GAIN_CTL		   (0x3132)
367*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_PA_GAIN_CTL_L		   (0x3133)
368*be2af391SNeil Armstrong #define WCD939X_PA_GAIN_CTL_L_EN_HPHPA_2VPK	BIT(7)
369*be2af391SNeil Armstrong #define WCD939X_PA_GAIN_CTL_L_RX_SUPPLY_LEVEL	BIT(6)
370*be2af391SNeil Armstrong #define WCD939X_PA_GAIN_CTL_L_DAC_DR_BOOST	BIT(5)
371*be2af391SNeil Armstrong #define WCD939X_PA_GAIN_CTL_L_VALUE	GENMASK(4, 0)
372*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_RDAC_VREF_CTL		   (0x3134)
373*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_RDAC_OVERRIDE_CTL		   (0x3135)
374*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_PA_GAIN_CTL_R		   (0x3136)
375*be2af391SNeil Armstrong #define WCD939X_PA_GAIN_CTL_R_D_RCO_CLK_EN	BIT(7)
376*be2af391SNeil Armstrong #define WCD939X_PA_GAIN_CTL_R_SPARE_BITS	GENMASK(6, 5)
377*be2af391SNeil Armstrong #define WCD939X_PA_GAIN_CTL_R_VALUE	GENMASK(4, 0)
378*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_PA_MISC1			   (0x3137)
379*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_PA_MISC2			   (0x3138)
380*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_PA_RDAC_MISC		   (0x3139)
381*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_TIMER1			   (0x313a)
382*be2af391SNeil Armstrong #define WCD939X_TIMER1_CURR_IDIV_CTL_CMPDR_OFF	GENMASK(7, 5)
383*be2af391SNeil Armstrong #define WCD939X_TIMER1_CURR_IDIV_CTL_AUTOCHOP	GENMASK(4, 2)
384*be2af391SNeil Armstrong #define WCD939X_TIMER1_AUTOCHOP_TIMER_CTL_EN	BIT(1)
385*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_TIMER2			   (0x313b)
386*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_TIMER3			   (0x313c)
387*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_TIMER4			   (0x313d)
388*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_PA_RDAC_MISC2		   (0x313e)
389*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_PA_RDAC_MISC3		   (0x313f)
390*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_RDAC_HD2_CTL_L		   (0x3140)
391*be2af391SNeil Armstrong #define WCD939X_RDAC_HD2_CTL_L_EN_HD2_RES_DIV_L	BIT(7)
392*be2af391SNeil Armstrong #define WCD939X_RDAC_HD2_CTL_L_HD2_RES_DIV_PULLGND_L	BIT(6)
393*be2af391SNeil Armstrong #define WCD939X_RDAC_HD2_CTL_L_HD2_RES_DIV_CTL_L	GENMASK(5, 0)
394*be2af391SNeil Armstrong #define WCD939X_HPH_NEW_INT_RDAC_HD2_CTL_R		   (0x3141)
395*be2af391SNeil Armstrong #define WCD939X_RDAC_HD2_CTL_R_EN_HD2_RES_DIV_R	BIT(7)
396*be2af391SNeil Armstrong #define WCD939X_RDAC_HD2_CTL_R_HD2_RES_DIV_PULLGND_L	BIT(6)
397*be2af391SNeil Armstrong #define WCD939X_RDAC_HD2_CTL_R_HD2_RES_DIV_CTL_R	GENMASK(5, 0)
398*be2af391SNeil Armstrong #define WCD939X_RX_NEW_INT_HPH_RDAC_BIAS_LOHIFI		   (0x3145)
399*be2af391SNeil Armstrong #define WCD939X_RX_NEW_INT_HPH_RDAC_BIAS_ULP		   (0x3146)
400*be2af391SNeil Armstrong #define WCD939X_RX_NEW_INT_HPH_RDAC_LDO_LP		   (0x3147)
401*be2af391SNeil Armstrong #define WCD939X_MBHC_NEW_INT_MOISTURE_DET_DC_CTRL	   (0x31af)
402*be2af391SNeil Armstrong #define WCD939X_MOISTURE_DET_DC_CTRL_ONCOUNT	GENMASK(6, 5)
403*be2af391SNeil Armstrong #define WCD939X_MOISTURE_DET_DC_CTRL_OFFCOUNT	GENMASK(4, 0)
404*be2af391SNeil Armstrong #define WCD939X_MBHC_NEW_INT_MOISTURE_DET_POLLING_CTRL	   (0x31b0)
405*be2af391SNeil Armstrong #define WCD939X_MOISTURE_DET_POLLING_CTRL_HPHL_PA_EN	BIT(6)
406*be2af391SNeil Armstrong #define WCD939X_MOISTURE_DET_POLLING_CTRL_DTEST_EN	GENMASK(5, 4)
407*be2af391SNeil Armstrong #define WCD939X_MOISTURE_DET_POLLING_CTRL_MOIST_OVRD_POLLING	BIT(3)
408*be2af391SNeil Armstrong #define WCD939X_MOISTURE_DET_POLLING_CTRL_MOIST_EN_POLLING	BIT(2)
409*be2af391SNeil Armstrong #define WCD939X_MOISTURE_DET_POLLING_CTRL_MOIST_DBNC_TIME	GENMASK(1, 0)
410*be2af391SNeil Armstrong #define WCD939X_MBHC_NEW_INT_MECH_DET_CURRENT		   (0x31b1)
411*be2af391SNeil Armstrong #define WCD939X_MECH_DET_CURRENT_HSDET_PULLUP_CTL	GENMASK(4, 0)
412*be2af391SNeil Armstrong #define WCD939X_MBHC_NEW_INT_ZDET_CLK_AND_MOISTURE_CTL_NEW (0x31b2)
413*be2af391SNeil Armstrong #define WCD939X_EAR_INT_NEW_CHOPPER_CON			   (0x31b7)
414*be2af391SNeil Armstrong #define WCD939X_EAR_INT_NEW_CNP_VCM_CON1		   (0x31b8)
415*be2af391SNeil Armstrong #define WCD939X_EAR_INT_NEW_CNP_VCM_CON2		   (0x31b9)
416*be2af391SNeil Armstrong #define WCD939X_EAR_INT_NEW_DYNAMIC_BIAS		   (0x31ba)
417*be2af391SNeil Armstrong #define WCD939X_SLEEP_INT_WATCHDOG_CTL_1		   (0x31d0)
418*be2af391SNeil Armstrong #define WCD939X_SLEEP_INT_WATCHDOG_CTL_2		   (0x31d1)
419*be2af391SNeil Armstrong #define WCD939X_DIE_CRACK_INT_DET_INT1			   (0x31d3)
420*be2af391SNeil Armstrong #define WCD939X_DIE_CRACK_INT_DET_INT2			   (0x31d4)
421*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_FE_DIVSTOP_L2		   (0x31d5)
422*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_FE_DIVSTOP_L1		   (0x31d6)
423*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_FE_DIVSTOP_L0		   (0x31d7)
424*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_FE_DIVSTOP_ULP1P2M	   (0x31d8)
425*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_FE_DIVSTOP_ULP0P6M	   (0x31d9)
426*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_FE_ICTRL_STG1_L2L1	   (0x31da)
427*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_FE_ICTRL_STG1_L0		   (0x31db)
428*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_FE_ICTRL_STG1_ULP	   (0x31dc)
429*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_FE_ICTRL_STG2MAIN_L2L1	   (0x31dd)
430*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_FE_ICTRL_STG2MAIN_L0	   (0x31de)
431*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_FE_ICTRL_STG2MAIN_ULP	   (0x31df)
432*be2af391SNeil Armstrong #define WCD939X_FE_ICTRL_STG2MAIN_ULP_VALUE	GENMASK(4, 0)
433*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_FE_ICTRL_STG2CASC_L2L1L0	   (0x31e0)
434*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_FE_ICTRL_STG2CASC_ULP	   (0x31e1)
435*be2af391SNeil Armstrong #define WCD939X_FE_ICTRL_STG2CASC_ULP_ICTRL_SCBIAS_ULP0P6M	GENMASK(7, 4)
436*be2af391SNeil Armstrong #define WCD939X_FE_ICTRL_STG2CASC_ULP_VALUE	GENMASK(3, 0)
437*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_ADC_SCBIAS_L2L1		   (0x31e2)
438*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_ADC_SCBIAS_L0ULP		   (0x31e3)
439*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_ADC_INT_L2		   (0x31e4)
440*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_ADC_INT_L1		   (0x31e5)
441*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_ADC_INT_L0		   (0x31e6)
442*be2af391SNeil Armstrong #define WCD939X_TX_COM_NEW_INT_ADC_INT_ULP		   (0x31e7)
443*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PAGE				   (0x3400)
444*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CHIP_ID0			   (0x3401)
445*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CHIP_ID1			   (0x3402)
446*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CHIP_ID2			   (0x3403)
447*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CHIP_ID3			   (0x3404)
448*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SWR_TX_CLK_RATE			   (0x3405)
449*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_RST_CTL			   (0x3406)
450*be2af391SNeil Armstrong #define WCD939X_DIGITAL_TOP_CLK_CFG			   (0x3407)
451*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_ANA_CLK_CTL			   (0x3408)
452*be2af391SNeil Armstrong #define WCD939X_CDC_ANA_CLK_CTL_ANA_TX_DIV4_CLK_EN	BIT(5)
453*be2af391SNeil Armstrong #define WCD939X_CDC_ANA_CLK_CTL_ANA_TX_DIV2_CLK_EN	BIT(4)
454*be2af391SNeil Armstrong #define WCD939X_CDC_ANA_CLK_CTL_ANA_TX_CLK_EN	BIT(3)
455*be2af391SNeil Armstrong #define WCD939X_CDC_ANA_CLK_CTL_ANA_RX_DIV4_CLK_EN	BIT(2)
456*be2af391SNeil Armstrong #define WCD939X_CDC_ANA_CLK_CTL_ANA_RX_DIV2_CLK_EN	BIT(1)
457*be2af391SNeil Armstrong #define WCD939X_CDC_ANA_CLK_CTL_ANA_RX_CLK_EN	BIT(0)
458*be2af391SNeil Armstrong #define WCD939X_CDC_ANA_CLK_CTL_ANA_TX_DIV2_CLK_EN	BIT(4)
459*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_DIG_CLK_CTL			   (0x3409)
460*be2af391SNeil Armstrong #define WCD939X_CDC_DIG_CLK_CTL_TXD3_CLK_EN	BIT(7)
461*be2af391SNeil Armstrong #define WCD939X_CDC_DIG_CLK_CTL_TXD2_CLK_EN	BIT(6)
462*be2af391SNeil Armstrong #define WCD939X_CDC_DIG_CLK_CTL_TXD1_CLK_EN	BIT(5)
463*be2af391SNeil Armstrong #define WCD939X_CDC_DIG_CLK_CTL_TXD0_CLK_EN	BIT(4)
464*be2af391SNeil Armstrong #define WCD939X_CDC_DIG_CLK_CTL_RXD2_CLK_EN	BIT(2)
465*be2af391SNeil Armstrong #define WCD939X_CDC_DIG_CLK_CTL_RXD1_CLK_EN	BIT(1)
466*be2af391SNeil Armstrong #define WCD939X_CDC_DIG_CLK_CTL_RXD0_CLK_EN	BIT(0)
467*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SWR_RST_EN			   (0x340a)
468*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_PATH_MODE			   (0x340b)
469*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_RX_RST			   (0x340c)
470*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_RX0_CTL			   (0x340d)
471*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_RX1_CTL			   (0x340e)
472*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_RX2_CTL			   (0x340f)
473*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_TX_ANA_MODE_0_1		   (0x3410)
474*be2af391SNeil Armstrong #define WCD939X_CDC_TX_ANA_MODE_0_1_TXD1_MODE	GENMASK(7, 4)
475*be2af391SNeil Armstrong #define WCD939X_CDC_TX_ANA_MODE_0_1_TXD0_MODE	GENMASK(3, 0)
476*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_TX_ANA_MODE_2_3		   (0x3411)
477*be2af391SNeil Armstrong #define WCD939X_CDC_TX_ANA_MODE_2_3_TXD3_MODE	GENMASK(7, 4)
478*be2af391SNeil Armstrong #define WCD939X_CDC_TX_ANA_MODE_2_3_TXD2_MODE	GENMASK(3, 0)
479*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_COMP_CTL_0			   (0x3414)
480*be2af391SNeil Armstrong #define WCD939X_CDC_COMP_CTL_0_HPHL_COMP_EN	BIT(1)
481*be2af391SNeil Armstrong #define WCD939X_CDC_COMP_CTL_0_HPHR_COMP_EN	BIT(0)
482*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_ANA_TX_CLK_CTL		   (0x3417)
483*be2af391SNeil Armstrong #define WCD939X_CDC_ANA_TX_CLK_CTL_ANA_MBHC_1P2M_CLK_EN	BIT(5)
484*be2af391SNeil Armstrong #define WCD939X_CDC_ANA_TX_CLK_CTL_ANA_TX3_ADC_CLK_EN	BIT(4)
485*be2af391SNeil Armstrong #define WCD939X_CDC_ANA_TX_CLK_CTL_ANA_TX2_ADC_CLK_EN	BIT(3)
486*be2af391SNeil Armstrong #define WCD939X_CDC_ANA_TX_CLK_CTL_ANA_TX1_ADC_CLK_EN	BIT(2)
487*be2af391SNeil Armstrong #define WCD939X_CDC_ANA_TX_CLK_CTL_ANA_TX0_ADC_CLK_EN	BIT(1)
488*be2af391SNeil Armstrong #define WCD939X_CDC_ANA_TX_CLK_CTL_ANA_TXSCBIAS_CLK_EN	BIT(0)
489*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_A1_0		   (0x3418)
490*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_A1_1		   (0x3419)
491*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_A2_0		   (0x341a)
492*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_A2_1		   (0x341b)
493*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_A3_0		   (0x341c)
494*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_A3_1		   (0x341d)
495*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_A4_0		   (0x341e)
496*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_A4_1		   (0x341f)
497*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_A5_0		   (0x3420)
498*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_A5_1		   (0x3421)
499*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_A6_0		   (0x3422)
500*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_A7_0		   (0x3423)
501*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_C_0			   (0x3424)
502*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_C_1			   (0x3425)
503*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_C_2			   (0x3426)
504*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_C_3			   (0x3427)
505*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_R1			   (0x3428)
506*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_R2			   (0x3429)
507*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_R3			   (0x342a)
508*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_R4			   (0x342b)
509*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_R5			   (0x342c)
510*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_R6			   (0x342d)
511*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_DSM_R7			   (0x342e)
512*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_A1_0		   (0x342f)
513*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_A1_1		   (0x3430)
514*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_A2_0		   (0x3431)
515*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_A2_1		   (0x3432)
516*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_A3_0		   (0x3433)
517*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_A3_1		   (0x3434)
518*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_A4_0		   (0x3435)
519*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_A4_1		   (0x3436)
520*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_A5_0		   (0x3437)
521*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_A5_1		   (0x3438)
522*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_A6_0		   (0x3439)
523*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_A7_0		   (0x343a)
524*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_C_0			   (0x343b)
525*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_C_1			   (0x343c)
526*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_C_2			   (0x343d)
527*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_C_3			   (0x343e)
528*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_R1			   (0x343f)
529*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_R2			   (0x3440)
530*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_R3			   (0x3441)
531*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_R4			   (0x3442)
532*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_R5			   (0x3443)
533*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_R6			   (0x3444)
534*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_DSM_R7			   (0x3445)
535*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_GAIN_RX_0		   (0x3446)
536*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_GAIN_RX_1		   (0x3447)
537*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_GAIN_DSD_0		   (0x3448)
538*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_GAIN_DSD_1		   (0x3449)
539*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_GAIN_DSD_2		   (0x344a)
540*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_GAIN_DSD_0		   (0x344b)
541*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_GAIN_DSD_1		   (0x344c)
542*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_GAIN_DSD_2		   (0x344d)
543*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_HPH_GAIN_CTL		   (0x344e)
544*be2af391SNeil Armstrong #define WCD939X_CDC_HPH_GAIN_CTL_HPH_STEREO_EN	BIT(4)
545*be2af391SNeil Armstrong #define WCD939X_CDC_HPH_GAIN_CTL_HPHR_RX_EN	BIT(3)
546*be2af391SNeil Armstrong #define WCD939X_CDC_HPH_GAIN_CTL_HPHL_RX_EN	BIT(2)
547*be2af391SNeil Armstrong #define WCD939X_CDC_HPH_GAIN_CTL_HPHR_DSD_EN	BIT(1)
548*be2af391SNeil Armstrong #define WCD939X_CDC_HPH_GAIN_CTL_HPHL_DSD_EN	BIT(0)
549*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_GAIN_CTL		   (0x344f)
550*be2af391SNeil Armstrong #define WCD939X_CDC_EAR_GAIN_CTL_EAR_EN	BIT(0)
551*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_EAR_PATH_CTL		   (0x3450)
552*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_SWR_CLH			   (0x3451)
553*be2af391SNeil Armstrong #define WCD939X_CDC_SWR_CLH_CLH_CTL	GENMASK(7, 0)
554*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SWR_CLH_BYP			   (0x3452)
555*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_TX0_CTL			   (0x3453)
556*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_TX1_CTL			   (0x3454)
557*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_TX2_CTL			   (0x3455)
558*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_TX_RST			   (0x3456)
559*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_REQ_CTL			   (0x3457)
560*be2af391SNeil Armstrong #define WCD939X_CDC_REQ_CTL_TX3_WIDE_BAND	BIT(5)
561*be2af391SNeil Armstrong #define WCD939X_CDC_REQ_CTL_TX2_WIDE_BAND	BIT(4)
562*be2af391SNeil Armstrong #define WCD939X_CDC_REQ_CTL_TX1_WIDE_BAND	BIT(3)
563*be2af391SNeil Armstrong #define WCD939X_CDC_REQ_CTL_TX0_WIDE_BAND	BIT(2)
564*be2af391SNeil Armstrong #define WCD939X_CDC_REQ_CTL_FS_RATE_4P8	BIT(1)
565*be2af391SNeil Armstrong #define WCD939X_CDC_REQ_CTL_NO_NOTCH	BIT(0)
566*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_RST				   (0x3458)
567*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_AMIC_CTL			   (0x345a)
568*be2af391SNeil Armstrong #define WCD939X_CDC_AMIC_CTL_AMIC5_IN_SEL	BIT(3)
569*be2af391SNeil Armstrong #define WCD939X_CDC_AMIC_CTL_AMIC4_IN_SEL	BIT(2)
570*be2af391SNeil Armstrong #define WCD939X_CDC_AMIC_CTL_AMIC3_IN_SEL	BIT(1)
571*be2af391SNeil Armstrong #define WCD939X_CDC_AMIC_CTL_AMIC1_IN_SEL	BIT(0)
572*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_DMIC_CTL			   (0x345b)
573*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC_CTL_DMIC_LEGACY_SW_MODE	BIT(3)
574*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC_CTL_DMIC_DIV_BAK_EN	BIT(2)
575*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC_CTL_CLK_SCALE_EN	BIT(1)
576*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC_CTL_SOFT_RESET	BIT(0)
577*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_DMIC1_CTL			   (0x345c)
578*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC1_CTL_DMIC_CLK_SCALE_SEL	GENMASK(6, 4)
579*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC1_CTL_DMIC_CLK_EN	BIT(3)
580*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC1_CTL_DMIC_CLK_SEL	GENMASK(2, 0)
581*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_DMIC2_CTL			   (0x345d)
582*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC2_CTL_DMIC_LEFT_EN	BIT(7)
583*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC2_CTL_DMIC_CLK_SCALE_SEL	GENMASK(6, 4)
584*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC2_CTL_DMIC_CLK_EN	BIT(3)
585*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC2_CTL_DMIC_CLK_SEL	GENMASK(2, 0)
586*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_DMIC3_CTL			   (0x345e)
587*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC3_CTL_DMIC_CLK_SCALE_SEL	GENMASK(6, 4)
588*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC3_CTL_DMIC_CLK_EN	BIT(3)
589*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC3_CTL_DMIC_CLK_SEL	GENMASK(2, 0)
590*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_DMIC4_CTL			   (0x345f)
591*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC4_CTL_DMIC_CLK_SCALE_SEL	GENMASK(6, 4)
592*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC4_CTL_DMIC_CLK_EN	BIT(3)
593*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC4_CTL_DMIC_CLK_SEL	GENMASK(2, 0)
594*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_PRG_CTL			   (0x3460)
595*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_CTL			   (0x3461)
596*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_DMIC_RATE_1_2		   (0x3462)
597*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC_RATE_1_2_DMIC2_RATE	GENMASK(7, 4)
598*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC_RATE_1_2_DMIC1_RATE	GENMASK(3, 0)
599*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_DMIC_RATE_3_4		   (0x3463)
600*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC_RATE_3_4_DMIC4_RATE	GENMASK(7, 4)
601*be2af391SNeil Armstrong #define WCD939X_CDC_DMIC_RATE_3_4_DMIC3_RATE	GENMASK(3, 0)
602*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PDM_WD_CTL0			   (0x3465)
603*be2af391SNeil Armstrong #define WCD939X_PDM_WD_CTL0_HOLD_OFF	BIT(4)
604*be2af391SNeil Armstrong #define WCD939X_PDM_WD_CTL0_TIME_OUT_SEL	BIT(3)
605*be2af391SNeil Armstrong #define WCD939X_PDM_WD_CTL0_PDM_WD_EN	GENMASK(2, 0)
606*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PDM_WD_CTL1			   (0x3466)
607*be2af391SNeil Armstrong #define WCD939X_PDM_WD_CTL1_HOLD_OFF	BIT(4)
608*be2af391SNeil Armstrong #define WCD939X_PDM_WD_CTL1_TIME_OUT_SEL	BIT(3)
609*be2af391SNeil Armstrong #define WCD939X_PDM_WD_CTL1_PDM_WD_EN	GENMASK(2, 0)
610*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PDM_WD_CTL2			   (0x3467)
611*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_MODE			   (0x346a)
612*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_MASK_0			   (0x346b)
613*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_MASK_1			   (0x346c)
614*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_MASK_2			   (0x346d)
615*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_STATUS_0			   (0x346e)
616*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_STATUS_1			   (0x346f)
617*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_STATUS_2			   (0x3470)
618*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_CLEAR_0			   (0x3471)
619*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_CLEAR_1			   (0x3472)
620*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_CLEAR_2			   (0x3473)
621*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_LEVEL_0			   (0x3474)
622*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_LEVEL_1			   (0x3475)
623*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_LEVEL_2			   (0x3476)
624*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_SET_0			   (0x3477)
625*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_SET_1			   (0x3478)
626*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_SET_2			   (0x3479)
627*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_TEST_0			   (0x347a)
628*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_TEST_1			   (0x347b)
629*be2af391SNeil Armstrong #define WCD939X_DIGITAL_INTR_TEST_2			   (0x347c)
630*be2af391SNeil Armstrong #define WCD939X_DIGITAL_TX_MODE_DBG_EN			   (0x347f)
631*be2af391SNeil Armstrong #define WCD939X_DIGITAL_TX_MODE_DBG_0_1			   (0x3480)
632*be2af391SNeil Armstrong #define WCD939X_DIGITAL_TX_MODE_DBG_2_3			   (0x3481)
633*be2af391SNeil Armstrong #define WCD939X_DIGITAL_LB_IN_SEL_CTL			   (0x3482)
634*be2af391SNeil Armstrong #define WCD939X_DIGITAL_LOOP_BACK_MODE			   (0x3483)
635*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SWR_DAC_TEST			   (0x3484)
636*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SWR_HM_TEST_RX_0		   (0x3485)
637*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SWR_HM_TEST_TX_0		   (0x3486)
638*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SWR_HM_TEST_RX_1		   (0x3487)
639*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SWR_HM_TEST_TX_1		   (0x3488)
640*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SWR_HM_TEST_TX_2		   (0x3489)
641*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SWR_HM_TEST_0			   (0x348a)
642*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SWR_HM_TEST_1			   (0x348b)
643*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PAD_CTL_SWR_0			   (0x348c)
644*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PAD_CTL_SWR_1			   (0x348d)
645*be2af391SNeil Armstrong #define WCD939X_DIGITAL_I2C_CTL				   (0x348e)
646*be2af391SNeil Armstrong #define WCD939X_DIGITAL_CDC_TX_TANGGU_SW_MODE		   (0x348f)
647*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_TEST_CTL_0		   (0x3490)
648*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_TEST_CTL_1		   (0x3491)
649*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_T_DATA_0			   (0x3492)
650*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_T_DATA_1			   (0x3493)
651*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PAD_CTL_PDM_RX0			   (0x3494)
652*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PAD_CTL_PDM_RX1			   (0x3495)
653*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PAD_CTL_PDM_TX0			   (0x3496)
654*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PAD_CTL_PDM_TX1			   (0x3497)
655*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PAD_CTL_PDM_TX2			   (0x3498)
656*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PAD_INP_DIS_0			   (0x3499)
657*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PAD_INP_DIS_1			   (0x349a)
658*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DRIVE_STRENGTH_0		   (0x349b)
659*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DRIVE_STRENGTH_1		   (0x349c)
660*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DRIVE_STRENGTH_2		   (0x349d)
661*be2af391SNeil Armstrong #define WCD939X_DIGITAL_RX_DATA_EDGE_CTL		   (0x349e)
662*be2af391SNeil Armstrong #define WCD939X_DIGITAL_TX_DATA_EDGE_CTL		   (0x349f)
663*be2af391SNeil Armstrong #define WCD939X_DIGITAL_GPIO_MODE			   (0x34a0)
664*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PIN_CTL_OE			   (0x34a1)
665*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PIN_CTL_DATA_0			   (0x34a2)
666*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PIN_CTL_DATA_1			   (0x34a3)
667*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PIN_STATUS_0			   (0x34a4)
668*be2af391SNeil Armstrong #define WCD939X_DIGITAL_PIN_STATUS_1			   (0x34a5)
669*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DIG_DEBUG_CTL			   (0x34a6)
670*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DIG_DEBUG_EN			   (0x34a7)
671*be2af391SNeil Armstrong #define WCD939X_DIGITAL_ANA_CSR_DBG_ADD			   (0x34a8)
672*be2af391SNeil Armstrong #define WCD939X_DIGITAL_ANA_CSR_DBG_CTL			   (0x34a9)
673*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SSP_DBG				   (0x34aa)
674*be2af391SNeil Armstrong #define WCD939X_DIGITAL_MODE_STATUS_0			   (0x34ab)
675*be2af391SNeil Armstrong #define WCD939X_DIGITAL_MODE_STATUS_1			   (0x34ac)
676*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SPARE_0				   (0x34ad)
677*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SPARE_1				   (0x34ae)
678*be2af391SNeil Armstrong #define WCD939X_DIGITAL_SPARE_2				   (0x34af)
679*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_0			   (0x34b0)
680*be2af391SNeil Armstrong #define WCD939X_EFUSE_REG_0_WCD939X_ID	GENMASK(4, 1)
681*be2af391SNeil Armstrong #define WCD939X_EFUSE_REG_0_EFUSE_BLOWN	BIT(0)
682*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_1			   (0x34b1)
683*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_2			   (0x34b2)
684*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_3			   (0x34b3)
685*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_4			   (0x34b4)
686*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_5			   (0x34b5)
687*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_6			   (0x34b6)
688*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_7			   (0x34b7)
689*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_8			   (0x34b8)
690*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_9			   (0x34b9)
691*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_10			   (0x34ba)
692*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_11			   (0x34bb)
693*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_12			   (0x34bc)
694*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_13			   (0x34bd)
695*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_14			   (0x34be)
696*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_15			   (0x34bf)
697*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_16			   (0x34c0)
698*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_17			   (0x34c1)
699*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_18			   (0x34c2)
700*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_19			   (0x34c3)
701*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_20			   (0x34c4)
702*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_21			   (0x34c5)
703*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_22			   (0x34c6)
704*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_23			   (0x34c7)
705*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_24			   (0x34c8)
706*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_25			   (0x34c9)
707*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_26			   (0x34ca)
708*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_27			   (0x34cb)
709*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_28			   (0x34cc)
710*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_29			   (0x34cd)
711*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_30			   (0x34ce)
712*be2af391SNeil Armstrong #define WCD939X_DIGITAL_EFUSE_REG_31			   (0x34cf)
713*be2af391SNeil Armstrong #define WCD939X_DIGITAL_TX_REQ_FB_CTL_0			   (0x34d0)
714*be2af391SNeil Armstrong #define WCD939X_DIGITAL_TX_REQ_FB_CTL_1			   (0x34d1)
715*be2af391SNeil Armstrong #define WCD939X_DIGITAL_TX_REQ_FB_CTL_2			   (0x34d2)
716*be2af391SNeil Armstrong #define WCD939X_DIGITAL_TX_REQ_FB_CTL_3			   (0x34d3)
717*be2af391SNeil Armstrong #define WCD939X_DIGITAL_TX_REQ_FB_CTL_4			   (0x34d4)
718*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DEM_BYPASS_DATA0		   (0x34d5)
719*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DEM_BYPASS_DATA1		   (0x34d6)
720*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DEM_BYPASS_DATA2		   (0x34d7)
721*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DEM_BYPASS_DATA3		   (0x34d8)
722*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DEM_SECOND_ORDER		   (0x34d9)
723*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DSM_CTRL			   (0x34da)
724*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DSM_0_STATIC_DATA_0		   (0x34db)
725*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DSM_0_STATIC_DATA_1		   (0x34dc)
726*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DSM_0_STATIC_DATA_2		   (0x34dd)
727*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DSM_0_STATIC_DATA_3		   (0x34de)
728*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DSM_1_STATIC_DATA_0		   (0x34df)
729*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DSM_1_STATIC_DATA_1		   (0x34e0)
730*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DSM_1_STATIC_DATA_2		   (0x34e1)
731*be2af391SNeil Armstrong #define WCD939X_DIGITAL_DSM_1_STATIC_DATA_3		   (0x34e2)
732*be2af391SNeil Armstrong #define WCD939X_RX_TOP_PAGE				   (0x3500)
733*be2af391SNeil Armstrong #define WCD939X_RX_TOP_TOP_CFG0				   (0x3501)
734*be2af391SNeil Armstrong #define WCD939X_TOP_CFG0_HPH_DAC_RATE_SEL	BIT(1)
735*be2af391SNeil Armstrong #define WCD939X_TOP_CFG0_PGA_UPDATE	BIT(0)
736*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHL_COMP_WR_LSB			   (0x3502)
737*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHL_COMP_WR_MSB			   (0x3503)
738*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHL_COMP_LUT			   (0x3504)
739*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHL_COMP_RD_LSB			   (0x3505)
740*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHL_COMP_RD_MSB			   (0x3506)
741*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHR_COMP_WR_LSB			   (0x3507)
742*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHR_COMP_WR_MSB			   (0x3508)
743*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHR_COMP_LUT			   (0x3509)
744*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHR_COMP_RD_LSB			   (0x350a)
745*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHR_COMP_RD_MSB			   (0x350b)
746*be2af391SNeil Armstrong #define WCD939X_RX_TOP_DSD0_DEBUG_CFG1			   (0x350c)
747*be2af391SNeil Armstrong #define WCD939X_RX_TOP_DSD0_DEBUG_CFG2			   (0x350d)
748*be2af391SNeil Armstrong #define WCD939X_RX_TOP_DSD0_DEBUG_CFG3			   (0x350e)
749*be2af391SNeil Armstrong #define WCD939X_RX_TOP_DSD0_DEBUG_CFG4			   (0x350f)
750*be2af391SNeil Armstrong #define WCD939X_RX_TOP_DSD0_DEBUG_CFG5			   (0x3510)
751*be2af391SNeil Armstrong #define WCD939X_RX_TOP_DSD0_DEBUG_CFG6			   (0x3511)
752*be2af391SNeil Armstrong #define WCD939X_RX_TOP_DSD1_DEBUG_CFG1			   (0x3512)
753*be2af391SNeil Armstrong #define WCD939X_RX_TOP_DSD1_DEBUG_CFG2			   (0x3513)
754*be2af391SNeil Armstrong #define WCD939X_RX_TOP_DSD1_DEBUG_CFG3			   (0x3514)
755*be2af391SNeil Armstrong #define WCD939X_RX_TOP_DSD1_DEBUG_CFG4			   (0x3515)
756*be2af391SNeil Armstrong #define WCD939X_RX_TOP_DSD1_DEBUG_CFG5			   (0x3516)
757*be2af391SNeil Armstrong #define WCD939X_RX_TOP_DSD1_DEBUG_CFG6			   (0x3517)
758*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHL_PATH_CFG0			   (0x351c)
759*be2af391SNeil Armstrong #define WCD939X_HPHL_PATH_CFG0_INT_EN	BIT(1)
760*be2af391SNeil Armstrong #define WCD939X_HPHL_PATH_CFG0_DLY_ZN_EN	BIT(0)
761*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHL_PATH_CFG1			   (0x351d)
762*be2af391SNeil Armstrong #define WCD939X_HPHL_PATH_CFG1_DSM_SOFT_RST	BIT(5)
763*be2af391SNeil Armstrong #define WCD939X_HPHL_PATH_CFG1_INT_SOFT_RST	BIT(4)
764*be2af391SNeil Armstrong #define WCD939X_HPHL_PATH_CFG1_FMT_CONV	BIT(3)
765*be2af391SNeil Armstrong #define WCD939X_HPHL_PATH_CFG1_IDLE_OVRD_EN	BIT(2)
766*be2af391SNeil Armstrong #define WCD939X_HPHL_PATH_CFG1_RX_DC_DROOP_COEFF_SEL	GENMASK(1, 0)
767*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHR_PATH_CFG0			   (0x351e)
768*be2af391SNeil Armstrong #define WCD939X_HPHR_PATH_CFG0_INT_EN	BIT(2)
769*be2af391SNeil Armstrong #define WCD939X_HPHR_PATH_CFG0_DLY_ZN_EN	BIT(1)
770*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHR_PATH_CFG1			   (0x351f)
771*be2af391SNeil Armstrong #define WCD939X_HPHR_PATH_CFG1_DSM_SOFT_RST	BIT(5)
772*be2af391SNeil Armstrong #define WCD939X_HPHR_PATH_CFG1_INT_SOFT_RST	BIT(4)
773*be2af391SNeil Armstrong #define WCD939X_HPHR_PATH_CFG1_FMT_CONV	BIT(3)
774*be2af391SNeil Armstrong #define WCD939X_HPHR_PATH_CFG1_IDLE_OVRD_EN	BIT(2)
775*be2af391SNeil Armstrong #define WCD939X_HPHR_PATH_CFG1_RX_DC_DROOP_COEFF_SEL	GENMASK(1, 0)
776*be2af391SNeil Armstrong #define WCD939X_RX_TOP_PATH_CFG2			   (0x3520)
777*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHL_PATH_SEC0			   (0x3521)
778*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHL_PATH_SEC1			   (0x3522)
779*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHL_PATH_SEC2			   (0x3523)
780*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHL_PATH_SEC3			   (0x3524)
781*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHR_PATH_SEC0			   (0x3525)
782*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHR_PATH_SEC1			   (0x3526)
783*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHR_PATH_SEC2			   (0x3527)
784*be2af391SNeil Armstrong #define WCD939X_RX_TOP_HPHR_PATH_SEC3			   (0x3528)
785*be2af391SNeil Armstrong #define WCD939X_RX_TOP_PATH_SEC4			   (0x3529)
786*be2af391SNeil Armstrong #define WCD939X_RX_TOP_PATH_SEC5			   (0x352a)
787*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL0			   (0x3540)
788*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL1			   (0x3541)
789*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL2			   (0x3542)
790*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL3			   (0x3543)
791*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL4			   (0x3544)
792*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL5			   (0x3545)
793*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL6			   (0x3546)
794*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL7			   (0x3547)
795*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL8			   (0x3548)
796*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL9			   (0x3549)
797*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL10			   (0x354a)
798*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL11			   (0x354b)
799*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL12			   (0x354c)
800*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL13			   (0x354d)
801*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL14			   (0x354e)
802*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL15			   (0x354f)
803*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL16			   (0x3550)
804*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL17			   (0x3551)
805*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL18			   (0x3552)
806*be2af391SNeil Armstrong #define WCD939X_COMPANDER_HPHL_CTL19			   (0x3553)
807*be2af391SNeil Armstrong #define WCD939X_R_CTL0					   (0x3560)
808*be2af391SNeil Armstrong #define WCD939X_R_CTL1					   (0x3561)
809*be2af391SNeil Armstrong #define WCD939X_R_CTL2					   (0x3562)
810*be2af391SNeil Armstrong #define WCD939X_R_CTL3					   (0x3563)
811*be2af391SNeil Armstrong #define WCD939X_R_CTL4					   (0x3564)
812*be2af391SNeil Armstrong #define WCD939X_R_CTL5					   (0x3565)
813*be2af391SNeil Armstrong #define WCD939X_R_CTL6					   (0x3566)
814*be2af391SNeil Armstrong #define WCD939X_R_CTL7					   (0x3567)
815*be2af391SNeil Armstrong #define WCD939X_R_CTL8					   (0x3568)
816*be2af391SNeil Armstrong #define WCD939X_R_CTL9					   (0x3569)
817*be2af391SNeil Armstrong #define WCD939X_R_CTL10					   (0x356a)
818*be2af391SNeil Armstrong #define WCD939X_R_CTL11					   (0x356b)
819*be2af391SNeil Armstrong #define WCD939X_R_CTL12					   (0x356c)
820*be2af391SNeil Armstrong #define WCD939X_R_CTL13					   (0x356d)
821*be2af391SNeil Armstrong #define WCD939X_R_CTL14					   (0x356e)
822*be2af391SNeil Armstrong #define WCD939X_R_CTL15					   (0x356f)
823*be2af391SNeil Armstrong #define WCD939X_R_CTL16					   (0x3570)
824*be2af391SNeil Armstrong #define WCD939X_R_CTL17					   (0x3571)
825*be2af391SNeil Armstrong #define WCD939X_R_CTL18					   (0x3572)
826*be2af391SNeil Armstrong #define WCD939X_R_CTL19					   (0x3573)
827*be2af391SNeil Armstrong #define WCD939X_E_PATH_CTL				   (0x3580)
828*be2af391SNeil Armstrong #define WCD939X_E_CFG0					   (0x3581)
829*be2af391SNeil Armstrong #define WCD939X_CFG0_AUTO_DISABLE_ANC	BIT(2)
830*be2af391SNeil Armstrong #define WCD939X_CFG0_AUTO_DISABLE_DSD	BIT(1)
831*be2af391SNeil Armstrong #define WCD939X_CFG0_IDLE_STEREO	BIT(0)
832*be2af391SNeil Armstrong #define WCD939X_E_CFG1					   (0x3582)
833*be2af391SNeil Armstrong #define WCD939X_E_CFG2					   (0x3583)
834*be2af391SNeil Armstrong #define WCD939X_E_CFG3					   (0x3584)
835*be2af391SNeil Armstrong #define WCD939X_DSD_HPHL_PATH_CTL			   (0x3590)
836*be2af391SNeil Armstrong #define WCD939X_DSD_HPHL_CFG0				   (0x3591)
837*be2af391SNeil Armstrong #define WCD939X_DSD_HPHL_CFG1				   (0x3592)
838*be2af391SNeil Armstrong #define WCD939X_DSD_HPHL_CFG2				   (0x3593)
839*be2af391SNeil Armstrong #define WCD939X_DSD_HPHL_CFG3				   (0x3594)
840*be2af391SNeil Armstrong #define WCD939X_DSD_HPHL_CFG4				   (0x3595)
841*be2af391SNeil Armstrong #define WCD939X_DSD_HPHL_CFG5				   (0x3596)
842*be2af391SNeil Armstrong #define WCD939X_DSD_HPHR_PATH_CTL			   (0x35a0)
843*be2af391SNeil Armstrong #define WCD939X_DSD_HPHR_CFG0				   (0x35a1)
844*be2af391SNeil Armstrong #define WCD939X_DSD_HPHR_CFG1				   (0x35a2)
845*be2af391SNeil Armstrong #define WCD939X_DSD_HPHR_CFG2				   (0x35a3)
846*be2af391SNeil Armstrong #define WCD939X_DSD_HPHR_CFG3				   (0x35a4)
847*be2af391SNeil Armstrong #define WCD939X_DSD_HPHR_CFG4				   (0x35a5)
848*be2af391SNeil Armstrong #define WCD939X_DSD_HPHR_CFG5				   (0x35a6)
849*be2af391SNeil Armstrong #define WCD939X_MAX_REGISTER				   (WCD939X_DSD_HPHR_CFG5)
850*be2af391SNeil Armstrong 
851*be2af391SNeil Armstrong #define WCD939X_MAX_SWR_PORTS		(6)
852*be2af391SNeil Armstrong #define WCD939X_MAX_RX_SWR_PORTS	(6)
853*be2af391SNeil Armstrong #define WCD939X_MAX_TX_SWR_PORTS	(4)
854*be2af391SNeil Armstrong #define WCD939X_MAX_SWR_CH_IDS		(15)
855*be2af391SNeil Armstrong 
856*be2af391SNeil Armstrong struct wcd939x_sdw_ch_info {
857*be2af391SNeil Armstrong 	int port_num;
858*be2af391SNeil Armstrong 	unsigned int ch_mask;
859*be2af391SNeil Armstrong };
860*be2af391SNeil Armstrong 
861*be2af391SNeil Armstrong #define WCD_SDW_CH(id, pn, cmask)	\
862*be2af391SNeil Armstrong 	[id] = {			\
863*be2af391SNeil Armstrong 		.port_num = pn,		\
864*be2af391SNeil Armstrong 		.ch_mask = cmask,	\
865*be2af391SNeil Armstrong 	}
866*be2af391SNeil Armstrong 
867*be2af391SNeil Armstrong enum wcd939x_tx_sdw_ports {
868*be2af391SNeil Armstrong 	WCD939X_ADC_1_4_PORT = 1,
869*be2af391SNeil Armstrong 	WCD939X_ADC_DMIC_1_2_PORT,
870*be2af391SNeil Armstrong 	WCD939X_DMIC_0_3_MBHC_PORT,
871*be2af391SNeil Armstrong 	WCD939X_DMIC_3_7_PORT,
872*be2af391SNeil Armstrong };
873*be2af391SNeil Armstrong 
874*be2af391SNeil Armstrong enum wcd939x_tx_sdw_channels {
875*be2af391SNeil Armstrong 	WCD939X_ADC1,
876*be2af391SNeil Armstrong 	WCD939X_ADC2,
877*be2af391SNeil Armstrong 	WCD939X_ADC3,
878*be2af391SNeil Armstrong 	WCD939X_ADC4,
879*be2af391SNeil Armstrong 	WCD939X_DMIC0,
880*be2af391SNeil Armstrong 	WCD939X_DMIC1,
881*be2af391SNeil Armstrong 	WCD939X_MBHC,
882*be2af391SNeil Armstrong 	WCD939X_DMIC2,
883*be2af391SNeil Armstrong 	WCD939X_DMIC3,
884*be2af391SNeil Armstrong 	WCD939X_DMIC4,
885*be2af391SNeil Armstrong 	WCD939X_DMIC5,
886*be2af391SNeil Armstrong 	WCD939X_DMIC6,
887*be2af391SNeil Armstrong 	WCD939X_DMIC7,
888*be2af391SNeil Armstrong };
889*be2af391SNeil Armstrong 
890*be2af391SNeil Armstrong enum wcd939x_rx_sdw_ports {
891*be2af391SNeil Armstrong 	WCD939X_HPH_PORT = 1,
892*be2af391SNeil Armstrong 	WCD939X_CLSH_PORT,
893*be2af391SNeil Armstrong 	WCD939X_COMP_PORT,
894*be2af391SNeil Armstrong 	WCD939X_LO_PORT,
895*be2af391SNeil Armstrong 	WCD939X_DSD_PORT,
896*be2af391SNeil Armstrong 	WCD939X_HIFI_PCM_PORT,
897*be2af391SNeil Armstrong };
898*be2af391SNeil Armstrong 
899*be2af391SNeil Armstrong enum wcd939x_rx_sdw_channels {
900*be2af391SNeil Armstrong 	WCD939X_HPH_L,
901*be2af391SNeil Armstrong 	WCD939X_HPH_R,
902*be2af391SNeil Armstrong 	WCD939X_CLSH,
903*be2af391SNeil Armstrong 	WCD939X_COMP_L,
904*be2af391SNeil Armstrong 	WCD939X_COMP_R,
905*be2af391SNeil Armstrong 	WCD939X_LO,
906*be2af391SNeil Armstrong 	WCD939X_DSD_L,
907*be2af391SNeil Armstrong 	WCD939X_DSD_R,
908*be2af391SNeil Armstrong 	WCD939X_HIFI_PCM_L,
909*be2af391SNeil Armstrong 	WCD939X_HIFI_PCM_R,
910*be2af391SNeil Armstrong };
911*be2af391SNeil Armstrong 
912*be2af391SNeil Armstrong enum {
913*be2af391SNeil Armstrong 	WCD939X_SDW_DIR_RX,
914*be2af391SNeil Armstrong 	WCD939X_SDW_DIR_TX,
915*be2af391SNeil Armstrong };
916*be2af391SNeil Armstrong 
917*be2af391SNeil Armstrong struct wcd939x_priv;
918*be2af391SNeil Armstrong struct wcd939x_sdw_priv {
919*be2af391SNeil Armstrong 	struct sdw_slave *sdev;
920*be2af391SNeil Armstrong 	struct sdw_stream_config sconfig;
921*be2af391SNeil Armstrong 	struct sdw_stream_runtime *sruntime;
922*be2af391SNeil Armstrong 	struct sdw_port_config port_config[WCD939X_MAX_SWR_PORTS];
923*be2af391SNeil Armstrong 	struct wcd939x_sdw_ch_info *ch_info;
924*be2af391SNeil Armstrong 	bool port_enable[WCD939X_MAX_SWR_CH_IDS];
925*be2af391SNeil Armstrong 	int active_ports;
926*be2af391SNeil Armstrong 	int num_ports;
927*be2af391SNeil Armstrong 	bool is_tx;
928*be2af391SNeil Armstrong 	struct wcd939x_priv *wcd939x;
929*be2af391SNeil Armstrong 	struct irq_domain *slave_irq;
930*be2af391SNeil Armstrong 	struct regmap *regmap;
931*be2af391SNeil Armstrong };
932*be2af391SNeil Armstrong 
933*be2af391SNeil Armstrong #if IS_ENABLED(CONFIG_SND_SOC_WCD939X_SDW)
934*be2af391SNeil Armstrong int wcd939x_sdw_free(struct wcd939x_sdw_priv *wcd,
935*be2af391SNeil Armstrong 		     struct snd_pcm_substream *substream,
936*be2af391SNeil Armstrong 		     struct snd_soc_dai *dai);
937*be2af391SNeil Armstrong int wcd939x_sdw_set_sdw_stream(struct wcd939x_sdw_priv *wcd,
938*be2af391SNeil Armstrong 			       struct snd_soc_dai *dai,
939*be2af391SNeil Armstrong 			       void *stream, int direction);
940*be2af391SNeil Armstrong int wcd939x_sdw_hw_params(struct wcd939x_sdw_priv *wcd,
941*be2af391SNeil Armstrong 			  struct snd_pcm_substream *substream,
942*be2af391SNeil Armstrong 			  struct snd_pcm_hw_params *params,
943*be2af391SNeil Armstrong 			  struct snd_soc_dai *dai);
944*be2af391SNeil Armstrong 
945*be2af391SNeil Armstrong struct device *wcd939x_sdw_device_get(struct device_node *np);
946*be2af391SNeil Armstrong unsigned int wcd939x_swr_get_current_bank(struct sdw_slave *sdev);
947*be2af391SNeil Armstrong 
948*be2af391SNeil Armstrong struct regmap *wcd939x_swr_get_regmap(struct wcd939x_sdw_priv *wcd);
949*be2af391SNeil Armstrong #else
950*be2af391SNeil Armstrong 
951*be2af391SNeil Armstrong static inline int wcd939x_sdw_free(struct wcd939x_sdw_priv *wcd,
952*be2af391SNeil Armstrong 				   struct snd_pcm_substream *substream,
953*be2af391SNeil Armstrong 				   struct snd_soc_dai *dai)
954*be2af391SNeil Armstrong {
955*be2af391SNeil Armstrong 	return -EOPNOTSUPP;
956*be2af391SNeil Armstrong }
957*be2af391SNeil Armstrong 
958*be2af391SNeil Armstrong static inline int wcd939x_sdw_set_sdw_stream(struct wcd939x_sdw_priv *wcd,
959*be2af391SNeil Armstrong 					     struct snd_soc_dai *dai,
960*be2af391SNeil Armstrong 					     void *stream, int direction)
961*be2af391SNeil Armstrong {
962*be2af391SNeil Armstrong 	return -EOPNOTSUPP;
963*be2af391SNeil Armstrong }
964*be2af391SNeil Armstrong 
965*be2af391SNeil Armstrong static inline int wcd939x_sdw_hw_params(struct wcd939x_sdw_priv *wcd,
966*be2af391SNeil Armstrong 					struct snd_pcm_substream *substream,
967*be2af391SNeil Armstrong 					struct snd_pcm_hw_params *params,
968*be2af391SNeil Armstrong 					struct snd_soc_dai *dai)
969*be2af391SNeil Armstrong {
970*be2af391SNeil Armstrong 	return -EOPNOTSUPP;
971*be2af391SNeil Armstrong }
972*be2af391SNeil Armstrong 
973*be2af391SNeil Armstrong static inline struct device *wcd939x_sdw_device_get(struct device_node *np)
974*be2af391SNeil Armstrong {
975*be2af391SNeil Armstrong 	return NULL;
976*be2af391SNeil Armstrong }
977*be2af391SNeil Armstrong 
978*be2af391SNeil Armstrong static inline unsigned int wcd939x_swr_get_current_bank(struct sdw_slave *sdev)
979*be2af391SNeil Armstrong {
980*be2af391SNeil Armstrong 	return 0;
981*be2af391SNeil Armstrong }
982*be2af391SNeil Armstrong 
983*be2af391SNeil Armstrong struct regmap *wcd939x_swr_get_regmap(struct wcd939x_sdw_priv *wcd)
984*be2af391SNeil Armstrong {
985*be2af391SNeil Armstrong 	return PTR_ERR(-EINVAL);
986*be2af391SNeil Armstrong }
987*be2af391SNeil Armstrong #endif /* CONFIG_SND_SOC_WCD939X_SDW */
988*be2af391SNeil Armstrong 
989*be2af391SNeil Armstrong #endif /* __WCD939X_H__ */
990