adau17x1.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. * Driver for ADAU1761/ADAU1461/ADAU1761/ADAU1961/ADAU1781/ADAU1781 codecs
  3. *
  4. * Copyright 2011-2014 Analog Devices Inc.
  5. * Author: Lars-Peter Clausen <lars@metafoo.de>
  6. *
  7. * Licensed under the GPL-2 or later.
  8. */
  9. #ifndef __LINUX_PLATFORM_DATA_ADAU17X1_H__
  10. #define __LINUX_PLATFORM_DATA_ADAU17X1_H__
  11. /**
  12. * enum adau17x1_micbias_voltage - Microphone bias voltage
  13. * @ADAU17X1_MICBIAS_0_90_AVDD: 0.9 * AVDD
  14. * @ADAU17X1_MICBIAS_0_65_AVDD: 0.65 * AVDD
  15. */
  16. enum adau17x1_micbias_voltage {
  17. ADAU17X1_MICBIAS_0_90_AVDD = 0,
  18. ADAU17X1_MICBIAS_0_65_AVDD = 1,
  19. };
  20. /**
  21. * enum adau1761_digmic_jackdet_pin_mode - Configuration of the JACKDET/MICIN pin
  22. * @ADAU1761_DIGMIC_JACKDET_PIN_MODE_NONE: Disable the pin
  23. * @ADAU1761_DIGMIC_JACKDET_PIN_MODE_DIGMIC: Configure the pin for usage as
  24. * digital microphone input.
  25. * @ADAU1761_DIGMIC_JACKDET_PIN_MODE_JACKDETECT: Configure the pin for jack
  26. * insertion detection.
  27. */
  28. enum adau1761_digmic_jackdet_pin_mode {
  29. ADAU1761_DIGMIC_JACKDET_PIN_MODE_NONE,
  30. ADAU1761_DIGMIC_JACKDET_PIN_MODE_DIGMIC,
  31. ADAU1761_DIGMIC_JACKDET_PIN_MODE_JACKDETECT,
  32. };
  33. /**
  34. * adau1761_jackdetect_debounce_time - Jack insertion detection debounce time
  35. * @ADAU1761_JACKDETECT_DEBOUNCE_5MS: 5 milliseconds
  36. * @ADAU1761_JACKDETECT_DEBOUNCE_10MS: 10 milliseconds
  37. * @ADAU1761_JACKDETECT_DEBOUNCE_20MS: 20 milliseconds
  38. * @ADAU1761_JACKDETECT_DEBOUNCE_40MS: 40 milliseconds
  39. */
  40. enum adau1761_jackdetect_debounce_time {
  41. ADAU1761_JACKDETECT_DEBOUNCE_5MS = 0,
  42. ADAU1761_JACKDETECT_DEBOUNCE_10MS = 1,
  43. ADAU1761_JACKDETECT_DEBOUNCE_20MS = 2,
  44. ADAU1761_JACKDETECT_DEBOUNCE_40MS = 3,
  45. };
  46. /**
  47. * enum adau1761_output_mode - Output mode configuration
  48. * @ADAU1761_OUTPUT_MODE_HEADPHONE: Headphone output
  49. * @ADAU1761_OUTPUT_MODE_HEADPHONE_CAPLESS: Capless headphone output
  50. * @ADAU1761_OUTPUT_MODE_LINE: Line output
  51. */
  52. enum adau1761_output_mode {
  53. ADAU1761_OUTPUT_MODE_HEADPHONE,
  54. ADAU1761_OUTPUT_MODE_HEADPHONE_CAPLESS,
  55. ADAU1761_OUTPUT_MODE_LINE,
  56. };
  57. /**
  58. * struct adau1761_platform_data - ADAU1761 Codec driver platform data
  59. * @input_differential: If true the input pins will be configured in
  60. * differential mode.
  61. * @lineout_mode: Output mode for the LOUT/ROUT pins
  62. * @headphone_mode: Output mode for the LHP/RHP pins
  63. * @digmic_jackdetect_pin_mode: JACKDET/MICIN pin configuration
  64. * @jackdetect_debounce_time: Jack insertion detection debounce time.
  65. * Note: This value will only be used, if the JACKDET/MICIN pin is configured
  66. * for jack insertion detection.
  67. * @jackdetect_active_low: If true the jack insertion detection is active low.
  68. * Othwise it will be active high.
  69. * @micbias_voltage: Microphone voltage bias
  70. */
  71. struct adau1761_platform_data {
  72. bool input_differential;
  73. enum adau1761_output_mode lineout_mode;
  74. enum adau1761_output_mode headphone_mode;
  75. enum adau1761_digmic_jackdet_pin_mode digmic_jackdetect_pin_mode;
  76. enum adau1761_jackdetect_debounce_time jackdetect_debounce_time;
  77. bool jackdetect_active_low;
  78. enum adau17x1_micbias_voltage micbias_voltage;
  79. };
  80. /**
  81. * struct adau1781_platform_data - ADAU1781 Codec driver platform data
  82. * @left_input_differential: If true configure the left input as
  83. * differential input.
  84. * @right_input_differential: If true configure the right input as differntial
  85. * input.
  86. * @use_dmic: If true configure the MIC pins as digital microphone pins instead
  87. * of analog microphone pins.
  88. * @micbias_voltage: Microphone voltage bias
  89. */
  90. struct adau1781_platform_data {
  91. bool left_input_differential;
  92. bool right_input_differential;
  93. bool use_dmic;
  94. enum adau17x1_micbias_voltage micbias_voltage;
  95. };
  96. #endif