1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * da7218.h - DA7218 ASoC Codec Driver Platform Data
5 * Copyright (c) 2015 Dialog Semiconductor
7 * Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
10 #ifndef _DA7218_PDATA_H
11 #define _DA7218_PDATA_H
14 enum da7218_micbias_voltage {
15 DA7218_MICBIAS_1_2V = -1,
26 enum da7218_mic_amp_in_sel {
27 DA7218_MIC_AMP_IN_SEL_DIFF = 0,
28 DA7218_MIC_AMP_IN_SEL_SE_P,
29 DA7218_MIC_AMP_IN_SEL_SE_N,
33 enum da7218_dmic_data_sel {
34 DA7218_DMIC_DATA_LRISE_RFALL = 0,
35 DA7218_DMIC_DATA_LFALL_RRISE,
38 enum da7218_dmic_samplephase {
39 DA7218_DMIC_SAMPLE_ON_CLKEDGE = 0,
40 DA7218_DMIC_SAMPLE_BETWEEN_CLKEDGE,
43 enum da7218_dmic_clk_rate {
44 DA7218_DMIC_CLK_3_0MHZ = 0,
45 DA7218_DMIC_CLK_1_5MHZ,
48 /* Headphone Detect */
49 enum da7218_hpldet_jack_rate {
50 DA7218_HPLDET_JACK_RATE_5US = 0,
51 DA7218_HPLDET_JACK_RATE_10US,
52 DA7218_HPLDET_JACK_RATE_20US,
53 DA7218_HPLDET_JACK_RATE_40US,
54 DA7218_HPLDET_JACK_RATE_80US,
55 DA7218_HPLDET_JACK_RATE_160US,
56 DA7218_HPLDET_JACK_RATE_320US,
57 DA7218_HPLDET_JACK_RATE_640US,
60 enum da7218_hpldet_jack_debounce {
61 DA7218_HPLDET_JACK_DEBOUNCE_OFF = 0,
62 DA7218_HPLDET_JACK_DEBOUNCE_2,
63 DA7218_HPLDET_JACK_DEBOUNCE_3,
64 DA7218_HPLDET_JACK_DEBOUNCE_4,
67 enum da7218_hpldet_jack_thr {
68 DA7218_HPLDET_JACK_THR_84PCT = 0,
69 DA7218_HPLDET_JACK_THR_88PCT,
70 DA7218_HPLDET_JACK_THR_92PCT,
71 DA7218_HPLDET_JACK_THR_96PCT,
74 struct da7218_hpldet_pdata {
75 enum da7218_hpldet_jack_rate jack_rate;
76 enum da7218_hpldet_jack_debounce jack_debounce;
77 enum da7218_hpldet_jack_thr jack_thr;
85 enum da7218_micbias_voltage micbias1_lvl;
86 enum da7218_micbias_voltage micbias2_lvl;
87 enum da7218_mic_amp_in_sel mic1_amp_in_sel;
88 enum da7218_mic_amp_in_sel mic2_amp_in_sel;
91 enum da7218_dmic_data_sel dmic1_data_sel;
92 enum da7218_dmic_data_sel dmic2_data_sel;
93 enum da7218_dmic_samplephase dmic1_samplephase;
94 enum da7218_dmic_samplephase dmic2_samplephase;
95 enum da7218_dmic_clk_rate dmic1_clk_rate;
96 enum da7218_dmic_clk_rate dmic2_clk_rate;
98 /* HP Diff Supply - DA7217 only */
99 bool hp_diff_single_supply;
101 /* HP Detect - DA7218 only */
102 struct da7218_hpldet_pdata *hpldet_pdata;
105 #endif /* _DA7218_PDATA_H */