12874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 24d50934aSAdam Thomson /* 34d50934aSAdam Thomson * da7218.h - DA7218 ASoC Codec Driver Platform Data 44d50934aSAdam Thomson * 54d50934aSAdam Thomson * Copyright (c) 2015 Dialog Semiconductor 64d50934aSAdam Thomson * 74d50934aSAdam Thomson * Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> 84d50934aSAdam Thomson */ 94d50934aSAdam Thomson 104d50934aSAdam Thomson #ifndef _DA7218_PDATA_H 114d50934aSAdam Thomson #define _DA7218_PDATA_H 124d50934aSAdam Thomson 134d50934aSAdam Thomson /* Mic Bias */ 144d50934aSAdam Thomson enum da7218_micbias_voltage { 154d50934aSAdam Thomson DA7218_MICBIAS_1_2V = -1, 164d50934aSAdam Thomson DA7218_MICBIAS_1_6V, 174d50934aSAdam Thomson DA7218_MICBIAS_1_8V, 184d50934aSAdam Thomson DA7218_MICBIAS_2_0V, 194d50934aSAdam Thomson DA7218_MICBIAS_2_2V, 204d50934aSAdam Thomson DA7218_MICBIAS_2_4V, 214d50934aSAdam Thomson DA7218_MICBIAS_2_6V, 224d50934aSAdam Thomson DA7218_MICBIAS_2_8V, 234d50934aSAdam Thomson DA7218_MICBIAS_3_0V, 244d50934aSAdam Thomson }; 254d50934aSAdam Thomson 264d50934aSAdam Thomson enum da7218_mic_amp_in_sel { 274d50934aSAdam Thomson DA7218_MIC_AMP_IN_SEL_DIFF = 0, 284d50934aSAdam Thomson DA7218_MIC_AMP_IN_SEL_SE_P, 294d50934aSAdam Thomson DA7218_MIC_AMP_IN_SEL_SE_N, 304d50934aSAdam Thomson }; 314d50934aSAdam Thomson 324d50934aSAdam Thomson /* DMIC */ 334d50934aSAdam Thomson enum da7218_dmic_data_sel { 344d50934aSAdam Thomson DA7218_DMIC_DATA_LRISE_RFALL = 0, 354d50934aSAdam Thomson DA7218_DMIC_DATA_LFALL_RRISE, 364d50934aSAdam Thomson }; 374d50934aSAdam Thomson 384d50934aSAdam Thomson enum da7218_dmic_samplephase { 394d50934aSAdam Thomson DA7218_DMIC_SAMPLE_ON_CLKEDGE = 0, 404d50934aSAdam Thomson DA7218_DMIC_SAMPLE_BETWEEN_CLKEDGE, 414d50934aSAdam Thomson }; 424d50934aSAdam Thomson 434d50934aSAdam Thomson enum da7218_dmic_clk_rate { 444d50934aSAdam Thomson DA7218_DMIC_CLK_3_0MHZ = 0, 454d50934aSAdam Thomson DA7218_DMIC_CLK_1_5MHZ, 464d50934aSAdam Thomson }; 474d50934aSAdam Thomson 484d50934aSAdam Thomson /* Headphone Detect */ 494d50934aSAdam Thomson enum da7218_hpldet_jack_rate { 504d50934aSAdam Thomson DA7218_HPLDET_JACK_RATE_5US = 0, 514d50934aSAdam Thomson DA7218_HPLDET_JACK_RATE_10US, 524d50934aSAdam Thomson DA7218_HPLDET_JACK_RATE_20US, 534d50934aSAdam Thomson DA7218_HPLDET_JACK_RATE_40US, 544d50934aSAdam Thomson DA7218_HPLDET_JACK_RATE_80US, 554d50934aSAdam Thomson DA7218_HPLDET_JACK_RATE_160US, 564d50934aSAdam Thomson DA7218_HPLDET_JACK_RATE_320US, 574d50934aSAdam Thomson DA7218_HPLDET_JACK_RATE_640US, 584d50934aSAdam Thomson }; 594d50934aSAdam Thomson 604d50934aSAdam Thomson enum da7218_hpldet_jack_debounce { 614d50934aSAdam Thomson DA7218_HPLDET_JACK_DEBOUNCE_OFF = 0, 624d50934aSAdam Thomson DA7218_HPLDET_JACK_DEBOUNCE_2, 634d50934aSAdam Thomson DA7218_HPLDET_JACK_DEBOUNCE_3, 644d50934aSAdam Thomson DA7218_HPLDET_JACK_DEBOUNCE_4, 654d50934aSAdam Thomson }; 664d50934aSAdam Thomson 674d50934aSAdam Thomson enum da7218_hpldet_jack_thr { 684d50934aSAdam Thomson DA7218_HPLDET_JACK_THR_84PCT = 0, 694d50934aSAdam Thomson DA7218_HPLDET_JACK_THR_88PCT, 704d50934aSAdam Thomson DA7218_HPLDET_JACK_THR_92PCT, 714d50934aSAdam Thomson DA7218_HPLDET_JACK_THR_96PCT, 724d50934aSAdam Thomson }; 734d50934aSAdam Thomson 744d50934aSAdam Thomson struct da7218_hpldet_pdata { 754d50934aSAdam Thomson enum da7218_hpldet_jack_rate jack_rate; 764d50934aSAdam Thomson enum da7218_hpldet_jack_debounce jack_debounce; 774d50934aSAdam Thomson enum da7218_hpldet_jack_thr jack_thr; 784d50934aSAdam Thomson bool comp_inv; 794d50934aSAdam Thomson bool hyst; 804d50934aSAdam Thomson bool discharge; 814d50934aSAdam Thomson }; 824d50934aSAdam Thomson 834d50934aSAdam Thomson struct da7218_pdata { 844d50934aSAdam Thomson /* Mic */ 854d50934aSAdam Thomson enum da7218_micbias_voltage micbias1_lvl; 864d50934aSAdam Thomson enum da7218_micbias_voltage micbias2_lvl; 874d50934aSAdam Thomson enum da7218_mic_amp_in_sel mic1_amp_in_sel; 884d50934aSAdam Thomson enum da7218_mic_amp_in_sel mic2_amp_in_sel; 894d50934aSAdam Thomson 904d50934aSAdam Thomson /* DMIC */ 914d50934aSAdam Thomson enum da7218_dmic_data_sel dmic1_data_sel; 924d50934aSAdam Thomson enum da7218_dmic_data_sel dmic2_data_sel; 934d50934aSAdam Thomson enum da7218_dmic_samplephase dmic1_samplephase; 944d50934aSAdam Thomson enum da7218_dmic_samplephase dmic2_samplephase; 954d50934aSAdam Thomson enum da7218_dmic_clk_rate dmic1_clk_rate; 964d50934aSAdam Thomson enum da7218_dmic_clk_rate dmic2_clk_rate; 974d50934aSAdam Thomson 984d50934aSAdam Thomson /* HP Diff Supply - DA7217 only */ 994d50934aSAdam Thomson bool hp_diff_single_supply; 1004d50934aSAdam Thomson 1014d50934aSAdam Thomson /* HP Detect - DA7218 only */ 1024d50934aSAdam Thomson struct da7218_hpldet_pdata *hpldet_pdata; 1034d50934aSAdam Thomson }; 1044d50934aSAdam Thomson 1054d50934aSAdam Thomson #endif /* _DA7218_PDATA_H */ 106