ti-lmu-register.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * TI LMU (Lighting Management Unit) Device Register Map
  4. *
  5. * Copyright 2017 Texas Instruments
  6. *
  7. * Author: Milo Kim <milo.kim@ti.com>
  8. */
  9. #ifndef __MFD_TI_LMU_REGISTER_H__
  10. #define __MFD_TI_LMU_REGISTER_H__
  11. #include <linux/bitops.h>
  12. /* LM3631 */
  13. #define LM3631_REG_DEVCTRL 0x00
  14. #define LM3631_LCD_EN_MASK BIT(1)
  15. #define LM3631_BL_EN_MASK BIT(0)
  16. #define LM3631_REG_BRT_LSB 0x01
  17. #define LM3631_REG_BRT_MSB 0x02
  18. #define LM3631_REG_BL_CFG 0x06
  19. #define LM3631_BL_CHANNEL_MASK BIT(3)
  20. #define LM3631_BL_DUAL_CHANNEL 0
  21. #define LM3631_BL_SINGLE_CHANNEL BIT(3)
  22. #define LM3631_MAP_MASK BIT(5)
  23. #define LM3631_EXPONENTIAL_MAP 0
  24. #define LM3631_REG_BRT_MODE 0x08
  25. #define LM3631_MODE_MASK (BIT(1) | BIT(2) | BIT(3))
  26. #define LM3631_DEFAULT_MODE (BIT(1) | BIT(3))
  27. #define LM3631_REG_SLOPE 0x09
  28. #define LM3631_SLOPE_MASK 0xF0
  29. #define LM3631_SLOPE_SHIFT 4
  30. #define LM3631_REG_LDO_CTRL1 0x0A
  31. #define LM3631_EN_OREF_MASK BIT(0)
  32. #define LM3631_EN_VNEG_MASK BIT(1)
  33. #define LM3631_EN_VPOS_MASK BIT(2)
  34. #define LM3631_REG_LDO_CTRL2 0x0B
  35. #define LM3631_EN_CONT_MASK BIT(0)
  36. #define LM3631_REG_VOUT_CONT 0x0C
  37. #define LM3631_VOUT_CONT_MASK (BIT(6) | BIT(7))
  38. #define LM3631_REG_VOUT_BOOST 0x0C
  39. #define LM3631_REG_VOUT_POS 0x0D
  40. #define LM3631_REG_VOUT_NEG 0x0E
  41. #define LM3631_REG_VOUT_OREF 0x0F
  42. #define LM3631_VOUT_MASK 0x3F
  43. #define LM3631_REG_ENTIME_VCONT 0x0B
  44. #define LM3631_ENTIME_CONT_MASK 0x70
  45. #define LM3631_REG_ENTIME_VOREF 0x0F
  46. #define LM3631_REG_ENTIME_VPOS 0x10
  47. #define LM3631_REG_ENTIME_VNEG 0x11
  48. #define LM3631_ENTIME_MASK 0xF0
  49. #define LM3631_ENTIME_SHIFT 4
  50. #define LM3631_MAX_REG 0x16
  51. /* LM3632 */
  52. #define LM3632_REG_CONFIG1 0x02
  53. #define LM3632_OVP_MASK (BIT(5) | BIT(6) | BIT(7))
  54. #define LM3632_OVP_25V BIT(6)
  55. #define LM3632_REG_CONFIG2 0x03
  56. #define LM3632_SWFREQ_MASK BIT(7)
  57. #define LM3632_SWFREQ_1MHZ BIT(7)
  58. #define LM3632_REG_BRT_LSB 0x04
  59. #define LM3632_REG_BRT_MSB 0x05
  60. #define LM3632_REG_IO_CTRL 0x09
  61. #define LM3632_PWM_MASK BIT(6)
  62. #define LM3632_I2C_MODE 0
  63. #define LM3632_PWM_MODE BIT(6)
  64. #define LM3632_REG_ENABLE 0x0A
  65. #define LM3632_BL_EN_MASK BIT(0)
  66. #define LM3632_BL_CHANNEL_MASK (BIT(3) | BIT(4))
  67. #define LM3632_BL_SINGLE_CHANNEL BIT(4)
  68. #define LM3632_BL_DUAL_CHANNEL BIT(3)
  69. #define LM3632_REG_BIAS_CONFIG 0x0C
  70. #define LM3632_EXT_EN_MASK BIT(0)
  71. #define LM3632_EN_VNEG_MASK BIT(1)
  72. #define LM3632_EN_VPOS_MASK BIT(2)
  73. #define LM3632_REG_VOUT_BOOST 0x0D
  74. #define LM3632_REG_VOUT_POS 0x0E
  75. #define LM3632_REG_VOUT_NEG 0x0F
  76. #define LM3632_VOUT_MASK 0x3F
  77. #define LM3632_MAX_REG 0x10
  78. /* LM3633 */
  79. #define LM3633_REG_HVLED_OUTPUT_CFG 0x10
  80. #define LM3633_HVLED1_CFG_MASK BIT(0)
  81. #define LM3633_HVLED2_CFG_MASK BIT(1)
  82. #define LM3633_HVLED3_CFG_MASK BIT(2)
  83. #define LM3633_HVLED1_CFG_SHIFT 0
  84. #define LM3633_HVLED2_CFG_SHIFT 1
  85. #define LM3633_HVLED3_CFG_SHIFT 2
  86. #define LM3633_REG_BANK_SEL 0x11
  87. #define LM3633_REG_BL0_RAMP 0x12
  88. #define LM3633_REG_BL1_RAMP 0x13
  89. #define LM3633_BL_RAMPUP_MASK 0xF0
  90. #define LM3633_BL_RAMPUP_SHIFT 4
  91. #define LM3633_BL_RAMPDN_MASK 0x0F
  92. #define LM3633_BL_RAMPDN_SHIFT 0
  93. #define LM3633_REG_BL_RAMP_CONF 0x1B
  94. #define LM3633_BL_RAMP_MASK 0x0F
  95. #define LM3633_BL_RAMP_EACH 0x05
  96. #define LM3633_REG_PTN0_RAMP 0x1C
  97. #define LM3633_REG_PTN1_RAMP 0x1D
  98. #define LM3633_PTN_RAMPUP_MASK 0x70
  99. #define LM3633_PTN_RAMPUP_SHIFT 4
  100. #define LM3633_PTN_RAMPDN_MASK 0x07
  101. #define LM3633_PTN_RAMPDN_SHIFT 0
  102. #define LM3633_REG_LED_MAPPING_MODE 0x1F
  103. #define LM3633_LED_EXPONENTIAL BIT(1)
  104. #define LM3633_REG_IMAX_HVLED_A 0x20
  105. #define LM3633_REG_IMAX_HVLED_B 0x21
  106. #define LM3633_REG_IMAX_LVLED_BASE 0x22
  107. #define LM3633_REG_BL_FEEDBACK_ENABLE 0x28
  108. #define LM3633_REG_ENABLE 0x2B
  109. #define LM3633_LED_BANK_OFFSET 2
  110. #define LM3633_REG_PATTERN 0x2C
  111. #define LM3633_REG_BOOST_CFG 0x2D
  112. #define LM3633_OVP_MASK (BIT(1) | BIT(2))
  113. #define LM3633_OVP_40V 0x6
  114. #define LM3633_REG_PWM_CFG 0x2F
  115. #define LM3633_PWM_A_MASK BIT(0)
  116. #define LM3633_PWM_B_MASK BIT(1)
  117. #define LM3633_REG_BRT_HVLED_A_LSB 0x40
  118. #define LM3633_REG_BRT_HVLED_A_MSB 0x41
  119. #define LM3633_REG_BRT_HVLED_B_LSB 0x42
  120. #define LM3633_REG_BRT_HVLED_B_MSB 0x43
  121. #define LM3633_REG_BRT_LVLED_BASE 0x44
  122. #define LM3633_REG_PTN_DELAY 0x50
  123. #define LM3633_REG_PTN_LOWTIME 0x51
  124. #define LM3633_REG_PTN_HIGHTIME 0x52
  125. #define LM3633_REG_PTN_LOWBRT 0x53
  126. #define LM3633_REG_PTN_HIGHBRT LM3633_REG_BRT_LVLED_BASE
  127. #define LM3633_REG_BL_OPEN_FAULT_STATUS 0xB0
  128. #define LM3633_REG_BL_SHORT_FAULT_STATUS 0xB2
  129. #define LM3633_REG_MONITOR_ENABLE 0xB4
  130. #define LM3633_MAX_REG 0xB4
  131. /* LM3695 */
  132. #define LM3695_REG_GP 0x10
  133. #define LM3695_BL_CHANNEL_MASK BIT(3)
  134. #define LM3695_BL_DUAL_CHANNEL 0
  135. #define LM3695_BL_SINGLE_CHANNEL BIT(3)
  136. #define LM3695_BRT_RW_MASK BIT(2)
  137. #define LM3695_BL_EN_MASK BIT(0)
  138. #define LM3695_REG_BRT_LSB 0x13
  139. #define LM3695_REG_BRT_MSB 0x14
  140. #define LM3695_MAX_REG 0x14
  141. /* LM36274 */
  142. #define LM36274_REG_REV 0x01
  143. #define LM36274_REG_BL_CFG_1 0x02
  144. #define LM36274_REG_BL_CFG_2 0x03
  145. #define LM36274_REG_BRT_LSB 0x04
  146. #define LM36274_REG_BRT_MSB 0x05
  147. #define LM36274_REG_BL_EN 0x08
  148. #define LM36274_REG_BIAS_CONFIG_1 0x09
  149. #define LM36274_EXT_EN_MASK BIT(0)
  150. #define LM36274_EN_VNEG_MASK BIT(1)
  151. #define LM36274_EN_VPOS_MASK BIT(2)
  152. #define LM36274_REG_BIAS_CONFIG_2 0x0a
  153. #define LM36274_REG_BIAS_CONFIG_3 0x0b
  154. #define LM36274_REG_VOUT_BOOST 0x0c
  155. #define LM36274_REG_VOUT_POS 0x0d
  156. #define LM36274_REG_VOUT_NEG 0x0e
  157. #define LM36274_VOUT_MASK 0x3F
  158. #define LM36274_MAX_REG 0x13
  159. #endif