atc2609a.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * ATC2609A PMIC register definitions
  4. *
  5. * Copyright (C) 2019 Manivannan Sadhasivam <[email protected]>
  6. */
  7. #ifndef __LINUX_MFD_ATC260X_ATC2609A_H
  8. #define __LINUX_MFD_ATC260X_ATC2609A_H
  9. enum atc2609a_irq_def {
  10. ATC2609A_IRQ_AUDIO = 0,
  11. ATC2609A_IRQ_OV,
  12. ATC2609A_IRQ_OC,
  13. ATC2609A_IRQ_OT,
  14. ATC2609A_IRQ_UV,
  15. ATC2609A_IRQ_ALARM,
  16. ATC2609A_IRQ_ONOFF,
  17. ATC2609A_IRQ_WKUP,
  18. ATC2609A_IRQ_IR,
  19. ATC2609A_IRQ_REMCON,
  20. ATC2609A_IRQ_POWER_IN,
  21. };
  22. /* PMU Registers */
  23. #define ATC2609A_PMU_SYS_CTL0 0x00
  24. #define ATC2609A_PMU_SYS_CTL1 0x01
  25. #define ATC2609A_PMU_SYS_CTL2 0x02
  26. #define ATC2609A_PMU_SYS_CTL3 0x03
  27. #define ATC2609A_PMU_SYS_CTL4 0x04
  28. #define ATC2609A_PMU_SYS_CTL5 0x05
  29. #define ATC2609A_PMU_SYS_CTL6 0x06
  30. #define ATC2609A_PMU_SYS_CTL7 0x07
  31. #define ATC2609A_PMU_SYS_CTL8 0x08
  32. #define ATC2609A_PMU_SYS_CTL9 0x09
  33. #define ATC2609A_PMU_BAT_CTL0 0x0A
  34. #define ATC2609A_PMU_BAT_CTL1 0x0B
  35. #define ATC2609A_PMU_VBUS_CTL0 0x0C
  36. #define ATC2609A_PMU_VBUS_CTL1 0x0D
  37. #define ATC2609A_PMU_WALL_CTL0 0x0E
  38. #define ATC2609A_PMU_WALL_CTL1 0x0F
  39. #define ATC2609A_PMU_SYS_PENDING 0x10
  40. #define ATC2609A_PMU_APDS_CTL0 0x11
  41. #define ATC2609A_PMU_APDS_CTL1 0x12
  42. #define ATC2609A_PMU_APDS_CTL2 0x13
  43. #define ATC2609A_PMU_CHARGER_CTL 0x14
  44. #define ATC2609A_PMU_BAKCHARGER_CTL 0x15
  45. #define ATC2609A_PMU_SWCHG_CTL0 0x16
  46. #define ATC2609A_PMU_SWCHG_CTL1 0x17
  47. #define ATC2609A_PMU_SWCHG_CTL2 0x18
  48. #define ATC2609A_PMU_SWCHG_CTL3 0x19
  49. #define ATC2609A_PMU_SWCHG_CTL4 0x1A
  50. #define ATC2609A_PMU_DC_OSC 0x1B
  51. #define ATC2609A_PMU_DC0_CTL0 0x1C
  52. #define ATC2609A_PMU_DC0_CTL1 0x1D
  53. #define ATC2609A_PMU_DC0_CTL2 0x1E
  54. #define ATC2609A_PMU_DC0_CTL3 0x1F
  55. #define ATC2609A_PMU_DC0_CTL4 0x20
  56. #define ATC2609A_PMU_DC0_CTL5 0x21
  57. #define ATC2609A_PMU_DC0_CTL6 0x22
  58. #define ATC2609A_PMU_DC1_CTL0 0x23
  59. #define ATC2609A_PMU_DC1_CTL1 0x24
  60. #define ATC2609A_PMU_DC1_CTL2 0x25
  61. #define ATC2609A_PMU_DC1_CTL3 0x26
  62. #define ATC2609A_PMU_DC1_CTL4 0x27
  63. #define ATC2609A_PMU_DC1_CTL5 0x28
  64. #define ATC2609A_PMU_DC1_CTL6 0x29
  65. #define ATC2609A_PMU_DC2_CTL0 0x2A
  66. #define ATC2609A_PMU_DC2_CTL1 0x2B
  67. #define ATC2609A_PMU_DC2_CTL2 0x2C
  68. #define ATC2609A_PMU_DC2_CTL3 0x2D
  69. #define ATC2609A_PMU_DC2_CTL4 0x2E
  70. #define ATC2609A_PMU_DC2_CTL5 0x2F
  71. #define ATC2609A_PMU_DC2_CTL6 0x30
  72. #define ATC2609A_PMU_DC3_CTL0 0x31
  73. #define ATC2609A_PMU_DC3_CTL1 0x32
  74. #define ATC2609A_PMU_DC3_CTL2 0x33
  75. #define ATC2609A_PMU_DC3_CTL3 0x34
  76. #define ATC2609A_PMU_DC3_CTL4 0x35
  77. #define ATC2609A_PMU_DC3_CTL5 0x36
  78. #define ATC2609A_PMU_DC3_CTL6 0x37
  79. #define ATC2609A_PMU_DC_ZR 0x38
  80. #define ATC2609A_PMU_LDO0_CTL0 0x39
  81. #define ATC2609A_PMU_LDO0_CTL1 0x3A
  82. #define ATC2609A_PMU_LDO1_CTL0 0x3B
  83. #define ATC2609A_PMU_LDO1_CTL1 0x3C
  84. #define ATC2609A_PMU_LDO2_CTL0 0x3D
  85. #define ATC2609A_PMU_LDO2_CTL1 0x3E
  86. #define ATC2609A_PMU_LDO3_CTL0 0x3F
  87. #define ATC2609A_PMU_LDO3_CTL1 0x40
  88. #define ATC2609A_PMU_LDO4_CTL0 0x41
  89. #define ATC2609A_PMU_LDO4_CTL1 0x42
  90. #define ATC2609A_PMU_LDO5_CTL0 0x43
  91. #define ATC2609A_PMU_LDO5_CTL1 0x44
  92. #define ATC2609A_PMU_LDO6_CTL0 0x45
  93. #define ATC2609A_PMU_LDO6_CTL1 0x46
  94. #define ATC2609A_PMU_LDO7_CTL0 0x47
  95. #define ATC2609A_PMU_LDO7_CTL1 0x48
  96. #define ATC2609A_PMU_LDO8_CTL0 0x49
  97. #define ATC2609A_PMU_LDO8_CTL1 0x4A
  98. #define ATC2609A_PMU_LDO9_CTL 0x4B
  99. #define ATC2609A_PMU_OV_INT_EN 0x4C
  100. #define ATC2609A_PMU_OV_STATUS 0x4D
  101. #define ATC2609A_PMU_UV_INT_EN 0x4E
  102. #define ATC2609A_PMU_UV_STATUS 0x4F
  103. #define ATC2609A_PMU_OC_INT_EN 0x50
  104. #define ATC2609A_PMU_OC_STATUS 0x51
  105. #define ATC2609A_PMU_OT_CTL 0x52
  106. #define ATC2609A_PMU_CM_CTL0 0x53
  107. #define ATC2609A_PMU_FW_USE0 0x54
  108. #define ATC2609A_PMU_FW_USE1 0x55
  109. #define ATC2609A_PMU_ADC12B_I 0x56
  110. #define ATC2609A_PMU_ADC12B_V 0x57
  111. #define ATC2609A_PMU_ADC12B_DUMMY 0x58
  112. #define ATC2609A_PMU_AUXADC_CTL0 0x59
  113. #define ATC2609A_PMU_AUXADC_CTL1 0x5A
  114. #define ATC2609A_PMU_BATVADC 0x5B
  115. #define ATC2609A_PMU_BATIADC 0x5C
  116. #define ATC2609A_PMU_WALLVADC 0x5D
  117. #define ATC2609A_PMU_WALLIADC 0x5E
  118. #define ATC2609A_PMU_VBUSVADC 0x5F
  119. #define ATC2609A_PMU_VBUSIADC 0x60
  120. #define ATC2609A_PMU_SYSPWRADC 0x61
  121. #define ATC2609A_PMU_REMCONADC 0x62
  122. #define ATC2609A_PMU_SVCCADC 0x63
  123. #define ATC2609A_PMU_CHGIADC 0x64
  124. #define ATC2609A_PMU_IREFADC 0x65
  125. #define ATC2609A_PMU_BAKBATADC 0x66
  126. #define ATC2609A_PMU_ICTEMPADC 0x67
  127. #define ATC2609A_PMU_AUXADC0 0x68
  128. #define ATC2609A_PMU_AUXADC1 0x69
  129. #define ATC2609A_PMU_AUXADC2 0x6A
  130. #define ATC2609A_PMU_AUXADC3 0x6B
  131. #define ATC2609A_PMU_ICTEMPADC_ADJ 0x6C
  132. #define ATC2609A_PMU_BDG_CTL 0x6D
  133. #define ATC2609A_RTC_CTL 0x6E
  134. #define ATC2609A_RTC_MSALM 0x6F
  135. #define ATC2609A_RTC_HALM 0x70
  136. #define ATC2609A_RTC_YMDALM 0x71
  137. #define ATC2609A_RTC_MS 0x72
  138. #define ATC2609A_RTC_H 0x73
  139. #define ATC2609A_RTC_DC 0x74
  140. #define ATC2609A_RTC_YMD 0x75
  141. #define ATC2609A_EFUSE_DAT 0x76
  142. #define ATC2609A_EFUSECRTL1 0x77
  143. #define ATC2609A_EFUSECRTL2 0x78
  144. #define ATC2609A_PMU_DC4_CTL0 0x79
  145. #define ATC2609A_PMU_DC4_CTL1 0x7A
  146. #define ATC2609A_PMU_DC4_CTL2 0x7B
  147. #define ATC2609A_PMU_DC4_CTL3 0x7C
  148. #define ATC2609A_PMU_DC4_CTL4 0x7D
  149. #define ATC2609A_PMU_DC4_CTL5 0x7E
  150. #define ATC2609A_PMU_DC4_CTL6 0x7F
  151. #define ATC2609A_PMU_PWR_STATUS 0x80
  152. #define ATC2609A_PMU_S2_PWR 0x81
  153. #define ATC2609A_CLMT_CTL0 0x82
  154. #define ATC2609A_CLMT_DATA0 0x83
  155. #define ATC2609A_CLMT_DATA1 0x84
  156. #define ATC2609A_CLMT_DATA2 0x85
  157. #define ATC2609A_CLMT_DATA3 0x86
  158. #define ATC2609A_CLMT_ADD0 0x87
  159. #define ATC2609A_CLMT_ADD1 0x88
  160. #define ATC2609A_CLMT_OCV_TABLE 0x89
  161. #define ATC2609A_CLMT_R_TABLE 0x8A
  162. #define ATC2609A_PMU_PWRON_CTL0 0x8D
  163. #define ATC2609A_PMU_PWRON_CTL1 0x8E
  164. #define ATC2609A_PMU_PWRON_CTL2 0x8F
  165. #define ATC2609A_IRC_CTL 0x90
  166. #define ATC2609A_IRC_STAT 0x91
  167. #define ATC2609A_IRC_CC 0x92
  168. #define ATC2609A_IRC_KDC 0x93
  169. #define ATC2609A_IRC_WK 0x94
  170. #define ATC2609A_IRC_RCC 0x95
  171. /* AUDIO_OUT Registers */
  172. #define ATC2609A_AUDIOINOUT_CTL 0xA0
  173. #define ATC2609A_AUDIO_DEBUGOUTCTL 0xA1
  174. #define ATC2609A_DAC_DIGITALCTL 0xA2
  175. #define ATC2609A_DAC_VOLUMECTL0 0xA3
  176. #define ATC2609A_DAC_ANALOG0 0xA4
  177. #define ATC2609A_DAC_ANALOG1 0xA5
  178. #define ATC2609A_DAC_ANALOG2 0xA6
  179. #define ATC2609A_DAC_ANALOG3 0xA7
  180. /* AUDIO_IN Registers */
  181. #define ATC2609A_ADC_DIGITALCTL 0xA8
  182. #define ATC2609A_ADC_HPFCTL 0xA9
  183. #define ATC2609A_ADC_CTL 0xAA
  184. #define ATC2609A_AGC_CTL0 0xAB
  185. #define ATC2609A_AGC_CTL1 0xAC
  186. #define ATC2609A_AGC_CTL2 0xAD
  187. #define ATC2609A_ADC_ANALOG0 0xAE
  188. #define ATC2609A_ADC_ANALOG1 0xAF
  189. /* PCM_IF Registers */
  190. #define ATC2609A_PCM0_CTL 0xB0
  191. #define ATC2609A_PCM1_CTL 0xB1
  192. #define ATC2609A_PCM2_CTL 0xB2
  193. #define ATC2609A_PCMIF_CTL 0xB3
  194. /* CMU_CONTROL Registers */
  195. #define ATC2609A_CMU_DEVRST 0xC1
  196. /* INTS Registers */
  197. #define ATC2609A_INTS_PD 0xC8
  198. #define ATC2609A_INTS_MSK 0xC9
  199. /* MFP Registers */
  200. #define ATC2609A_MFP_CTL 0xD0
  201. #define ATC2609A_PAD_VSEL 0xD1
  202. #define ATC2609A_GPIO_OUTEN 0xD2
  203. #define ATC2609A_GPIO_INEN 0xD3
  204. #define ATC2609A_GPIO_DAT 0xD4
  205. #define ATC2609A_PAD_DRV 0xD5
  206. #define ATC2609A_PAD_EN 0xD6
  207. #define ATC2609A_DEBUG_SEL 0xD7
  208. #define ATC2609A_DEBUG_IE 0xD8
  209. #define ATC2609A_DEBUG_OE 0xD9
  210. #define ATC2609A_CHIP_VER 0xDC
  211. /* PWSI Registers */
  212. #define ATC2609A_PWSI_CTL 0xF0
  213. #define ATC2609A_PWSI_STATUS 0xF1
  214. /* TWSI Registers */
  215. #define ATC2609A_SADDR 0xFF
  216. /* PMU_SYS_CTL0 Register Mask Bits */
  217. #define ATC2609A_PMU_SYS_CTL0_IR_WK_EN BIT(5)
  218. #define ATC2609A_PMU_SYS_CTL0_RESET_WK_EN BIT(6)
  219. #define ATC2609A_PMU_SYS_CTL0_HDSW_WK_EN BIT(7)
  220. #define ATC2609A_PMU_SYS_CTL0_ALARM_WK_EN BIT(8)
  221. #define ATC2609A_PMU_SYS_CTL0_REM_CON_WK_EN BIT(9)
  222. #define ATC2609A_PMU_SYS_CTL0_RESTART_EN BIT(10)
  223. #define ATC2609A_PMU_SYS_CTL0_WKIRQ_WK_EN BIT(11)
  224. #define ATC2609A_PMU_SYS_CTL0_ONOFF_SHORT_WK_EN BIT(12)
  225. #define ATC2609A_PMU_SYS_CTL0_ONOFF_LONG_WK_EN BIT(13)
  226. #define ATC2609A_PMU_SYS_CTL0_WALL_WK_EN BIT(14)
  227. #define ATC2609A_PMU_SYS_CTL0_USB_WK_EN BIT(15)
  228. #define ATC2609A_PMU_SYS_CTL0_WK_ALL (GENMASK(15, 5) & (~BIT(10)))
  229. /* PMU_SYS_CTL1 Register Mask Bits */
  230. #define ATC2609A_PMU_SYS_CTL1_EN_S1 BIT(0)
  231. #define ATC2609A_PMU_SYS_CTL1_LB_S4_EN BIT(2)
  232. #define ATC2609A_PMU_SYS_CTL1_LB_S4 GENMASK(4, 3)
  233. #define ATC2609A_PMU_SYS_CTL1_LB_S4_3_1V BIT(4)
  234. #define ATC2609A_PMU_SYS_CTL1_IR_WK_FLAG BIT(5)
  235. #define ATC2609A_PMU_SYS_CTL1_RESET_WK_FLAG BIT(6)
  236. #define ATC2609A_PMU_SYS_CTL1_HDSW_WK_FLAG BIT(7)
  237. #define ATC2609A_PMU_SYS_CTL1_ALARM_WK_FLAG BIT(8)
  238. #define ATC2609A_PMU_SYS_CTL1_REM_CON_WK_FLAG BIT(9)
  239. #define ATC2609A_PMU_SYS_CTL1_RESTART_WK_FLAG BIT(10)
  240. #define ATC2609A_PMU_SYS_CTL1_WKIRQ_WK_FLAG BIT(11)
  241. #define ATC2609A_PMU_SYS_CTL1_ONOFF_SHORT_WK_FLAG BIT(12)
  242. #define ATC2609A_PMU_SYS_CTL1_ONOFF_LONG_WK_FLAG BIT(13)
  243. #define ATC2609A_PMU_SYS_CTL1_WALL_WK_FLAG BIT(14)
  244. #define ATC2609A_PMU_SYS_CTL1_USB_WK_FLAG BIT(15)
  245. /* PMU_SYS_CTL2 Register Mask Bits */
  246. #define ATC2609A_PMU_SYS_CTL2_PMU_A_EN BIT(0)
  247. #define ATC2609A_PMU_SYS_CTL2_ONOFF_PRESS_INT_EN BIT(1)
  248. #define ATC2609A_PMU_SYS_CTL2_ONOFF_PRESS_PD BIT(2)
  249. #define ATC2609A_PMU_SYS_CTL2_S2TIMER GENMASK(5, 3)
  250. #define ATC2609A_PMU_SYS_CTL2_S2_TIMER_EN BIT(6)
  251. #define ATC2609A_PMU_SYS_CTL2_ONOFF_RESET_TIME_SEL GENMASK(8, 7)
  252. #define ATC2609A_PMU_SYS_CTL2_ONOFF_RESET_EN BIT(9)
  253. #define ATC2609A_PMU_SYS_CTL2_ONOFF_PRESS_TIME GENMASK(11, 10)
  254. #define ATC2609A_PMU_SYS_CTL2_ONOFF_LSP_INT_EN BIT(12)
  255. #define ATC2609A_PMU_SYS_CTL2_ONOFF_LONG_PRESS BIT(13)
  256. #define ATC2609A_PMU_SYS_CTL2_ONOFF_SHORT_PRESS BIT(14)
  257. #define ATC2609A_PMU_SYS_CTL2_ONOFF_PRESS BIT(15)
  258. /* PMU_SYS_CTL3 Register Mask Bits */
  259. #define ATC2609A_PMU_SYS_CTL3_S2S3TOS1_TIMER GENMASK(8, 7)
  260. #define ATC2609A_PMU_SYS_CTL3_S2S3TOS1_TIMER_EN BIT(9)
  261. #define ATC2609A_PMU_SYS_CTL3_S3_TIMER GENMASK(12, 10)
  262. #define ATC2609A_PMU_SYS_CTL3_S3_TIMER_EN BIT(13)
  263. #define ATC2609A_PMU_SYS_CTL3_EN_S3 BIT(14)
  264. #define ATC2609A_PMU_SYS_CTL3_EN_S2 BIT(15)
  265. /* PMU_SYS_CTL5 Register Mask Bits */
  266. #define ATC2609A_PMU_SYS_CTL5_WALLWKDTEN BIT(7)
  267. #define ATC2609A_PMU_SYS_CTL5_VBUSWKDTEN BIT(8)
  268. #define ATC2609A_PMU_SYS_CTL5_REMCON_DECT_EN BIT(9)
  269. #define ATC2609A_PMU_SYS_CTL5_ONOFF_8S_SEL BIT(10)
  270. /* INTS_MSK Register Mask Bits */
  271. #define ATC2609A_INTS_MSK_AUDIO BIT(0)
  272. #define ATC2609A_INTS_MSK_OV BIT(1)
  273. #define ATC2609A_INTS_MSK_OC BIT(2)
  274. #define ATC2609A_INTS_MSK_OT BIT(3)
  275. #define ATC2609A_INTS_MSK_UV BIT(4)
  276. #define ATC2609A_INTS_MSK_ALARM BIT(5)
  277. #define ATC2609A_INTS_MSK_ONOFF BIT(6)
  278. #define ATC2609A_INTS_MSK_WKUP BIT(7)
  279. #define ATC2609A_INTS_MSK_IR BIT(8)
  280. #define ATC2609A_INTS_MSK_REMCON BIT(9)
  281. #define ATC2609A_INTS_MSK_POWERIN BIT(10)
  282. /* CMU_DEVRST Register Mask Bits */
  283. #define ATC2609A_CMU_DEVRST_AUDIO BIT(0)
  284. #define ATC2609A_CMU_DEVRST_MFP BIT(1)
  285. #define ATC2609A_CMU_DEVRST_INTS BIT(2)
  286. /* PAD_EN Register Mask Bits */
  287. #define ATC2609A_PAD_EN_EXTIRQ BIT(0)
  288. #endif /* __LINUX_MFD_ATC260X_ATC2609A_H */