forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/sound/soc/codecs/tlv320aic31xx.h
....@@ -2,7 +2,7 @@
22 /*
33 * ALSA SoC TLV320AIC31xx CODEC Driver Definitions
44 *
5
- * Copyright (C) 2014-2017 Texas Instruments Incorporated - http://www.ti.com/
5
+ * Copyright (C) 2014-2017 Texas Instruments Incorporated - https://www.ti.com/
66 */
77
88 #ifndef _TLV320AIC31XX_H
....@@ -19,6 +19,10 @@
1919 #define AIC31XX_STEREO_CLASS_D_BIT BIT(1)
2020 #define AIC31XX_MINIDSP_BIT BIT(2)
2121 #define DAC31XX_BIT BIT(3)
22
+
23
+#define AIC31XX_JACK_MASK (SND_JACK_HEADPHONE | \
24
+ SND_JACK_HEADSET | \
25
+ SND_JACK_BTN_0)
2226
2327 enum aic31xx_type {
2428 AIC3100 = 0,
....@@ -173,6 +177,13 @@
173177 #define AIC31XX_HPRDRVPWRSTATUS_MASK BIT(1)
174178 #define AIC31XX_SPRDRVPWRSTATUS_MASK BIT(0)
175179
180
+/* AIC31XX_OFFLAG */
181
+#define AIC31XX_DAC_OF_LEFT BIT(7)
182
+#define AIC31XX_DAC_OF_RIGHT BIT(6)
183
+#define AIC31XX_DAC_OF_SHIFTER BIT(5)
184
+#define AIC31XX_ADC_OF BIT(3)
185
+#define AIC31XX_ADC_OF_SHIFTER BIT(1)
186
+
176187 /* AIC31XX_INTRDACFLAG */
177188 #define AIC31XX_HPLSCDETECT BIT(7)
178189 #define AIC31XX_HPRSCDETECT BIT(6)
....@@ -191,12 +202,41 @@
191202 #define AIC31XX_SC BIT(3)
192203 #define AIC31XX_ENGINE BIT(2)
193204
194
-/* AIC31XX_DACSETUP */
195
-#define AIC31XX_SOFTSTEP_MASK GENMASK(1, 0)
205
+/* AIC31XX_GPIO1 */
206
+#define AIC31XX_GPIO1_FUNC_MASK GENMASK(5, 2)
207
+#define AIC31XX_GPIO1_FUNC_SHIFT 2
208
+#define AIC31XX_GPIO1_DISABLED 0x00
209
+#define AIC31XX_GPIO1_INPUT 0x01
210
+#define AIC31XX_GPIO1_GPI 0x02
211
+#define AIC31XX_GPIO1_GPO 0x03
212
+#define AIC31XX_GPIO1_CLKOUT 0x04
213
+#define AIC31XX_GPIO1_INT1 0x05
214
+#define AIC31XX_GPIO1_INT2 0x06
215
+#define AIC31XX_GPIO1_ADC_WCLK 0x07
216
+#define AIC31XX_GPIO1_SBCLK 0x08
217
+#define AIC31XX_GPIO1_SWCLK 0x09
218
+#define AIC31XX_GPIO1_ADC_MOD_CLK 0x10
219
+#define AIC31XX_GPIO1_SDOUT 0x11
196220
197221 /* AIC31XX_DACMUTE */
198222 #define AIC31XX_DACMUTE_MASK GENMASK(3, 2)
199223
224
+/* AIC31XX_HSDETECT */
225
+#define AIC31XX_HSD_ENABLE BIT(7)
226
+#define AIC31XX_HSD_TYPE_MASK GENMASK(6, 5)
227
+#define AIC31XX_HSD_TYPE_SHIFT 5
228
+#define AIC31XX_HSD_NONE 0x00
229
+#define AIC31XX_HSD_HP 0x01
230
+#define AIC31XX_HSD_HS 0x03
231
+
232
+/* AIC31XX_HPDRIVER */
233
+#define AIC31XX_HPD_OCMV_MASK GENMASK(4, 3)
234
+#define AIC31XX_HPD_OCMV_SHIFT 3
235
+#define AIC31XX_HPD_OCMV_1_35V 0x0
236
+#define AIC31XX_HPD_OCMV_1_5V 0x1
237
+#define AIC31XX_HPD_OCMV_1_65V 0x2
238
+#define AIC31XX_HPD_OCMV_1_8V 0x3
239
+
200240 /* AIC31XX_MICBIAS */
201241 #define AIC31XX_MICBIAS_MASK GENMASK(1, 0)
202242 #define AIC31XX_MICBIAS_SHIFT 0