pdata.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * include/linux/mfd/wm8994/pdata.h -- Platform data for WM8994
  3. *
  4. * Copyright 2009 Wolfson Microelectronics PLC.
  5. *
  6. * Author: Mark Brown <broonie@opensource.wolfsonmicro.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. */
  14. #ifndef __MFD_WM8994_PDATA_H__
  15. #define __MFD_WM8994_PDATA_H__
  16. #define WM8994_NUM_LDO 2
  17. #define WM8994_NUM_GPIO 11
  18. struct wm8994_ldo_pdata {
  19. /** GPIOs to enable regulator, 0 or less if not available */
  20. int enable;
  21. const char *supply;
  22. struct regulator_init_data *init_data;
  23. };
  24. #define WM8994_CONFIGURE_GPIO 0x8000
  25. #define WM8994_DRC_REGS 5
  26. #define WM8994_EQ_REGS 20
  27. #define WM8958_MBC_CUTOFF_REGS 20
  28. #define WM8958_MBC_COEFF_REGS 48
  29. #define WM8958_MBC_COMBINED_REGS 56
  30. #define WM8958_VSS_HPF_REGS 2
  31. #define WM8958_VSS_REGS 148
  32. /**
  33. * DRC configurations are specified with a label and a set of register
  34. * values to write (the enable bits will be ignored). At runtime an
  35. * enumerated control will be presented for each DRC block allowing
  36. * the user to choose the configration to use.
  37. *
  38. * Configurations may be generated by hand or by using the DRC control
  39. * panel provided by the WISCE - see http://www.wolfsonmicro.com/wisce/
  40. * for details.
  41. */
  42. struct wm8994_drc_cfg {
  43. const char *name;
  44. u16 regs[WM8994_DRC_REGS];
  45. };
  46. /**
  47. * ReTune Mobile configurations are specified with a label, sample
  48. * rate and set of values to write (the enable bits will be ignored).
  49. *
  50. * Configurations are expected to be generated using the ReTune Mobile
  51. * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/
  52. */
  53. struct wm8994_retune_mobile_cfg {
  54. const char *name;
  55. unsigned int rate;
  56. u16 regs[WM8994_EQ_REGS];
  57. };
  58. /**
  59. * Multiband compressor configurations are specified with a label and
  60. * two sets of values to write. Configurations are expected to be
  61. * generated using the multiband compressor configuration panel in
  62. * WISCE - see http://www.wolfsonmicro.com/wisce/
  63. */
  64. struct wm8958_mbc_cfg {
  65. const char *name;
  66. u16 cutoff_regs[WM8958_MBC_CUTOFF_REGS];
  67. u16 coeff_regs[WM8958_MBC_COEFF_REGS];
  68. /* Coefficient layout when using MBC+VSS firmware */
  69. u16 combined_regs[WM8958_MBC_COMBINED_REGS];
  70. };
  71. /**
  72. * VSS HPF configurations are specified with a label and two values to
  73. * write. Configurations are expected to be generated using the
  74. * multiband compressor configuration panel in WISCE - see
  75. * http://www.wolfsonmicro.com/wisce/
  76. */
  77. struct wm8958_vss_hpf_cfg {
  78. const char *name;
  79. u16 regs[WM8958_VSS_HPF_REGS];
  80. };
  81. /**
  82. * VSS configurations are specified with a label and array of values
  83. * to write. Configurations are expected to be generated using the
  84. * multiband compressor configuration panel in WISCE - see
  85. * http://www.wolfsonmicro.com/wisce/
  86. */
  87. struct wm8958_vss_cfg {
  88. const char *name;
  89. u16 regs[WM8958_VSS_REGS];
  90. };
  91. struct wm8994_pdata {
  92. int gpio_base;
  93. /**
  94. * Default values for GPIOs if non-zero, WM8994_CONFIGURE_GPIO
  95. * can be used for all zero values.
  96. */
  97. int gpio_defaults[WM8994_NUM_GPIO];
  98. struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO];
  99. int irq_base; /** Base IRQ number for WM8994, required for IRQs */
  100. int num_drc_cfgs;
  101. struct wm8994_drc_cfg *drc_cfgs;
  102. int num_retune_mobile_cfgs;
  103. struct wm8994_retune_mobile_cfg *retune_mobile_cfgs;
  104. int num_mbc_cfgs;
  105. struct wm8958_mbc_cfg *mbc_cfgs;
  106. int num_vss_cfgs;
  107. struct wm8958_vss_cfg *vss_cfgs;
  108. int num_vss_hpf_cfgs;
  109. struct wm8958_vss_hpf_cfg *vss_hpf_cfgs;
  110. /* LINEOUT can be differential or single ended */
  111. unsigned int lineout1_diff:1;
  112. unsigned int lineout2_diff:1;
  113. /* Common mode feedback */
  114. unsigned int lineout1fb:1;
  115. unsigned int lineout2fb:1;
  116. /* IRQ for microphone detection if brought out directly as a
  117. * signal.
  118. */
  119. int micdet_irq;
  120. /* WM8994 microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */
  121. unsigned int micbias1_lvl:1;
  122. unsigned int micbias2_lvl:1;
  123. /* WM8994 jack detect threashold levels, see datasheet for values */
  124. unsigned int jd_scthr:2;
  125. unsigned int jd_thr:2;
  126. /* WM8958 microphone bias configuration */
  127. int micbias[2];
  128. };
  129. #endif