pdata.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 19
  27. #define WM8958_MBC_CUTOFF_REGS 20
  28. #define WM8958_MBC_COEFF_REGS 48
  29. /**
  30. * DRC configurations are specified with a label and a set of register
  31. * values to write (the enable bits will be ignored). At runtime an
  32. * enumerated control will be presented for each DRC block allowing
  33. * the user to choose the configration to use.
  34. *
  35. * Configurations may be generated by hand or by using the DRC control
  36. * panel provided by the WISCE - see http://www.wolfsonmicro.com/wisce/
  37. * for details.
  38. */
  39. struct wm8994_drc_cfg {
  40. const char *name;
  41. u16 regs[WM8994_DRC_REGS];
  42. };
  43. /**
  44. * ReTune Mobile configurations are specified with a label, sample
  45. * rate and set of values to write (the enable bits will be ignored).
  46. *
  47. * Configurations are expected to be generated using the ReTune Mobile
  48. * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/
  49. */
  50. struct wm8994_retune_mobile_cfg {
  51. const char *name;
  52. unsigned int rate;
  53. u16 regs[WM8994_EQ_REGS];
  54. };
  55. /**
  56. * Multiband compressor configurations are specified with a label and
  57. * two sets of values to write. Configurations are expected to be
  58. * generated using the multiband compressor configuration panel in
  59. * WISCE - see http://www.wolfsonmicro.com/wisce/
  60. */
  61. struct wm8958_mbc_cfg {
  62. const char *name;
  63. u16 cutoff_regs[WM8958_MBC_CUTOFF_REGS];
  64. u16 coeff_regs[WM8958_MBC_COEFF_REGS];
  65. };
  66. struct wm8994_pdata {
  67. int gpio_base;
  68. /**
  69. * Default values for GPIOs if non-zero, WM8994_CONFIGURE_GPIO
  70. * can be used for all zero values.
  71. */
  72. int gpio_defaults[WM8994_NUM_GPIO];
  73. struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO];
  74. int irq_base; /** Base IRQ number for WM8994, required for IRQs */
  75. int num_drc_cfgs;
  76. struct wm8994_drc_cfg *drc_cfgs;
  77. int num_retune_mobile_cfgs;
  78. struct wm8994_retune_mobile_cfg *retune_mobile_cfgs;
  79. int num_mbc_cfgs;
  80. struct wm8958_mbc_cfg *mbc_cfgs;
  81. /* LINEOUT can be differential or single ended */
  82. unsigned int lineout1_diff:1;
  83. unsigned int lineout2_diff:1;
  84. /* Common mode feedback */
  85. unsigned int lineout1fb:1;
  86. unsigned int lineout2fb:1;
  87. /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */
  88. unsigned int micbias1_lvl:1;
  89. unsigned int micbias2_lvl:1;
  90. /* Jack detect threashold levels, see datasheet for values */
  91. unsigned int jd_scthr:2;
  92. unsigned int jd_thr:2;
  93. };
  94. #endif