board-mop500-regulators.c 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /*
  2. * Copyright (C) ST-Ericsson SA 2010
  3. *
  4. * License Terms: GNU General Public License v2
  5. *
  6. * Authors: Sundar Iyer <sundar.iyer@stericsson.com>
  7. * Bengt Jonsson <bengt.g.jonsson@stericsson.com>
  8. *
  9. * MOP500 board specific initialization for regulators
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/regulator/machine.h>
  13. #include <linux/regulator/ab8500.h>
  14. #include "board-mop500-regulators.h"
  15. static struct regulator_consumer_supply ab8500_vaux1_consumers[] = {
  16. /* External displays, connector on board 2v5 power supply */
  17. REGULATOR_SUPPLY("vaux12v5", "mcde.0"),
  18. /* SFH7741 proximity sensor */
  19. REGULATOR_SUPPLY("vcc", "gpio-keys.0"),
  20. /* BH1780GLS ambient light sensor */
  21. REGULATOR_SUPPLY("vcc", "2-0029"),
  22. /* lsm303dlh accelerometer */
  23. REGULATOR_SUPPLY("vdd", "3-0018"),
  24. /* lsm303dlh magnetometer */
  25. REGULATOR_SUPPLY("vdd", "3-001e"),
  26. /* Rohm BU21013 Touchscreen devices */
  27. REGULATOR_SUPPLY("avdd", "3-005c"),
  28. REGULATOR_SUPPLY("avdd", "3-005d"),
  29. /* Synaptics RMI4 Touchscreen device */
  30. REGULATOR_SUPPLY("vdd", "3-004b"),
  31. };
  32. static struct regulator_consumer_supply ab8500_vaux2_consumers[] = {
  33. /* On-board eMMC power */
  34. REGULATOR_SUPPLY("vmmc", "sdi4"),
  35. /* AB8500 audio codec */
  36. REGULATOR_SUPPLY("vcc-N2158", "ab8500-codec.0"),
  37. };
  38. static struct regulator_consumer_supply ab8500_vaux3_consumers[] = {
  39. /* External MMC slot power */
  40. REGULATOR_SUPPLY("vmmc", "sdi0"),
  41. };
  42. static struct regulator_consumer_supply ab8500_vtvout_consumers[] = {
  43. /* TV-out DENC supply */
  44. REGULATOR_SUPPLY("vtvout", "ab8500-denc.0"),
  45. /* Internal general-purpose ADC */
  46. REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"),
  47. };
  48. static struct regulator_consumer_supply ab8500_vintcore_consumers[] = {
  49. /* SoC core supply, no device */
  50. REGULATOR_SUPPLY("v-intcore", NULL),
  51. /* USB Transciever */
  52. REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"),
  53. };
  54. static struct regulator_consumer_supply ab8500_vana_consumers[] = {
  55. /* External displays, connector on board, 1v8 power supply */
  56. REGULATOR_SUPPLY("vsmps2", "mcde.0"),
  57. };
  58. /* AB8500 regulators */
  59. struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
  60. /* supplies to the display/camera */
  61. [AB8500_LDO_AUX1] = {
  62. .constraints = {
  63. .name = "V-DISPLAY",
  64. .min_uV = 2500000,
  65. .max_uV = 2900000,
  66. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
  67. REGULATOR_CHANGE_STATUS,
  68. },
  69. .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux1_consumers),
  70. .consumer_supplies = ab8500_vaux1_consumers,
  71. },
  72. /* supplies to the on-board eMMC */
  73. [AB8500_LDO_AUX2] = {
  74. .constraints = {
  75. .name = "V-eMMC1",
  76. .min_uV = 1100000,
  77. .max_uV = 3300000,
  78. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
  79. REGULATOR_CHANGE_STATUS,
  80. },
  81. .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux2_consumers),
  82. .consumer_supplies = ab8500_vaux2_consumers,
  83. },
  84. /* supply for VAUX3, supplies to SDcard slots */
  85. [AB8500_LDO_AUX3] = {
  86. .constraints = {
  87. .name = "V-MMC-SD",
  88. .min_uV = 1100000,
  89. .max_uV = 3300000,
  90. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
  91. REGULATOR_CHANGE_STATUS,
  92. },
  93. .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux3_consumers),
  94. .consumer_supplies = ab8500_vaux3_consumers,
  95. },
  96. /* supply for tvout, gpadc, TVOUT LDO */
  97. [AB8500_LDO_TVOUT] = {
  98. .constraints = {
  99. .name = "V-TVOUT",
  100. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  101. },
  102. .num_consumer_supplies = ARRAY_SIZE(ab8500_vtvout_consumers),
  103. .consumer_supplies = ab8500_vtvout_consumers,
  104. },
  105. /* supply for ab8500-vaudio, VAUDIO LDO */
  106. [AB8500_LDO_AUDIO] = {
  107. .constraints = {
  108. .name = "V-AUD",
  109. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  110. },
  111. },
  112. /* supply for v-anamic1 VAMic1-LDO */
  113. [AB8500_LDO_ANAMIC1] = {
  114. .constraints = {
  115. .name = "V-AMIC1",
  116. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  117. },
  118. },
  119. /* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */
  120. [AB8500_LDO_ANAMIC2] = {
  121. .constraints = {
  122. .name = "V-AMIC2",
  123. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  124. },
  125. },
  126. /* supply for v-dmic, VDMIC LDO */
  127. [AB8500_LDO_DMIC] = {
  128. .constraints = {
  129. .name = "V-DMIC",
  130. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  131. },
  132. },
  133. /* supply for v-intcore12, VINTCORE12 LDO */
  134. [AB8500_LDO_INTCORE] = {
  135. .constraints = {
  136. .name = "V-INTCORE",
  137. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  138. },
  139. .num_consumer_supplies = ARRAY_SIZE(ab8500_vintcore_consumers),
  140. .consumer_supplies = ab8500_vintcore_consumers,
  141. },
  142. /* supply for U8500 CSI/DSI, VANA LDO */
  143. [AB8500_LDO_ANA] = {
  144. .constraints = {
  145. .name = "V-CSI/DSI",
  146. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  147. },
  148. .num_consumer_supplies = ARRAY_SIZE(ab8500_vana_consumers),
  149. .consumer_supplies = ab8500_vana_consumers,
  150. },
  151. };