pdata.h 2.7 KB

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