pdata.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * Platform data for Arizona devices
  3. *
  4. * Copyright 2012 Wolfson Microelectronics. PLC.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef _ARIZONA_PDATA_H
  11. #define _ARIZONA_PDATA_H
  12. #define ARIZONA_GPN_DIR 0x8000 /* GPN_DIR */
  13. #define ARIZONA_GPN_DIR_MASK 0x8000 /* GPN_DIR */
  14. #define ARIZONA_GPN_DIR_SHIFT 15 /* GPN_DIR */
  15. #define ARIZONA_GPN_DIR_WIDTH 1 /* GPN_DIR */
  16. #define ARIZONA_GPN_PU 0x4000 /* GPN_PU */
  17. #define ARIZONA_GPN_PU_MASK 0x4000 /* GPN_PU */
  18. #define ARIZONA_GPN_PU_SHIFT 14 /* GPN_PU */
  19. #define ARIZONA_GPN_PU_WIDTH 1 /* GPN_PU */
  20. #define ARIZONA_GPN_PD 0x2000 /* GPN_PD */
  21. #define ARIZONA_GPN_PD_MASK 0x2000 /* GPN_PD */
  22. #define ARIZONA_GPN_PD_SHIFT 13 /* GPN_PD */
  23. #define ARIZONA_GPN_PD_WIDTH 1 /* GPN_PD */
  24. #define ARIZONA_GPN_LVL 0x0800 /* GPN_LVL */
  25. #define ARIZONA_GPN_LVL_MASK 0x0800 /* GPN_LVL */
  26. #define ARIZONA_GPN_LVL_SHIFT 11 /* GPN_LVL */
  27. #define ARIZONA_GPN_LVL_WIDTH 1 /* GPN_LVL */
  28. #define ARIZONA_GPN_POL 0x0400 /* GPN_POL */
  29. #define ARIZONA_GPN_POL_MASK 0x0400 /* GPN_POL */
  30. #define ARIZONA_GPN_POL_SHIFT 10 /* GPN_POL */
  31. #define ARIZONA_GPN_POL_WIDTH 1 /* GPN_POL */
  32. #define ARIZONA_GPN_OP_CFG 0x0200 /* GPN_OP_CFG */
  33. #define ARIZONA_GPN_OP_CFG_MASK 0x0200 /* GPN_OP_CFG */
  34. #define ARIZONA_GPN_OP_CFG_SHIFT 9 /* GPN_OP_CFG */
  35. #define ARIZONA_GPN_OP_CFG_WIDTH 1 /* GPN_OP_CFG */
  36. #define ARIZONA_GPN_DB 0x0100 /* GPN_DB */
  37. #define ARIZONA_GPN_DB_MASK 0x0100 /* GPN_DB */
  38. #define ARIZONA_GPN_DB_SHIFT 8 /* GPN_DB */
  39. #define ARIZONA_GPN_DB_WIDTH 1 /* GPN_DB */
  40. #define ARIZONA_GPN_FN_MASK 0x007F /* GPN_FN - [6:0] */
  41. #define ARIZONA_GPN_FN_SHIFT 0 /* GPN_FN - [6:0] */
  42. #define ARIZONA_GPN_FN_WIDTH 7 /* GPN_FN - [6:0] */
  43. #define ARIZONA_MAX_GPIO 5
  44. #define ARIZONA_32KZ_MCLK1 1
  45. #define ARIZONA_32KZ_MCLK2 2
  46. #define ARIZONA_32KZ_NONE 3
  47. #define ARIZONA_MAX_INPUT 4
  48. #define ARIZONA_DMIC_MICVDD 0
  49. #define ARIZONA_DMIC_MICBIAS1 1
  50. #define ARIZONA_DMIC_MICBIAS2 2
  51. #define ARIZONA_DMIC_MICBIAS3 3
  52. #define ARIZONA_INMODE_DIFF 0
  53. #define ARIZONA_INMODE_SE 1
  54. #define ARIZONA_INMODE_DMIC 2
  55. #define ARIZONA_MAX_OUTPUT 6
  56. #define ARIZONA_HAP_ACT_ERM 0
  57. #define ARIZONA_HAP_ACT_LRA 2
  58. #define ARIZONA_MAX_PDM_SPK 2
  59. struct regulator_init_data;
  60. struct arizona_micd_config {
  61. unsigned int src;
  62. unsigned int bias;
  63. bool gpio;
  64. };
  65. struct arizona_pdata {
  66. int reset; /** GPIO controlling /RESET, if any */
  67. int ldoena; /** GPIO controlling LODENA, if any */
  68. /** Regulator configuration for MICVDD */
  69. struct regulator_init_data *micvdd;
  70. /** Regulator configuration for LDO1 */
  71. struct regulator_init_data *ldo1;
  72. /** If a direct 32kHz clock is provided on an MCLK specify it here */
  73. int clk32k_src;
  74. bool irq_active_high; /** IRQ polarity */
  75. /* Base GPIO */
  76. int gpio_base;
  77. /** Pin state for GPIO pins */
  78. int gpio_defaults[ARIZONA_MAX_GPIO];
  79. /** GPIO for mic detection polarity */
  80. int micd_pol_gpio;
  81. /** Mic detect ramp rate */
  82. int micd_bias_start_time;
  83. /** Headset polarity configurations */
  84. struct arizona_micd_config *micd_configs;
  85. int num_micd_configs;
  86. /** Reference voltage for DMIC inputs */
  87. int dmic_ref[ARIZONA_MAX_INPUT];
  88. /** Mode of input structures */
  89. int inmode[ARIZONA_MAX_INPUT];
  90. /** Mode for outputs */
  91. bool out_mono[ARIZONA_MAX_OUTPUT];
  92. /** PDM speaker mute setting */
  93. unsigned int spk_mute[ARIZONA_MAX_PDM_SPK];
  94. /** PDM speaker format */
  95. unsigned int spk_fmt[ARIZONA_MAX_PDM_SPK];
  96. /** Haptic actuator type */
  97. unsigned int hap_act;
  98. };
  99. #endif