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