s2mps11.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /*
  2. * s2mps11.h
  3. *
  4. * Copyright (c) 2012 Samsung Electronics Co., Ltd
  5. * http://www.samsung.com
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version.
  11. *
  12. */
  13. #ifndef __LINUX_MFD_S2MPS11_H
  14. #define __LINUX_MFD_S2MPS11_H
  15. /* S2MPS11 registers */
  16. enum s2mps11_reg {
  17. S2MPS11_REG_ID,
  18. S2MPS11_REG_INT1,
  19. S2MPS11_REG_INT2,
  20. S2MPS11_REG_INT3,
  21. S2MPS11_REG_INT1M,
  22. S2MPS11_REG_INT2M,
  23. S2MPS11_REG_INT3M,
  24. S2MPS11_REG_ST1,
  25. S2MPS11_REG_ST2,
  26. S2MPS11_REG_OFFSRC,
  27. S2MPS11_REG_PWRONSRC,
  28. S2MPS11_REG_RTC_CTRL,
  29. S2MPS11_REG_CTRL1,
  30. S2MPS11_REG_ETC_TEST,
  31. S2MPS11_REG_RSVD3,
  32. S2MPS11_REG_BU_CHG,
  33. S2MPS11_REG_RAMP,
  34. S2MPS11_REG_RAMP_BUCK,
  35. S2MPS11_REG_LDO1_8,
  36. S2MPS11_REG_LDO9_16,
  37. S2MPS11_REG_LDO17_24,
  38. S2MPS11_REG_LDO25_32,
  39. S2MPS11_REG_LDO33_38,
  40. S2MPS11_REG_LDO1_8_1,
  41. S2MPS11_REG_LDO9_16_1,
  42. S2MPS11_REG_LDO17_24_1,
  43. S2MPS11_REG_LDO25_32_1,
  44. S2MPS11_REG_LDO33_38_1,
  45. S2MPS11_REG_OTP_ADRL,
  46. S2MPS11_REG_OTP_ADRH,
  47. S2MPS11_REG_OTP_DATA,
  48. S2MPS11_REG_MON1SEL,
  49. S2MPS11_REG_MON2SEL,
  50. S2MPS11_REG_LEE,
  51. S2MPS11_REG_RSVD_NO,
  52. S2MPS11_REG_UVLO,
  53. S2MPS11_REG_LEE_NO,
  54. S2MPS11_REG_B1CTRL1,
  55. S2MPS11_REG_B1CTRL2,
  56. S2MPS11_REG_B2CTRL1,
  57. S2MPS11_REG_B2CTRL2,
  58. S2MPS11_REG_B3CTRL1,
  59. S2MPS11_REG_B3CTRL2,
  60. S2MPS11_REG_B4CTRL1,
  61. S2MPS11_REG_B4CTRL2,
  62. S2MPS11_REG_B5CTRL1,
  63. S2MPS11_REG_BUCK5_SW,
  64. S2MPS11_REG_B5CTRL2,
  65. S2MPS11_REG_B5CTRL3,
  66. S2MPS11_REG_B5CTRL4,
  67. S2MPS11_REG_B5CTRL5,
  68. S2MPS11_REG_B6CTRL1,
  69. S2MPS11_REG_B6CTRL2,
  70. S2MPS11_REG_B7CTRL1,
  71. S2MPS11_REG_B7CTRL2,
  72. S2MPS11_REG_B8CTRL1,
  73. S2MPS11_REG_B8CTRL2,
  74. S2MPS11_REG_B9CTRL1,
  75. S2MPS11_REG_B9CTRL2,
  76. S2MPS11_REG_B10CTRL1,
  77. S2MPS11_REG_B10CTRL2,
  78. S2MPS11_REG_L1CTRL,
  79. S2MPS11_REG_L2CTRL,
  80. S2MPS11_REG_L3CTRL,
  81. S2MPS11_REG_L4CTRL,
  82. S2MPS11_REG_L5CTRL,
  83. S2MPS11_REG_L6CTRL,
  84. S2MPS11_REG_L7CTRL,
  85. S2MPS11_REG_L8CTRL,
  86. S2MPS11_REG_L9CTRL,
  87. S2MPS11_REG_L10CTRL,
  88. S2MPS11_REG_L11CTRL,
  89. S2MPS11_REG_L12CTRL,
  90. S2MPS11_REG_L13CTRL,
  91. S2MPS11_REG_L14CTRL,
  92. S2MPS11_REG_L15CTRL,
  93. S2MPS11_REG_L16CTRL,
  94. S2MPS11_REG_L17CTRL,
  95. S2MPS11_REG_L18CTRL,
  96. S2MPS11_REG_L19CTRL,
  97. S2MPS11_REG_L20CTRL,
  98. S2MPS11_REG_L21CTRL,
  99. S2MPS11_REG_L22CTRL,
  100. S2MPS11_REG_L23CTRL,
  101. S2MPS11_REG_L24CTRL,
  102. S2MPS11_REG_L25CTRL,
  103. S2MPS11_REG_L26CTRL,
  104. S2MPS11_REG_L27CTRL,
  105. S2MPS11_REG_L28CTRL,
  106. S2MPS11_REG_L29CTRL,
  107. S2MPS11_REG_L30CTRL,
  108. S2MPS11_REG_L31CTRL,
  109. S2MPS11_REG_L32CTRL,
  110. S2MPS11_REG_L33CTRL,
  111. S2MPS11_REG_L34CTRL,
  112. S2MPS11_REG_L35CTRL,
  113. S2MPS11_REG_L36CTRL,
  114. S2MPS11_REG_L37CTRL,
  115. S2MPS11_REG_L38CTRL,
  116. };
  117. /* S2MPS11 regulator ids */
  118. enum s2mps11_regulators {
  119. S2MPS11_LDO1,
  120. S2MPS11_LDO2,
  121. S2MPS11_LDO3,
  122. S2MPS11_LDO4,
  123. S2MPS11_LDO5,
  124. S2MPS11_LDO6,
  125. S2MPS11_LDO7,
  126. S2MPS11_LDO8,
  127. S2MPS11_LDO9,
  128. S2MPS11_LDO10,
  129. S2MPS11_LDO11,
  130. S2MPS11_LDO12,
  131. S2MPS11_LDO13,
  132. S2MPS11_LDO14,
  133. S2MPS11_LDO15,
  134. S2MPS11_LDO16,
  135. S2MPS11_LDO17,
  136. S2MPS11_LDO18,
  137. S2MPS11_LDO19,
  138. S2MPS11_LDO20,
  139. S2MPS11_LDO21,
  140. S2MPS11_LDO22,
  141. S2MPS11_LDO23,
  142. S2MPS11_LDO24,
  143. S2MPS11_LDO25,
  144. S2MPS11_LDO26,
  145. S2MPS11_LDO27,
  146. S2MPS11_LDO28,
  147. S2MPS11_LDO29,
  148. S2MPS11_LDO30,
  149. S2MPS11_LDO31,
  150. S2MPS11_LDO32,
  151. S2MPS11_LDO33,
  152. S2MPS11_LDO34,
  153. S2MPS11_LDO35,
  154. S2MPS11_LDO36,
  155. S2MPS11_LDO37,
  156. S2MPS11_LDO38,
  157. S2MPS11_BUCK1,
  158. S2MPS11_BUCK2,
  159. S2MPS11_BUCK3,
  160. S2MPS11_BUCK4,
  161. S2MPS11_BUCK5,
  162. S2MPS11_BUCK6,
  163. S2MPS11_BUCK7,
  164. S2MPS11_BUCK8,
  165. S2MPS11_BUCK9,
  166. S2MPS11_BUCK10,
  167. S2MPS11_REGULATOR_MAX,
  168. };
  169. #define S2MPS11_LDO_VSEL_MASK 0x3F
  170. #define S2MPS11_BUCK_VSEL_MASK 0xFF
  171. #define S2MPS11_BUCK9_VSEL_MASK 0x1F
  172. #define S2MPS11_ENABLE_MASK (0x03 << S2MPS11_ENABLE_SHIFT)
  173. #define S2MPS11_ENABLE_SHIFT 0x06
  174. #define S2MPS11_LDO_N_VOLTAGES (S2MPS11_LDO_VSEL_MASK + 1)
  175. #define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1)
  176. #define S2MPS11_BUCK9_N_VOLTAGES (S2MPS11_BUCK9_VSEL_MASK + 1)
  177. #define S2MPS11_RAMP_DELAY 25000 /* uV/us */
  178. #define S2MPS11_CTRL1_PWRHOLD_MASK BIT(4)
  179. #define S2MPS11_BUCK2_RAMP_SHIFT 6
  180. #define S2MPS11_BUCK34_RAMP_SHIFT 4
  181. #define S2MPS11_BUCK5_RAMP_SHIFT 6
  182. #define S2MPS11_BUCK16_RAMP_SHIFT 4
  183. #define S2MPS11_BUCK7810_RAMP_SHIFT 2
  184. #define S2MPS11_BUCK9_RAMP_SHIFT 0
  185. #define S2MPS11_BUCK2_RAMP_EN_SHIFT 3
  186. #define S2MPS11_BUCK3_RAMP_EN_SHIFT 2
  187. #define S2MPS11_BUCK4_RAMP_EN_SHIFT 1
  188. #define S2MPS11_BUCK6_RAMP_EN_SHIFT 0
  189. #define S2MPS11_PMIC_EN_SHIFT 6
  190. #endif /* __LINUX_MFD_S2MPS11_H */