xref: /linux/include/sound/da7219-aad.h (revision 24bce201d79807b668bf9d9e0aca801c5c0d5f78)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * da7219-aad.h - DA7322 ASoC Codec AAD Driver Platform Data
4  *
5  * Copyright (c) 2015 Dialog Semiconductor Ltd.
6  *
7  * Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
8  */
9 
10 #ifndef __DA7219_AAD_PDATA_H
11 #define __DA7219_AAD_PDATA_H
12 
13 enum da7219_aad_micbias_pulse_lvl {
14 	DA7219_AAD_MICBIAS_PULSE_LVL_OFF = 0,
15 	DA7219_AAD_MICBIAS_PULSE_LVL_2_8V = 6,
16 	DA7219_AAD_MICBIAS_PULSE_LVL_2_9V,
17 };
18 
19 enum da7219_aad_btn_cfg {
20 	DA7219_AAD_BTN_CFG_2MS = 1,
21 	DA7219_AAD_BTN_CFG_5MS,
22 	DA7219_AAD_BTN_CFG_10MS,
23 	DA7219_AAD_BTN_CFG_50MS,
24 	DA7219_AAD_BTN_CFG_100MS,
25 	DA7219_AAD_BTN_CFG_200MS,
26 	DA7219_AAD_BTN_CFG_500MS,
27 };
28 
29 enum da7219_aad_mic_det_thr {
30 	DA7219_AAD_MIC_DET_THR_200_OHMS = 0,
31 	DA7219_AAD_MIC_DET_THR_500_OHMS,
32 	DA7219_AAD_MIC_DET_THR_750_OHMS,
33 	DA7219_AAD_MIC_DET_THR_1000_OHMS,
34 };
35 
36 enum da7219_aad_jack_ins_deb {
37 	DA7219_AAD_JACK_INS_DEB_5MS = 0,
38 	DA7219_AAD_JACK_INS_DEB_10MS,
39 	DA7219_AAD_JACK_INS_DEB_20MS,
40 	DA7219_AAD_JACK_INS_DEB_50MS,
41 	DA7219_AAD_JACK_INS_DEB_100MS,
42 	DA7219_AAD_JACK_INS_DEB_200MS,
43 	DA7219_AAD_JACK_INS_DEB_500MS,
44 	DA7219_AAD_JACK_INS_DEB_1S,
45 };
46 
47 enum da7219_aad_jack_det_rate {
48 	DA7219_AAD_JACK_DET_RATE_32_64MS = 0,
49 	DA7219_AAD_JACK_DET_RATE_64_128MS,
50 	DA7219_AAD_JACK_DET_RATE_128_256MS,
51 	DA7219_AAD_JACK_DET_RATE_256_512MS,
52 };
53 
54 enum da7219_aad_jack_rem_deb {
55 	DA7219_AAD_JACK_REM_DEB_1MS = 0,
56 	DA7219_AAD_JACK_REM_DEB_5MS,
57 	DA7219_AAD_JACK_REM_DEB_10MS,
58 	DA7219_AAD_JACK_REM_DEB_20MS,
59 };
60 
61 enum da7219_aad_btn_avg {
62 	DA7219_AAD_BTN_AVG_1 = 0,
63 	DA7219_AAD_BTN_AVG_2,
64 	DA7219_AAD_BTN_AVG_4,
65 	DA7219_AAD_BTN_AVG_8,
66 };
67 
68 enum da7219_aad_adc_1bit_rpt {
69 	DA7219_AAD_ADC_1BIT_RPT_1 = 0,
70 	DA7219_AAD_ADC_1BIT_RPT_2,
71 	DA7219_AAD_ADC_1BIT_RPT_4,
72 	DA7219_AAD_ADC_1BIT_RPT_8,
73 };
74 
75 struct da7219_aad_pdata {
76 	int irq;
77 
78 	enum da7219_aad_micbias_pulse_lvl micbias_pulse_lvl;
79 	u32 micbias_pulse_time;
80 	enum da7219_aad_btn_cfg btn_cfg;
81 	enum da7219_aad_mic_det_thr mic_det_thr;
82 	enum da7219_aad_jack_ins_deb jack_ins_deb;
83 	enum da7219_aad_jack_det_rate jack_det_rate;
84 	enum da7219_aad_jack_rem_deb jack_rem_deb;
85 
86 	u8 a_d_btn_thr;
87 	u8 d_b_btn_thr;
88 	u8 b_c_btn_thr;
89 	u8 c_mic_btn_thr;
90 
91 	enum da7219_aad_btn_avg btn_avg;
92 	enum da7219_aad_adc_1bit_rpt adc_1bit_rpt;
93 };
94 
95 #endif /* __DA7219_AAD_PDATA_H */
96