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