s2mps14.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*
  2. * s2mps14.h
  3. *
  4. * Copyright (c) 2014 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. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. */
  18. #ifndef __LINUX_MFD_S2MPS14_H
  19. #define __LINUX_MFD_S2MPS14_H
  20. /* S2MPS14 registers */
  21. enum s2mps14_reg {
  22. S2MPS14_REG_ID,
  23. S2MPS14_REG_INT1,
  24. S2MPS14_REG_INT2,
  25. S2MPS14_REG_INT3,
  26. S2MPS14_REG_INT1M,
  27. S2MPS14_REG_INT2M,
  28. S2MPS14_REG_INT3M,
  29. S2MPS14_REG_ST1,
  30. S2MPS14_REG_ST2,
  31. S2MPS14_REG_PWRONSRC,
  32. S2MPS14_REG_OFFSRC,
  33. S2MPS14_REG_BU_CHG,
  34. S2MPS14_REG_RTCCTRL,
  35. S2MPS14_REG_CTRL1,
  36. S2MPS14_REG_CTRL2,
  37. S2MPS14_REG_RSVD1,
  38. S2MPS14_REG_RSVD2,
  39. S2MPS14_REG_RSVD3,
  40. S2MPS14_REG_RSVD4,
  41. S2MPS14_REG_RSVD5,
  42. S2MPS14_REG_RSVD6,
  43. S2MPS14_REG_CTRL3,
  44. S2MPS14_REG_RSVD7,
  45. S2MPS14_REG_RSVD8,
  46. S2MPS14_REG_WRSTBI,
  47. S2MPS14_REG_B1CTRL1,
  48. S2MPS14_REG_B1CTRL2,
  49. S2MPS14_REG_B2CTRL1,
  50. S2MPS14_REG_B2CTRL2,
  51. S2MPS14_REG_B3CTRL1,
  52. S2MPS14_REG_B3CTRL2,
  53. S2MPS14_REG_B4CTRL1,
  54. S2MPS14_REG_B4CTRL2,
  55. S2MPS14_REG_B5CTRL1,
  56. S2MPS14_REG_B5CTRL2,
  57. S2MPS14_REG_L1CTRL,
  58. S2MPS14_REG_L2CTRL,
  59. S2MPS14_REG_L3CTRL,
  60. S2MPS14_REG_L4CTRL,
  61. S2MPS14_REG_L5CTRL,
  62. S2MPS14_REG_L6CTRL,
  63. S2MPS14_REG_L7CTRL,
  64. S2MPS14_REG_L8CTRL,
  65. S2MPS14_REG_L9CTRL,
  66. S2MPS14_REG_L10CTRL,
  67. S2MPS14_REG_L11CTRL,
  68. S2MPS14_REG_L12CTRL,
  69. S2MPS14_REG_L13CTRL,
  70. S2MPS14_REG_L14CTRL,
  71. S2MPS14_REG_L15CTRL,
  72. S2MPS14_REG_L16CTRL,
  73. S2MPS14_REG_L17CTRL,
  74. S2MPS14_REG_L18CTRL,
  75. S2MPS14_REG_L19CTRL,
  76. S2MPS14_REG_L20CTRL,
  77. S2MPS14_REG_L21CTRL,
  78. S2MPS14_REG_L22CTRL,
  79. S2MPS14_REG_L23CTRL,
  80. S2MPS14_REG_L24CTRL,
  81. S2MPS14_REG_L25CTRL,
  82. S2MPS14_REG_LDODSCH1,
  83. S2MPS14_REG_LDODSCH2,
  84. S2MPS14_REG_LDODSCH3,
  85. };
  86. /* S2MPS14 regulator ids */
  87. enum s2mps14_regulators {
  88. S2MPS14_LDO1,
  89. S2MPS14_LDO2,
  90. S2MPS14_LDO3,
  91. S2MPS14_LDO4,
  92. S2MPS14_LDO5,
  93. S2MPS14_LDO6,
  94. S2MPS14_LDO7,
  95. S2MPS14_LDO8,
  96. S2MPS14_LDO9,
  97. S2MPS14_LDO10,
  98. S2MPS14_LDO11,
  99. S2MPS14_LDO12,
  100. S2MPS14_LDO13,
  101. S2MPS14_LDO14,
  102. S2MPS14_LDO15,
  103. S2MPS14_LDO16,
  104. S2MPS14_LDO17,
  105. S2MPS14_LDO18,
  106. S2MPS14_LDO19,
  107. S2MPS14_LDO20,
  108. S2MPS14_LDO21,
  109. S2MPS14_LDO22,
  110. S2MPS14_LDO23,
  111. S2MPS14_LDO24,
  112. S2MPS14_LDO25,
  113. S2MPS14_BUCK1,
  114. S2MPS14_BUCK2,
  115. S2MPS14_BUCK3,
  116. S2MPS14_BUCK4,
  117. S2MPS14_BUCK5,
  118. S2MPS14_REGULATOR_MAX,
  119. };
  120. /* Regulator constraints for BUCKx */
  121. #define S2MPS14_BUCK1235_START_SEL 0x20
  122. #define S2MPS14_BUCK4_START_SEL 0x40
  123. /*
  124. * Default ramp delay in uv/us. Datasheet says that ramp delay can be
  125. * controlled however it does not specify which register is used for that.
  126. * Let's assume that default value will be set.
  127. */
  128. #define S2MPS14_BUCK_RAMP_DELAY 12500
  129. #define S2MPS14_LDO_VSEL_MASK 0x3F
  130. #define S2MPS14_BUCK_VSEL_MASK 0xFF
  131. #define S2MPS14_ENABLE_MASK (0x03 << S2MPS14_ENABLE_SHIFT)
  132. #define S2MPS14_ENABLE_SHIFT 6
  133. /* On/Off controlled by PWREN */
  134. #define S2MPS14_ENABLE_SUSPEND (0x01 << S2MPS14_ENABLE_SHIFT)
  135. /* On/Off controlled by LDO10EN or EMMCEN */
  136. #define S2MPS14_ENABLE_EXT_CONTROL (0x00 << S2MPS14_ENABLE_SHIFT)
  137. #define S2MPS14_LDO_N_VOLTAGES (S2MPS14_LDO_VSEL_MASK + 1)
  138. #define S2MPS14_BUCK_N_VOLTAGES (S2MPS14_BUCK_VSEL_MASK + 1)
  139. #endif /* __LINUX_MFD_S2MPS14_H */