da7219-aad.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * da7219-aad.h - DA7322 ASoC Codec AAD Driver Platform Data
  3. *
  4. * Copyright (c) 2015 Dialog Semiconductor Ltd.
  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 __DA7219_AAD_PDATA_H
  14. #define __DA7219_AAD_PDATA_H
  15. enum da7219_aad_micbias_pulse_lvl {
  16. DA7219_AAD_MICBIAS_PULSE_LVL_OFF = 0,
  17. DA7219_AAD_MICBIAS_PULSE_LVL_2_8V = 6,
  18. DA7219_AAD_MICBIAS_PULSE_LVL_2_9V,
  19. };
  20. enum da7219_aad_btn_cfg {
  21. DA7219_AAD_BTN_CFG_2MS = 1,
  22. DA7219_AAD_BTN_CFG_5MS,
  23. DA7219_AAD_BTN_CFG_10MS,
  24. DA7219_AAD_BTN_CFG_50MS,
  25. DA7219_AAD_BTN_CFG_100MS,
  26. DA7219_AAD_BTN_CFG_200MS,
  27. DA7219_AAD_BTN_CFG_500MS,
  28. };
  29. enum da7219_aad_mic_det_thr {
  30. DA7219_AAD_MIC_DET_THR_200_OHMS = 0,
  31. DA7219_AAD_MIC_DET_THR_500_OHMS,
  32. DA7219_AAD_MIC_DET_THR_750_OHMS,
  33. DA7219_AAD_MIC_DET_THR_1000_OHMS,
  34. };
  35. enum da7219_aad_jack_ins_deb {
  36. DA7219_AAD_JACK_INS_DEB_5MS = 0,
  37. DA7219_AAD_JACK_INS_DEB_10MS,
  38. DA7219_AAD_JACK_INS_DEB_20MS,
  39. DA7219_AAD_JACK_INS_DEB_50MS,
  40. DA7219_AAD_JACK_INS_DEB_100MS,
  41. DA7219_AAD_JACK_INS_DEB_200MS,
  42. DA7219_AAD_JACK_INS_DEB_500MS,
  43. DA7219_AAD_JACK_INS_DEB_1S,
  44. };
  45. enum da7219_aad_jack_det_rate {
  46. DA7219_AAD_JACK_DET_RATE_32_64MS = 0,
  47. DA7219_AAD_JACK_DET_RATE_64_128MS,
  48. DA7219_AAD_JACK_DET_RATE_128_256MS,
  49. DA7219_AAD_JACK_DET_RATE_256_512MS,
  50. };
  51. enum da7219_aad_jack_rem_deb {
  52. DA7219_AAD_JACK_REM_DEB_1MS = 0,
  53. DA7219_AAD_JACK_REM_DEB_5MS,
  54. DA7219_AAD_JACK_REM_DEB_10MS,
  55. DA7219_AAD_JACK_REM_DEB_20MS,
  56. };
  57. enum da7219_aad_btn_avg {
  58. DA7219_AAD_BTN_AVG_1 = 0,
  59. DA7219_AAD_BTN_AVG_2,
  60. DA7219_AAD_BTN_AVG_4,
  61. DA7219_AAD_BTN_AVG_8,
  62. };
  63. enum da7219_aad_adc_1bit_rpt {
  64. DA7219_AAD_ADC_1BIT_RPT_1 = 0,
  65. DA7219_AAD_ADC_1BIT_RPT_2,
  66. DA7219_AAD_ADC_1BIT_RPT_4,
  67. DA7219_AAD_ADC_1BIT_RPT_8,
  68. };
  69. struct da7219_aad_pdata {
  70. int irq;
  71. enum da7219_aad_micbias_pulse_lvl micbias_pulse_lvl;
  72. u32 micbias_pulse_time;
  73. enum da7219_aad_btn_cfg btn_cfg;
  74. enum da7219_aad_mic_det_thr mic_det_thr;
  75. enum da7219_aad_jack_ins_deb jack_ins_deb;
  76. enum da7219_aad_jack_det_rate jack_det_rate;
  77. enum da7219_aad_jack_rem_deb jack_rem_deb;
  78. u8 a_d_btn_thr;
  79. u8 d_b_btn_thr;
  80. u8 b_c_btn_thr;
  81. u8 c_mic_btn_thr;
  82. enum da7219_aad_btn_avg btn_avg;
  83. enum da7219_aad_adc_1bit_rpt adc_1bit_rpt;
  84. };
  85. #endif /* __DA7219_AAD_PDATA_H */