xref: /linux/include/sound/da7219-aad.h (revision dc0ff0fa3a9bf9f7be3a9530f8f6079324f54fa5)
12874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
26d817c0eSAdam Thomson /*
36d817c0eSAdam Thomson  * da7219-aad.h - DA7322 ASoC Codec AAD Driver Platform Data
46d817c0eSAdam Thomson  *
56d817c0eSAdam Thomson  * Copyright (c) 2015 Dialog Semiconductor Ltd.
66d817c0eSAdam Thomson  *
76d817c0eSAdam Thomson  * Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
86d817c0eSAdam Thomson  */
96d817c0eSAdam Thomson 
106d817c0eSAdam Thomson #ifndef __DA7219_AAD_PDATA_H
116d817c0eSAdam Thomson #define __DA7219_AAD_PDATA_H
126d817c0eSAdam Thomson 
136d817c0eSAdam Thomson enum da7219_aad_micbias_pulse_lvl {
146d817c0eSAdam Thomson 	DA7219_AAD_MICBIAS_PULSE_LVL_OFF = 0,
156d817c0eSAdam Thomson 	DA7219_AAD_MICBIAS_PULSE_LVL_2_8V = 6,
166d817c0eSAdam Thomson 	DA7219_AAD_MICBIAS_PULSE_LVL_2_9V,
176d817c0eSAdam Thomson };
186d817c0eSAdam Thomson 
196d817c0eSAdam Thomson enum da7219_aad_btn_cfg {
206d817c0eSAdam Thomson 	DA7219_AAD_BTN_CFG_2MS = 1,
216d817c0eSAdam Thomson 	DA7219_AAD_BTN_CFG_5MS,
226d817c0eSAdam Thomson 	DA7219_AAD_BTN_CFG_10MS,
236d817c0eSAdam Thomson 	DA7219_AAD_BTN_CFG_50MS,
246d817c0eSAdam Thomson 	DA7219_AAD_BTN_CFG_100MS,
256d817c0eSAdam Thomson 	DA7219_AAD_BTN_CFG_200MS,
266d817c0eSAdam Thomson 	DA7219_AAD_BTN_CFG_500MS,
276d817c0eSAdam Thomson };
286d817c0eSAdam Thomson 
296d817c0eSAdam Thomson enum da7219_aad_mic_det_thr {
306d817c0eSAdam Thomson 	DA7219_AAD_MIC_DET_THR_200_OHMS = 0,
316d817c0eSAdam Thomson 	DA7219_AAD_MIC_DET_THR_500_OHMS,
326d817c0eSAdam Thomson 	DA7219_AAD_MIC_DET_THR_750_OHMS,
336d817c0eSAdam Thomson 	DA7219_AAD_MIC_DET_THR_1000_OHMS,
346d817c0eSAdam Thomson };
356d817c0eSAdam Thomson 
366d817c0eSAdam Thomson enum da7219_aad_jack_ins_deb {
376d817c0eSAdam Thomson 	DA7219_AAD_JACK_INS_DEB_5MS = 0,
386d817c0eSAdam Thomson 	DA7219_AAD_JACK_INS_DEB_10MS,
396d817c0eSAdam Thomson 	DA7219_AAD_JACK_INS_DEB_20MS,
406d817c0eSAdam Thomson 	DA7219_AAD_JACK_INS_DEB_50MS,
416d817c0eSAdam Thomson 	DA7219_AAD_JACK_INS_DEB_100MS,
426d817c0eSAdam Thomson 	DA7219_AAD_JACK_INS_DEB_200MS,
436d817c0eSAdam Thomson 	DA7219_AAD_JACK_INS_DEB_500MS,
446d817c0eSAdam Thomson 	DA7219_AAD_JACK_INS_DEB_1S,
456d817c0eSAdam Thomson };
466d817c0eSAdam Thomson 
47*dc0ff0faSDavid Rau enum da7219_aad_jack_ins_det_pty {
48*dc0ff0faSDavid Rau 	DA7219_AAD_JACK_INS_DET_PTY_LOW = 0,
49*dc0ff0faSDavid Rau 	DA7219_AAD_JACK_INS_DET_PTY_HIGH,
50*dc0ff0faSDavid Rau };
51*dc0ff0faSDavid Rau 
526d817c0eSAdam Thomson enum da7219_aad_jack_det_rate {
536d817c0eSAdam Thomson 	DA7219_AAD_JACK_DET_RATE_32_64MS = 0,
546d817c0eSAdam Thomson 	DA7219_AAD_JACK_DET_RATE_64_128MS,
556d817c0eSAdam Thomson 	DA7219_AAD_JACK_DET_RATE_128_256MS,
566d817c0eSAdam Thomson 	DA7219_AAD_JACK_DET_RATE_256_512MS,
576d817c0eSAdam Thomson };
586d817c0eSAdam Thomson 
596d817c0eSAdam Thomson enum da7219_aad_jack_rem_deb {
606d817c0eSAdam Thomson 	DA7219_AAD_JACK_REM_DEB_1MS = 0,
616d817c0eSAdam Thomson 	DA7219_AAD_JACK_REM_DEB_5MS,
626d817c0eSAdam Thomson 	DA7219_AAD_JACK_REM_DEB_10MS,
636d817c0eSAdam Thomson 	DA7219_AAD_JACK_REM_DEB_20MS,
646d817c0eSAdam Thomson };
656d817c0eSAdam Thomson 
666d817c0eSAdam Thomson enum da7219_aad_btn_avg {
676d817c0eSAdam Thomson 	DA7219_AAD_BTN_AVG_1 = 0,
686d817c0eSAdam Thomson 	DA7219_AAD_BTN_AVG_2,
696d817c0eSAdam Thomson 	DA7219_AAD_BTN_AVG_4,
706d817c0eSAdam Thomson 	DA7219_AAD_BTN_AVG_8,
716d817c0eSAdam Thomson };
726d817c0eSAdam Thomson 
736d817c0eSAdam Thomson enum da7219_aad_adc_1bit_rpt {
746d817c0eSAdam Thomson 	DA7219_AAD_ADC_1BIT_RPT_1 = 0,
756d817c0eSAdam Thomson 	DA7219_AAD_ADC_1BIT_RPT_2,
766d817c0eSAdam Thomson 	DA7219_AAD_ADC_1BIT_RPT_4,
776d817c0eSAdam Thomson 	DA7219_AAD_ADC_1BIT_RPT_8,
786d817c0eSAdam Thomson };
796d817c0eSAdam Thomson 
806d817c0eSAdam Thomson struct da7219_aad_pdata {
816d817c0eSAdam Thomson 	int irq;
826d817c0eSAdam Thomson 
836d817c0eSAdam Thomson 	enum da7219_aad_micbias_pulse_lvl micbias_pulse_lvl;
846d817c0eSAdam Thomson 	u32 micbias_pulse_time;
856d817c0eSAdam Thomson 	enum da7219_aad_btn_cfg btn_cfg;
866d817c0eSAdam Thomson 	enum da7219_aad_mic_det_thr mic_det_thr;
876d817c0eSAdam Thomson 	enum da7219_aad_jack_ins_deb jack_ins_deb;
88*dc0ff0faSDavid Rau 	enum da7219_aad_jack_ins_det_pty jack_ins_det_pty;
896d817c0eSAdam Thomson 	enum da7219_aad_jack_det_rate jack_det_rate;
906d817c0eSAdam Thomson 	enum da7219_aad_jack_rem_deb jack_rem_deb;
916d817c0eSAdam Thomson 
926d817c0eSAdam Thomson 	u8 a_d_btn_thr;
936d817c0eSAdam Thomson 	u8 d_b_btn_thr;
946d817c0eSAdam Thomson 	u8 b_c_btn_thr;
956d817c0eSAdam Thomson 	u8 c_mic_btn_thr;
966d817c0eSAdam Thomson 
976d817c0eSAdam Thomson 	enum da7219_aad_btn_avg btn_avg;
986d817c0eSAdam Thomson 	enum da7219_aad_adc_1bit_rpt adc_1bit_rpt;
996d817c0eSAdam Thomson };
1006d817c0eSAdam Thomson 
1016d817c0eSAdam Thomson #endif /* __DA7219_AAD_PDATA_H */
102