da7218.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * da7218.h - DA7218 ASoC Codec Driver Platform Data
  3. *
  4. * Copyright (c) 2015 Dialog Semiconductor
  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. #ifndef _DA7218_PDATA_H
  14. #define _DA7218_PDATA_H
  15. /* Mic Bias */
  16. enum da7218_micbias_voltage {
  17. DA7218_MICBIAS_1_2V = -1,
  18. DA7218_MICBIAS_1_6V,
  19. DA7218_MICBIAS_1_8V,
  20. DA7218_MICBIAS_2_0V,
  21. DA7218_MICBIAS_2_2V,
  22. DA7218_MICBIAS_2_4V,
  23. DA7218_MICBIAS_2_6V,
  24. DA7218_MICBIAS_2_8V,
  25. DA7218_MICBIAS_3_0V,
  26. };
  27. enum da7218_mic_amp_in_sel {
  28. DA7218_MIC_AMP_IN_SEL_DIFF = 0,
  29. DA7218_MIC_AMP_IN_SEL_SE_P,
  30. DA7218_MIC_AMP_IN_SEL_SE_N,
  31. };
  32. /* DMIC */
  33. enum da7218_dmic_data_sel {
  34. DA7218_DMIC_DATA_LRISE_RFALL = 0,
  35. DA7218_DMIC_DATA_LFALL_RRISE,
  36. };
  37. enum da7218_dmic_samplephase {
  38. DA7218_DMIC_SAMPLE_ON_CLKEDGE = 0,
  39. DA7218_DMIC_SAMPLE_BETWEEN_CLKEDGE,
  40. };
  41. enum da7218_dmic_clk_rate {
  42. DA7218_DMIC_CLK_3_0MHZ = 0,
  43. DA7218_DMIC_CLK_1_5MHZ,
  44. };
  45. /* Headphone Detect */
  46. enum da7218_hpldet_jack_rate {
  47. DA7218_HPLDET_JACK_RATE_5US = 0,
  48. DA7218_HPLDET_JACK_RATE_10US,
  49. DA7218_HPLDET_JACK_RATE_20US,
  50. DA7218_HPLDET_JACK_RATE_40US,
  51. DA7218_HPLDET_JACK_RATE_80US,
  52. DA7218_HPLDET_JACK_RATE_160US,
  53. DA7218_HPLDET_JACK_RATE_320US,
  54. DA7218_HPLDET_JACK_RATE_640US,
  55. };
  56. enum da7218_hpldet_jack_debounce {
  57. DA7218_HPLDET_JACK_DEBOUNCE_OFF = 0,
  58. DA7218_HPLDET_JACK_DEBOUNCE_2,
  59. DA7218_HPLDET_JACK_DEBOUNCE_3,
  60. DA7218_HPLDET_JACK_DEBOUNCE_4,
  61. };
  62. enum da7218_hpldet_jack_thr {
  63. DA7218_HPLDET_JACK_THR_84PCT = 0,
  64. DA7218_HPLDET_JACK_THR_88PCT,
  65. DA7218_HPLDET_JACK_THR_92PCT,
  66. DA7218_HPLDET_JACK_THR_96PCT,
  67. };
  68. struct da7218_hpldet_pdata {
  69. enum da7218_hpldet_jack_rate jack_rate;
  70. enum da7218_hpldet_jack_debounce jack_debounce;
  71. enum da7218_hpldet_jack_thr jack_thr;
  72. bool comp_inv;
  73. bool hyst;
  74. bool discharge;
  75. };
  76. struct da7218_pdata {
  77. /* Mic */
  78. enum da7218_micbias_voltage micbias1_lvl;
  79. enum da7218_micbias_voltage micbias2_lvl;
  80. enum da7218_mic_amp_in_sel mic1_amp_in_sel;
  81. enum da7218_mic_amp_in_sel mic2_amp_in_sel;
  82. /* DMIC */
  83. enum da7218_dmic_data_sel dmic1_data_sel;
  84. enum da7218_dmic_data_sel dmic2_data_sel;
  85. enum da7218_dmic_samplephase dmic1_samplephase;
  86. enum da7218_dmic_samplephase dmic2_samplephase;
  87. enum da7218_dmic_clk_rate dmic1_clk_rate;
  88. enum da7218_dmic_clk_rate dmic2_clk_rate;
  89. /* HP Diff Supply - DA7217 only */
  90. bool hp_diff_single_supply;
  91. /* HP Detect - DA7218 only */
  92. struct da7218_hpldet_pdata *hpldet_pdata;
  93. };
  94. #endif /* _DA7218_PDATA_H */