registers.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155
  1. /*
  2. * DA9150 MFD Driver - Registers
  3. *
  4. * Copyright (c) 2014 Dialog Semiconductor
  5. *
  6. * Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. */
  13. #ifndef __DA9150_REGISTERS_H
  14. #define __DA9150_REGISTERS_H
  15. #include <linux/bitops.h>
  16. /* Registers */
  17. #define DA9150_PAGE_CON 0x000
  18. #define DA9150_STATUS_A 0x068
  19. #define DA9150_STATUS_B 0x069
  20. #define DA9150_STATUS_C 0x06A
  21. #define DA9150_STATUS_D 0x06B
  22. #define DA9150_STATUS_E 0x06C
  23. #define DA9150_STATUS_F 0x06D
  24. #define DA9150_STATUS_G 0x06E
  25. #define DA9150_STATUS_H 0x06F
  26. #define DA9150_STATUS_I 0x070
  27. #define DA9150_STATUS_J 0x071
  28. #define DA9150_STATUS_K 0x072
  29. #define DA9150_STATUS_L 0x073
  30. #define DA9150_STATUS_N 0x074
  31. #define DA9150_FAULT_LOG_A 0x076
  32. #define DA9150_FAULT_LOG_B 0x077
  33. #define DA9150_EVENT_E 0x078
  34. #define DA9150_EVENT_F 0x079
  35. #define DA9150_EVENT_G 0x07A
  36. #define DA9150_EVENT_H 0x07B
  37. #define DA9150_IRQ_MASK_E 0x07C
  38. #define DA9150_IRQ_MASK_F 0x07D
  39. #define DA9150_IRQ_MASK_G 0x07E
  40. #define DA9150_IRQ_MASK_H 0x07F
  41. #define DA9150_PAGE_CON_1 0x080
  42. #define DA9150_CONFIG_A 0x0E0
  43. #define DA9150_CONFIG_B 0x0E1
  44. #define DA9150_CONFIG_C 0x0E2
  45. #define DA9150_CONFIG_D 0x0E3
  46. #define DA9150_CONFIG_E 0x0E4
  47. #define DA9150_CONTROL_A 0x0E5
  48. #define DA9150_CONTROL_B 0x0E6
  49. #define DA9150_CONTROL_C 0x0E7
  50. #define DA9150_GPIO_A_B 0x0E8
  51. #define DA9150_GPIO_C_D 0x0E9
  52. #define DA9150_GPIO_MODE_CONT 0x0EA
  53. #define DA9150_GPIO_CTRL_B 0x0EB
  54. #define DA9150_GPIO_CTRL_A 0x0EC
  55. #define DA9150_GPIO_CTRL_C 0x0ED
  56. #define DA9150_GPIO_CFG_A 0x0EE
  57. #define DA9150_GPIO_CFG_B 0x0EF
  58. #define DA9150_GPIO_CFG_C 0x0F0
  59. #define DA9150_GPADC_MAN 0x0F2
  60. #define DA9150_GPADC_RES_A 0x0F4
  61. #define DA9150_GPADC_RES_B 0x0F5
  62. #define DA9150_PAGE_CON_2 0x100
  63. #define DA9150_OTP_CONT_SHARED 0x101
  64. #define DA9150_INTERFACE_SHARED 0x105
  65. #define DA9150_CONFIG_A_SHARED 0x106
  66. #define DA9150_CONFIG_D_SHARED 0x109
  67. #define DA9150_ADETVB_CFG_C 0x150
  68. #define DA9150_ADETD_STAT 0x151
  69. #define DA9150_ADET_CMPSTAT 0x152
  70. #define DA9150_ADET_CTRL_A 0x153
  71. #define DA9150_ADETVB_CFG_B 0x154
  72. #define DA9150_ADETVB_CFG_A 0x155
  73. #define DA9150_ADETAC_CFG_A 0x156
  74. #define DA9150_ADDETAC_CFG_B 0x157
  75. #define DA9150_ADETAC_CFG_C 0x158
  76. #define DA9150_ADETAC_CFG_D 0x159
  77. #define DA9150_ADETVB_CFG_D 0x15A
  78. #define DA9150_ADETID_CFG_A 0x15B
  79. #define DA9150_ADET_RID_PT_CHG_H 0x15C
  80. #define DA9150_ADET_RID_PT_CHG_L 0x15D
  81. #define DA9150_PPR_TCTR_B 0x160
  82. #define DA9150_PPR_BKCTRL_A 0x163
  83. #define DA9150_PPR_BKCFG_A 0x164
  84. #define DA9150_PPR_BKCFG_B 0x165
  85. #define DA9150_PPR_CHGCTRL_A 0x166
  86. #define DA9150_PPR_CHGCTRL_B 0x167
  87. #define DA9150_PPR_CHGCTRL_C 0x168
  88. #define DA9150_PPR_TCTR_A 0x169
  89. #define DA9150_PPR_CHGCTRL_D 0x16A
  90. #define DA9150_PPR_CHGCTRL_E 0x16B
  91. #define DA9150_PPR_CHGCTRL_F 0x16C
  92. #define DA9150_PPR_CHGCTRL_G 0x16D
  93. #define DA9150_PPR_CHGCTRL_H 0x16E
  94. #define DA9150_PPR_CHGCTRL_I 0x16F
  95. #define DA9150_PPR_CHGCTRL_J 0x170
  96. #define DA9150_PPR_CHGCTRL_K 0x171
  97. #define DA9150_PPR_CHGCTRL_L 0x172
  98. #define DA9150_PPR_CHGCTRL_M 0x173
  99. #define DA9150_PPR_THYST_A 0x174
  100. #define DA9150_PPR_THYST_B 0x175
  101. #define DA9150_PPR_THYST_C 0x176
  102. #define DA9150_PPR_THYST_D 0x177
  103. #define DA9150_PPR_THYST_E 0x178
  104. #define DA9150_PPR_THYST_F 0x179
  105. #define DA9150_PPR_THYST_G 0x17A
  106. #define DA9150_PAGE_CON_3 0x180
  107. #define DA9150_PAGE_CON_4 0x200
  108. #define DA9150_PAGE_CON_5 0x280
  109. #define DA9150_PAGE_CON_6 0x300
  110. #define DA9150_COREBTLD_STAT_A 0x302
  111. #define DA9150_COREBTLD_CTRL_A 0x303
  112. #define DA9150_CORE_CONFIG_A 0x304
  113. #define DA9150_CORE_CONFIG_C 0x305
  114. #define DA9150_CORE_CONFIG_B 0x306
  115. #define DA9150_CORE_CFG_DATA_A 0x307
  116. #define DA9150_CORE_CFG_DATA_B 0x308
  117. #define DA9150_CORE_CMD_A 0x309
  118. #define DA9150_CORE_DATA_A 0x30A
  119. #define DA9150_CORE_DATA_B 0x30B
  120. #define DA9150_CORE_DATA_C 0x30C
  121. #define DA9150_CORE_DATA_D 0x30D
  122. #define DA9150_CORE2WIRE_STAT_A 0x310
  123. #define DA9150_CORE2WIRE_CTRL_A 0x311
  124. #define DA9150_FW_CTRL_A 0x312
  125. #define DA9150_FW_CTRL_C 0x313
  126. #define DA9150_FW_CTRL_D 0x314
  127. #define DA9150_FG_CTRL_A 0x315
  128. #define DA9150_FG_CTRL_B 0x316
  129. #define DA9150_FW_CTRL_E 0x317
  130. #define DA9150_FW_CTRL_B 0x318
  131. #define DA9150_GPADC_CMAN 0x320
  132. #define DA9150_GPADC_CRES_A 0x322
  133. #define DA9150_GPADC_CRES_B 0x323
  134. #define DA9150_CC_CFG_A 0x328
  135. #define DA9150_CC_CFG_B 0x329
  136. #define DA9150_CC_ICHG_RES_A 0x32A
  137. #define DA9150_CC_ICHG_RES_B 0x32B
  138. #define DA9150_CC_IAVG_RES_A 0x32C
  139. #define DA9150_CC_IAVG_RES_B 0x32D
  140. #define DA9150_TAUX_CTRL_A 0x330
  141. #define DA9150_TAUX_RELOAD_H 0x332
  142. #define DA9150_TAUX_RELOAD_L 0x333
  143. #define DA9150_TAUX_VALUE_H 0x334
  144. #define DA9150_TAUX_VALUE_L 0x335
  145. #define DA9150_AUX_DATA_0 0x338
  146. #define DA9150_AUX_DATA_1 0x339
  147. #define DA9150_AUX_DATA_2 0x33A
  148. #define DA9150_AUX_DATA_3 0x33B
  149. #define DA9150_BIF_CTRL 0x340
  150. #define DA9150_TBAT_CTRL_A 0x342
  151. #define DA9150_TBAT_CTRL_B 0x343
  152. #define DA9150_TBAT_RES_A 0x344
  153. #define DA9150_TBAT_RES_B 0x345
  154. /* DA9150_PAGE_CON = 0x000 */
  155. #define DA9150_PAGE_SHIFT 0
  156. #define DA9150_PAGE_MASK (0x3f << 0)
  157. #define DA9150_I2C_PAGE_SHIFT 1
  158. #define DA9150_I2C_PAGE_MASK (0x1f << 1)
  159. #define DA9150_WRITE_MODE_SHIFT 6
  160. #define DA9150_WRITE_MODE_MASK BIT(6)
  161. #define DA9150_REVERT_SHIFT 7
  162. #define DA9150_REVERT_MASK BIT(7)
  163. /* DA9150_STATUS_A = 0x068 */
  164. #define DA9150_WKUP_STAT_SHIFT 2
  165. #define DA9150_WKUP_STAT_MASK (0x0f << 2)
  166. #define DA9150_SLEEP_STAT_SHIFT 6
  167. #define DA9150_SLEEP_STAT_MASK (0x03 << 6)
  168. /* DA9150_STATUS_B = 0x069 */
  169. #define DA9150_VFAULT_STAT_SHIFT 0
  170. #define DA9150_VFAULT_STAT_MASK BIT(0)
  171. #define DA9150_TFAULT_STAT_SHIFT 1
  172. #define DA9150_TFAULT_STAT_MASK BIT(1)
  173. /* DA9150_STATUS_C = 0x06A */
  174. #define DA9150_VDD33_STAT_SHIFT 0
  175. #define DA9150_VDD33_STAT_MASK BIT(0)
  176. #define DA9150_VDD33_SLEEP_SHIFT 1
  177. #define DA9150_VDD33_SLEEP_MASK BIT(1)
  178. #define DA9150_LFOSC_STAT_SHIFT 7
  179. #define DA9150_LFOSC_STAT_MASK BIT(7)
  180. /* DA9150_STATUS_D = 0x06B */
  181. #define DA9150_GPIOA_STAT_SHIFT 0
  182. #define DA9150_GPIOA_STAT_MASK BIT(0)
  183. #define DA9150_GPIOB_STAT_SHIFT 1
  184. #define DA9150_GPIOB_STAT_MASK BIT(1)
  185. #define DA9150_GPIOC_STAT_SHIFT 2
  186. #define DA9150_GPIOC_STAT_MASK BIT(2)
  187. #define DA9150_GPIOD_STAT_SHIFT 3
  188. #define DA9150_GPIOD_STAT_MASK BIT(3)
  189. /* DA9150_STATUS_E = 0x06C */
  190. #define DA9150_DTYPE_SHIFT 0
  191. #define DA9150_DTYPE_MASK (0x1f << 0)
  192. #define DA9150_DTYPE_DT_NIL (0x00 << 0)
  193. #define DA9150_DTYPE_DT_USB_OTG BIT(0)
  194. #define DA9150_DTYPE_DT_USB_STD (0x02 << 0)
  195. #define DA9150_DTYPE_DT_USB_CHG (0x03 << 0)
  196. #define DA9150_DTYPE_DT_ACA_CHG (0x04 << 0)
  197. #define DA9150_DTYPE_DT_ACA_OTG (0x05 << 0)
  198. #define DA9150_DTYPE_DT_ACA_DOC (0x06 << 0)
  199. #define DA9150_DTYPE_DT_DED_CHG (0x07 << 0)
  200. #define DA9150_DTYPE_DT_CR5_CHG (0x08 << 0)
  201. #define DA9150_DTYPE_DT_CR4_CHG (0x0c << 0)
  202. #define DA9150_DTYPE_DT_PT_CHG (0x11 << 0)
  203. #define DA9150_DTYPE_DT_NN_ACC (0x16 << 0)
  204. #define DA9150_DTYPE_DT_NN_CHG (0x17 << 0)
  205. /* DA9150_STATUS_F = 0x06D */
  206. #define DA9150_SESS_VLD_SHIFT 0
  207. #define DA9150_SESS_VLD_MASK BIT(0)
  208. #define DA9150_ID_ERR_SHIFT 1
  209. #define DA9150_ID_ERR_MASK BIT(1)
  210. #define DA9150_PT_CHG_SHIFT 2
  211. #define DA9150_PT_CHG_MASK BIT(2)
  212. /* DA9150_STATUS_G = 0x06E */
  213. #define DA9150_RID_SHIFT 0
  214. #define DA9150_RID_MASK (0xff << 0)
  215. /* DA9150_STATUS_H = 0x06F */
  216. #define DA9150_VBUS_STAT_SHIFT 0
  217. #define DA9150_VBUS_STAT_MASK (0x07 << 0)
  218. #define DA9150_VBUS_STAT_OFF (0x00 << 0)
  219. #define DA9150_VBUS_STAT_WAIT BIT(0)
  220. #define DA9150_VBUS_STAT_CHG (0x02 << 0)
  221. #define DA9150_VBUS_TRED_SHIFT 3
  222. #define DA9150_VBUS_TRED_MASK BIT(3)
  223. #define DA9150_VBUS_DROP_STAT_SHIFT 4
  224. #define DA9150_VBUS_DROP_STAT_MASK (0x0f << 4)
  225. /* DA9150_STATUS_I = 0x070 */
  226. #define DA9150_VBUS_ISET_STAT_SHIFT 0
  227. #define DA9150_VBUS_ISET_STAT_MASK (0x1f << 0)
  228. #define DA9150_VBUS_OT_SHIFT 7
  229. #define DA9150_VBUS_OT_MASK BIT(7)
  230. /* DA9150_STATUS_J = 0x071 */
  231. #define DA9150_CHG_STAT_SHIFT 0
  232. #define DA9150_CHG_STAT_MASK (0x0f << 0)
  233. #define DA9150_CHG_STAT_OFF (0x00 << 0)
  234. #define DA9150_CHG_STAT_SUSP BIT(0)
  235. #define DA9150_CHG_STAT_ACT (0x02 << 0)
  236. #define DA9150_CHG_STAT_PRE (0x03 << 0)
  237. #define DA9150_CHG_STAT_CC (0x04 << 0)
  238. #define DA9150_CHG_STAT_CV (0x05 << 0)
  239. #define DA9150_CHG_STAT_FULL (0x06 << 0)
  240. #define DA9150_CHG_STAT_TEMP (0x07 << 0)
  241. #define DA9150_CHG_STAT_TIME (0x08 << 0)
  242. #define DA9150_CHG_STAT_BAT (0x09 << 0)
  243. #define DA9150_CHG_TEMP_SHIFT 4
  244. #define DA9150_CHG_TEMP_MASK (0x07 << 4)
  245. #define DA9150_CHG_TEMP_UNDER (0x06 << 4)
  246. #define DA9150_CHG_TEMP_OVER (0x07 << 4)
  247. #define DA9150_CHG_IEND_STAT_SHIFT 7
  248. #define DA9150_CHG_IEND_STAT_MASK BIT(7)
  249. /* DA9150_STATUS_K = 0x072 */
  250. #define DA9150_CHG_IAV_H_SHIFT 0
  251. #define DA9150_CHG_IAV_H_MASK (0xff << 0)
  252. /* DA9150_STATUS_L = 0x073 */
  253. #define DA9150_CHG_IAV_L_SHIFT 5
  254. #define DA9150_CHG_IAV_L_MASK (0x07 << 5)
  255. /* DA9150_STATUS_N = 0x074 */
  256. #define DA9150_CHG_TIME_SHIFT 1
  257. #define DA9150_CHG_TIME_MASK BIT(1)
  258. #define DA9150_CHG_TRED_SHIFT 2
  259. #define DA9150_CHG_TRED_MASK BIT(2)
  260. #define DA9150_CHG_TJUNC_CLASS_SHIFT 3
  261. #define DA9150_CHG_TJUNC_CLASS_MASK (0x07 << 3)
  262. #define DA9150_CHG_TJUNC_CLASS_6 (0x06 << 3)
  263. #define DA9150_EBS_STAT_SHIFT 6
  264. #define DA9150_EBS_STAT_MASK BIT(6)
  265. #define DA9150_CHG_BAT_REMOVED_SHIFT 7
  266. #define DA9150_CHG_BAT_REMOVED_MASK BIT(7)
  267. /* DA9150_FAULT_LOG_A = 0x076 */
  268. #define DA9150_TEMP_FAULT_SHIFT 0
  269. #define DA9150_TEMP_FAULT_MASK BIT(0)
  270. #define DA9150_VSYS_FAULT_SHIFT 1
  271. #define DA9150_VSYS_FAULT_MASK BIT(1)
  272. #define DA9150_START_FAULT_SHIFT 2
  273. #define DA9150_START_FAULT_MASK BIT(2)
  274. #define DA9150_EXT_FAULT_SHIFT 3
  275. #define DA9150_EXT_FAULT_MASK BIT(3)
  276. #define DA9150_POR_FAULT_SHIFT 4
  277. #define DA9150_POR_FAULT_MASK BIT(4)
  278. /* DA9150_FAULT_LOG_B = 0x077 */
  279. #define DA9150_VBUS_FAULT_SHIFT 0
  280. #define DA9150_VBUS_FAULT_MASK BIT(0)
  281. #define DA9150_OTG_FAULT_SHIFT 1
  282. #define DA9150_OTG_FAULT_MASK BIT(1)
  283. /* DA9150_EVENT_E = 0x078 */
  284. #define DA9150_E_VBUS_SHIFT 0
  285. #define DA9150_E_VBUS_MASK BIT(0)
  286. #define DA9150_E_CHG_SHIFT 1
  287. #define DA9150_E_CHG_MASK BIT(1)
  288. #define DA9150_E_TCLASS_SHIFT 2
  289. #define DA9150_E_TCLASS_MASK BIT(2)
  290. #define DA9150_E_TJUNC_SHIFT 3
  291. #define DA9150_E_TJUNC_MASK BIT(3)
  292. #define DA9150_E_VFAULT_SHIFT 4
  293. #define DA9150_E_VFAULT_MASK BIT(4)
  294. #define DA9150_EVENTS_H_SHIFT 5
  295. #define DA9150_EVENTS_H_MASK BIT(5)
  296. #define DA9150_EVENTS_G_SHIFT 6
  297. #define DA9150_EVENTS_G_MASK BIT(6)
  298. #define DA9150_EVENTS_F_SHIFT 7
  299. #define DA9150_EVENTS_F_MASK BIT(7)
  300. /* DA9150_EVENT_F = 0x079 */
  301. #define DA9150_E_CONF_SHIFT 0
  302. #define DA9150_E_CONF_MASK BIT(0)
  303. #define DA9150_E_DAT_SHIFT 1
  304. #define DA9150_E_DAT_MASK BIT(1)
  305. #define DA9150_E_DTYPE_SHIFT 3
  306. #define DA9150_E_DTYPE_MASK BIT(3)
  307. #define DA9150_E_ID_SHIFT 4
  308. #define DA9150_E_ID_MASK BIT(4)
  309. #define DA9150_E_ADP_SHIFT 5
  310. #define DA9150_E_ADP_MASK BIT(5)
  311. #define DA9150_E_SESS_END_SHIFT 6
  312. #define DA9150_E_SESS_END_MASK BIT(6)
  313. #define DA9150_E_SESS_VLD_SHIFT 7
  314. #define DA9150_E_SESS_VLD_MASK BIT(7)
  315. /* DA9150_EVENT_G = 0x07A */
  316. #define DA9150_E_FG_SHIFT 0
  317. #define DA9150_E_FG_MASK BIT(0)
  318. #define DA9150_E_GP_SHIFT 1
  319. #define DA9150_E_GP_MASK BIT(1)
  320. #define DA9150_E_TBAT_SHIFT 2
  321. #define DA9150_E_TBAT_MASK BIT(2)
  322. #define DA9150_E_GPIOA_SHIFT 3
  323. #define DA9150_E_GPIOA_MASK BIT(3)
  324. #define DA9150_E_GPIOB_SHIFT 4
  325. #define DA9150_E_GPIOB_MASK BIT(4)
  326. #define DA9150_E_GPIOC_SHIFT 5
  327. #define DA9150_E_GPIOC_MASK BIT(5)
  328. #define DA9150_E_GPIOD_SHIFT 6
  329. #define DA9150_E_GPIOD_MASK BIT(6)
  330. #define DA9150_E_GPADC_SHIFT 7
  331. #define DA9150_E_GPADC_MASK BIT(7)
  332. /* DA9150_EVENT_H = 0x07B */
  333. #define DA9150_E_WKUP_SHIFT 0
  334. #define DA9150_E_WKUP_MASK BIT(0)
  335. /* DA9150_IRQ_MASK_E = 0x07C */
  336. #define DA9150_M_VBUS_SHIFT 0
  337. #define DA9150_M_VBUS_MASK BIT(0)
  338. #define DA9150_M_CHG_SHIFT 1
  339. #define DA9150_M_CHG_MASK BIT(1)
  340. #define DA9150_M_TJUNC_SHIFT 3
  341. #define DA9150_M_TJUNC_MASK BIT(3)
  342. #define DA9150_M_VFAULT_SHIFT 4
  343. #define DA9150_M_VFAULT_MASK BIT(4)
  344. /* DA9150_IRQ_MASK_F = 0x07D */
  345. #define DA9150_M_CONF_SHIFT 0
  346. #define DA9150_M_CONF_MASK BIT(0)
  347. #define DA9150_M_DAT_SHIFT 1
  348. #define DA9150_M_DAT_MASK BIT(1)
  349. #define DA9150_M_DTYPE_SHIFT 3
  350. #define DA9150_M_DTYPE_MASK BIT(3)
  351. #define DA9150_M_ID_SHIFT 4
  352. #define DA9150_M_ID_MASK BIT(4)
  353. #define DA9150_M_ADP_SHIFT 5
  354. #define DA9150_M_ADP_MASK BIT(5)
  355. #define DA9150_M_SESS_END_SHIFT 6
  356. #define DA9150_M_SESS_END_MASK BIT(6)
  357. #define DA9150_M_SESS_VLD_SHIFT 7
  358. #define DA9150_M_SESS_VLD_MASK BIT(7)
  359. /* DA9150_IRQ_MASK_G = 0x07E */
  360. #define DA9150_M_FG_SHIFT 0
  361. #define DA9150_M_FG_MASK BIT(0)
  362. #define DA9150_M_GP_SHIFT 1
  363. #define DA9150_M_GP_MASK BIT(1)
  364. #define DA9150_M_TBAT_SHIFT 2
  365. #define DA9150_M_TBAT_MASK BIT(2)
  366. #define DA9150_M_GPIOA_SHIFT 3
  367. #define DA9150_M_GPIOA_MASK BIT(3)
  368. #define DA9150_M_GPIOB_SHIFT 4
  369. #define DA9150_M_GPIOB_MASK BIT(4)
  370. #define DA9150_M_GPIOC_SHIFT 5
  371. #define DA9150_M_GPIOC_MASK BIT(5)
  372. #define DA9150_M_GPIOD_SHIFT 6
  373. #define DA9150_M_GPIOD_MASK BIT(6)
  374. #define DA9150_M_GPADC_SHIFT 7
  375. #define DA9150_M_GPADC_MASK BIT(7)
  376. /* DA9150_IRQ_MASK_H = 0x07F */
  377. #define DA9150_M_WKUP_SHIFT 0
  378. #define DA9150_M_WKUP_MASK BIT(0)
  379. /* DA9150_PAGE_CON_1 = 0x080 */
  380. #define DA9150_PAGE_SHIFT 0
  381. #define DA9150_PAGE_MASK (0x3f << 0)
  382. #define DA9150_WRITE_MODE_SHIFT 6
  383. #define DA9150_WRITE_MODE_MASK BIT(6)
  384. #define DA9150_REVERT_SHIFT 7
  385. #define DA9150_REVERT_MASK BIT(7)
  386. /* DA9150_CONFIG_A = 0x0E0 */
  387. #define DA9150_RESET_DUR_SHIFT 0
  388. #define DA9150_RESET_DUR_MASK (0x03 << 0)
  389. #define DA9150_RESET_EXT_SHIFT 2
  390. #define DA9150_RESET_EXT_MASK (0x03 << 2)
  391. #define DA9150_START_MAX_SHIFT 4
  392. #define DA9150_START_MAX_MASK (0x03 << 4)
  393. #define DA9150_PS_WAIT_EN_SHIFT 6
  394. #define DA9150_PS_WAIT_EN_MASK BIT(6)
  395. #define DA9150_PS_DISABLE_DIRECT_SHIFT 7
  396. #define DA9150_PS_DISABLE_DIRECT_MASK BIT(7)
  397. /* DA9150_CONFIG_B = 0x0E1 */
  398. #define DA9150_VFAULT_ADJ_SHIFT 0
  399. #define DA9150_VFAULT_ADJ_MASK (0x0f << 0)
  400. #define DA9150_VFAULT_HYST_SHIFT 4
  401. #define DA9150_VFAULT_HYST_MASK (0x07 << 4)
  402. #define DA9150_VFAULT_EN_SHIFT 7
  403. #define DA9150_VFAULT_EN_MASK BIT(7)
  404. /* DA9150_CONFIG_C = 0x0E2 */
  405. #define DA9150_VSYS_MIN_SHIFT 3
  406. #define DA9150_VSYS_MIN_MASK (0x1f << 3)
  407. /* DA9150_CONFIG_D = 0x0E3 */
  408. #define DA9150_LFOSC_EXT_SHIFT 0
  409. #define DA9150_LFOSC_EXT_MASK BIT(0)
  410. #define DA9150_VDD33_DWN_SHIFT 1
  411. #define DA9150_VDD33_DWN_MASK BIT(1)
  412. #define DA9150_WKUP_PM_EN_SHIFT 2
  413. #define DA9150_WKUP_PM_EN_MASK BIT(2)
  414. #define DA9150_WKUP_CE_SEL_SHIFT 3
  415. #define DA9150_WKUP_CE_SEL_MASK (0x03 << 3)
  416. #define DA9150_WKUP_CLK32K_EN_SHIFT 5
  417. #define DA9150_WKUP_CLK32K_EN_MASK BIT(5)
  418. #define DA9150_DISABLE_DEL_SHIFT 7
  419. #define DA9150_DISABLE_DEL_MASK BIT(7)
  420. /* DA9150_CONFIG_E = 0x0E4 */
  421. #define DA9150_PM_SPKSUP_DIS_SHIFT 0
  422. #define DA9150_PM_SPKSUP_DIS_MASK BIT(0)
  423. #define DA9150_PM_MERGE_SHIFT 1
  424. #define DA9150_PM_MERGE_MASK BIT(1)
  425. #define DA9150_PM_SR_OFF_SHIFT 2
  426. #define DA9150_PM_SR_OFF_MASK BIT(2)
  427. #define DA9150_PM_TIMEOUT_EN_SHIFT 3
  428. #define DA9150_PM_TIMEOUT_EN_MASK BIT(3)
  429. #define DA9150_PM_DLY_SEL_SHIFT 4
  430. #define DA9150_PM_DLY_SEL_MASK (0x07 << 4)
  431. #define DA9150_PM_OUT_DLY_SEL_SHIFT 7
  432. #define DA9150_PM_OUT_DLY_SEL_MASK BIT(7)
  433. /* DA9150_CONTROL_A = 0x0E5 */
  434. #define DA9150_VDD33_SL_SHIFT 0
  435. #define DA9150_VDD33_SL_MASK BIT(0)
  436. #define DA9150_VDD33_LPM_SHIFT 1
  437. #define DA9150_VDD33_LPM_MASK (0x03 << 1)
  438. #define DA9150_VDD33_EN_SHIFT 3
  439. #define DA9150_VDD33_EN_MASK BIT(3)
  440. #define DA9150_GPI_LPM_SHIFT 6
  441. #define DA9150_GPI_LPM_MASK BIT(6)
  442. #define DA9150_PM_IF_LPM_SHIFT 7
  443. #define DA9150_PM_IF_LPM_MASK BIT(7)
  444. /* DA9150_CONTROL_B = 0x0E6 */
  445. #define DA9150_LPM_SHIFT 0
  446. #define DA9150_LPM_MASK BIT(0)
  447. #define DA9150_RESET_SHIFT 1
  448. #define DA9150_RESET_MASK BIT(1)
  449. #define DA9150_RESET_USRCONF_EN_SHIFT 2
  450. #define DA9150_RESET_USRCONF_EN_MASK BIT(2)
  451. /* DA9150_CONTROL_C = 0x0E7 */
  452. #define DA9150_DISABLE_SHIFT 0
  453. #define DA9150_DISABLE_MASK BIT(0)
  454. /* DA9150_GPIO_A_B = 0x0E8 */
  455. #define DA9150_GPIOA_PIN_SHIFT 0
  456. #define DA9150_GPIOA_PIN_MASK (0x07 << 0)
  457. #define DA9150_GPIOA_PIN_GPI (0x00 << 0)
  458. #define DA9150_GPIOA_PIN_GPO_OD BIT(0)
  459. #define DA9150_GPIOA_TYPE_SHIFT 3
  460. #define DA9150_GPIOA_TYPE_MASK BIT(3)
  461. #define DA9150_GPIOB_PIN_SHIFT 4
  462. #define DA9150_GPIOB_PIN_MASK (0x07 << 4)
  463. #define DA9150_GPIOB_PIN_GPI (0x00 << 4)
  464. #define DA9150_GPIOB_PIN_GPO_OD BIT(4)
  465. #define DA9150_GPIOB_TYPE_SHIFT 7
  466. #define DA9150_GPIOB_TYPE_MASK BIT(7)
  467. /* DA9150_GPIO_C_D = 0x0E9 */
  468. #define DA9150_GPIOC_PIN_SHIFT 0
  469. #define DA9150_GPIOC_PIN_MASK (0x07 << 0)
  470. #define DA9150_GPIOC_PIN_GPI (0x00 << 0)
  471. #define DA9150_GPIOC_PIN_GPO_OD BIT(0)
  472. #define DA9150_GPIOC_TYPE_SHIFT 3
  473. #define DA9150_GPIOC_TYPE_MASK BIT(3)
  474. #define DA9150_GPIOD_PIN_SHIFT 4
  475. #define DA9150_GPIOD_PIN_MASK (0x07 << 4)
  476. #define DA9150_GPIOD_PIN_GPI (0x00 << 4)
  477. #define DA9150_GPIOD_PIN_GPO_OD BIT(4)
  478. #define DA9150_GPIOD_TYPE_SHIFT 7
  479. #define DA9150_GPIOD_TYPE_MASK BIT(7)
  480. /* DA9150_GPIO_MODE_CONT = 0x0EA */
  481. #define DA9150_GPIOA_MODE_SHIFT 0
  482. #define DA9150_GPIOA_MODE_MASK BIT(0)
  483. #define DA9150_GPIOB_MODE_SHIFT 1
  484. #define DA9150_GPIOB_MODE_MASK BIT(1)
  485. #define DA9150_GPIOC_MODE_SHIFT 2
  486. #define DA9150_GPIOC_MODE_MASK BIT(2)
  487. #define DA9150_GPIOD_MODE_SHIFT 3
  488. #define DA9150_GPIOD_MODE_MASK BIT(3)
  489. #define DA9150_GPIOA_CONT_SHIFT 4
  490. #define DA9150_GPIOA_CONT_MASK BIT(4)
  491. #define DA9150_GPIOB_CONT_SHIFT 5
  492. #define DA9150_GPIOB_CONT_MASK BIT(5)
  493. #define DA9150_GPIOC_CONT_SHIFT 6
  494. #define DA9150_GPIOC_CONT_MASK BIT(6)
  495. #define DA9150_GPIOD_CONT_SHIFT 7
  496. #define DA9150_GPIOD_CONT_MASK BIT(7)
  497. /* DA9150_GPIO_CTRL_B = 0x0EB */
  498. #define DA9150_WAKE_PIN_SHIFT 0
  499. #define DA9150_WAKE_PIN_MASK (0x03 << 0)
  500. #define DA9150_WAKE_MODE_SHIFT 2
  501. #define DA9150_WAKE_MODE_MASK BIT(2)
  502. #define DA9150_WAKE_CONT_SHIFT 3
  503. #define DA9150_WAKE_CONT_MASK BIT(3)
  504. #define DA9150_WAKE_DLY_SHIFT 4
  505. #define DA9150_WAKE_DLY_MASK BIT(4)
  506. /* DA9150_GPIO_CTRL_A = 0x0EC */
  507. #define DA9150_GPIOA_ANAEN_SHIFT 0
  508. #define DA9150_GPIOA_ANAEN_MASK BIT(0)
  509. #define DA9150_GPIOB_ANAEN_SHIFT 1
  510. #define DA9150_GPIOB_ANAEN_MASK BIT(1)
  511. #define DA9150_GPIOC_ANAEN_SHIFT 2
  512. #define DA9150_GPIOC_ANAEN_MASK BIT(2)
  513. #define DA9150_GPIOD_ANAEN_SHIFT 3
  514. #define DA9150_GPIOD_ANAEN_MASK BIT(3)
  515. #define DA9150_GPIO_ANAEN 0x01
  516. #define DA9150_GPIO_ANAEN_MASK 0x0F
  517. #define DA9150_CHGLED_PIN_SHIFT 5
  518. #define DA9150_CHGLED_PIN_MASK (0x07 << 5)
  519. /* DA9150_GPIO_CTRL_C = 0x0ED */
  520. #define DA9150_CHGBL_DUR_SHIFT 0
  521. #define DA9150_CHGBL_DUR_MASK (0x03 << 0)
  522. #define DA9150_CHGBL_DBL_SHIFT 2
  523. #define DA9150_CHGBL_DBL_MASK BIT(2)
  524. #define DA9150_CHGBL_FRQ_SHIFT 3
  525. #define DA9150_CHGBL_FRQ_MASK (0x03 << 3)
  526. #define DA9150_CHGBL_FLKR_SHIFT 5
  527. #define DA9150_CHGBL_FLKR_MASK BIT(5)
  528. /* DA9150_GPIO_CFG_A = 0x0EE */
  529. #define DA9150_CE_LPM_DEB_SHIFT 0
  530. #define DA9150_CE_LPM_DEB_MASK (0x07 << 0)
  531. /* DA9150_GPIO_CFG_B = 0x0EF */
  532. #define DA9150_GPIOA_PUPD_SHIFT 0
  533. #define DA9150_GPIOA_PUPD_MASK BIT(0)
  534. #define DA9150_GPIOB_PUPD_SHIFT 1
  535. #define DA9150_GPIOB_PUPD_MASK BIT(1)
  536. #define DA9150_GPIOC_PUPD_SHIFT 2
  537. #define DA9150_GPIOC_PUPD_MASK BIT(2)
  538. #define DA9150_GPIOD_PUPD_SHIFT 3
  539. #define DA9150_GPIOD_PUPD_MASK BIT(3)
  540. #define DA9150_GPIO_PUPD_MASK (0xF << 0)
  541. #define DA9150_GPI_DEB_SHIFT 4
  542. #define DA9150_GPI_DEB_MASK (0x07 << 4)
  543. #define DA9150_LPM_EN_SHIFT 7
  544. #define DA9150_LPM_EN_MASK BIT(7)
  545. /* DA9150_GPIO_CFG_C = 0x0F0 */
  546. #define DA9150_GPI_V_SHIFT 0
  547. #define DA9150_GPI_V_MASK BIT(0)
  548. #define DA9150_VDDIO_INT_SHIFT 1
  549. #define DA9150_VDDIO_INT_MASK BIT(1)
  550. #define DA9150_FAULT_PIN_SHIFT 3
  551. #define DA9150_FAULT_PIN_MASK (0x07 << 3)
  552. #define DA9150_FAULT_TYPE_SHIFT 6
  553. #define DA9150_FAULT_TYPE_MASK BIT(6)
  554. #define DA9150_NIRQ_PUPD_SHIFT 7
  555. #define DA9150_NIRQ_PUPD_MASK BIT(7)
  556. /* DA9150_GPADC_MAN = 0x0F2 */
  557. #define DA9150_GPADC_EN_SHIFT 0
  558. #define DA9150_GPADC_EN_MASK BIT(0)
  559. #define DA9150_GPADC_MUX_SHIFT 1
  560. #define DA9150_GPADC_MUX_MASK (0x1f << 1)
  561. /* DA9150_GPADC_RES_A = 0x0F4 */
  562. #define DA9150_GPADC_RES_H_SHIFT 0
  563. #define DA9150_GPADC_RES_H_MASK (0xff << 0)
  564. /* DA9150_GPADC_RES_B = 0x0F5 */
  565. #define DA9150_GPADC_RUN_SHIFT 0
  566. #define DA9150_GPADC_RUN_MASK BIT(0)
  567. #define DA9150_GPADC_RES_L_SHIFT 6
  568. #define DA9150_GPADC_RES_L_MASK (0x03 << 6)
  569. #define DA9150_GPADC_RES_L_BITS 2
  570. /* DA9150_PAGE_CON_2 = 0x100 */
  571. #define DA9150_PAGE_SHIFT 0
  572. #define DA9150_PAGE_MASK (0x3f << 0)
  573. #define DA9150_WRITE_MODE_SHIFT 6
  574. #define DA9150_WRITE_MODE_MASK BIT(6)
  575. #define DA9150_REVERT_SHIFT 7
  576. #define DA9150_REVERT_MASK BIT(7)
  577. /* DA9150_OTP_CONT_SHARED = 0x101 */
  578. #define DA9150_PC_DONE_SHIFT 3
  579. #define DA9150_PC_DONE_MASK BIT(3)
  580. /* DA9150_INTERFACE_SHARED = 0x105 */
  581. #define DA9150_IF_BASE_ADDR_SHIFT 4
  582. #define DA9150_IF_BASE_ADDR_MASK (0x0f << 4)
  583. /* DA9150_CONFIG_A_SHARED = 0x106 */
  584. #define DA9150_NIRQ_VDD_SHIFT 1
  585. #define DA9150_NIRQ_VDD_MASK BIT(1)
  586. #define DA9150_NIRQ_PIN_SHIFT 2
  587. #define DA9150_NIRQ_PIN_MASK BIT(2)
  588. #define DA9150_NIRQ_TYPE_SHIFT 3
  589. #define DA9150_NIRQ_TYPE_MASK BIT(3)
  590. #define DA9150_PM_IF_V_SHIFT 4
  591. #define DA9150_PM_IF_V_MASK BIT(4)
  592. #define DA9150_PM_IF_FMP_SHIFT 5
  593. #define DA9150_PM_IF_FMP_MASK BIT(5)
  594. #define DA9150_PM_IF_HSM_SHIFT 6
  595. #define DA9150_PM_IF_HSM_MASK BIT(6)
  596. /* DA9150_CONFIG_D_SHARED = 0x109 */
  597. #define DA9150_NIRQ_MODE_SHIFT 1
  598. #define DA9150_NIRQ_MODE_MASK BIT(1)
  599. /* DA9150_ADETVB_CFG_C = 0x150 */
  600. #define DA9150_TADP_RISE_SHIFT 0
  601. #define DA9150_TADP_RISE_MASK (0xff << 0)
  602. /* DA9150_ADETD_STAT = 0x151 */
  603. #define DA9150_DCD_STAT_SHIFT 0
  604. #define DA9150_DCD_STAT_MASK BIT(0)
  605. #define DA9150_PCD_STAT_SHIFT 1
  606. #define DA9150_PCD_STAT_MASK (0x03 << 1)
  607. #define DA9150_SCD_STAT_SHIFT 3
  608. #define DA9150_SCD_STAT_MASK (0x03 << 3)
  609. #define DA9150_DP_STAT_SHIFT 5
  610. #define DA9150_DP_STAT_MASK BIT(5)
  611. #define DA9150_DM_STAT_SHIFT 6
  612. #define DA9150_DM_STAT_MASK BIT(6)
  613. /* DA9150_ADET_CMPSTAT = 0x152 */
  614. #define DA9150_DP_COMP_SHIFT 1
  615. #define DA9150_DP_COMP_MASK BIT(1)
  616. #define DA9150_DM_COMP_SHIFT 2
  617. #define DA9150_DM_COMP_MASK BIT(2)
  618. #define DA9150_ADP_SNS_COMP_SHIFT 3
  619. #define DA9150_ADP_SNS_COMP_MASK BIT(3)
  620. #define DA9150_ADP_PRB_COMP_SHIFT 4
  621. #define DA9150_ADP_PRB_COMP_MASK BIT(4)
  622. #define DA9150_ID_COMP_SHIFT 5
  623. #define DA9150_ID_COMP_MASK BIT(5)
  624. /* DA9150_ADET_CTRL_A = 0x153 */
  625. #define DA9150_AID_DAT_SHIFT 0
  626. #define DA9150_AID_DAT_MASK BIT(0)
  627. #define DA9150_AID_ID_SHIFT 1
  628. #define DA9150_AID_ID_MASK BIT(1)
  629. #define DA9150_AID_TRIG_SHIFT 2
  630. #define DA9150_AID_TRIG_MASK BIT(2)
  631. /* DA9150_ADETVB_CFG_B = 0x154 */
  632. #define DA9150_VB_MODE_SHIFT 0
  633. #define DA9150_VB_MODE_MASK (0x03 << 0)
  634. #define DA9150_VB_MODE_VB_SESS BIT(0)
  635. #define DA9150_TADP_PRB_SHIFT 2
  636. #define DA9150_TADP_PRB_MASK BIT(2)
  637. #define DA9150_DAT_RPD_EXT_SHIFT 5
  638. #define DA9150_DAT_RPD_EXT_MASK BIT(5)
  639. #define DA9150_CONF_RPD_SHIFT 6
  640. #define DA9150_CONF_RPD_MASK BIT(6)
  641. #define DA9150_CONF_SRP_SHIFT 7
  642. #define DA9150_CONF_SRP_MASK BIT(7)
  643. /* DA9150_ADETVB_CFG_A = 0x155 */
  644. #define DA9150_AID_MODE_SHIFT 0
  645. #define DA9150_AID_MODE_MASK (0x03 << 0)
  646. #define DA9150_AID_EXT_POL_SHIFT 2
  647. #define DA9150_AID_EXT_POL_MASK BIT(2)
  648. /* DA9150_ADETAC_CFG_A = 0x156 */
  649. #define DA9150_ISET_CDP_SHIFT 0
  650. #define DA9150_ISET_CDP_MASK (0x1f << 0)
  651. #define DA9150_CONF_DBP_SHIFT 5
  652. #define DA9150_CONF_DBP_MASK BIT(5)
  653. /* DA9150_ADDETAC_CFG_B = 0x157 */
  654. #define DA9150_ISET_DCHG_SHIFT 0
  655. #define DA9150_ISET_DCHG_MASK (0x1f << 0)
  656. #define DA9150_CONF_GPIOA_SHIFT 5
  657. #define DA9150_CONF_GPIOA_MASK BIT(5)
  658. #define DA9150_CONF_GPIOB_SHIFT 6
  659. #define DA9150_CONF_GPIOB_MASK BIT(6)
  660. #define DA9150_AID_VB_SHIFT 7
  661. #define DA9150_AID_VB_MASK BIT(7)
  662. /* DA9150_ADETAC_CFG_C = 0x158 */
  663. #define DA9150_ISET_DEF_SHIFT 0
  664. #define DA9150_ISET_DEF_MASK (0x1f << 0)
  665. #define DA9150_CONF_MODE_SHIFT 5
  666. #define DA9150_CONF_MODE_MASK (0x03 << 5)
  667. #define DA9150_AID_CR_DIS_SHIFT 7
  668. #define DA9150_AID_CR_DIS_MASK BIT(7)
  669. /* DA9150_ADETAC_CFG_D = 0x159 */
  670. #define DA9150_ISET_UNIT_SHIFT 0
  671. #define DA9150_ISET_UNIT_MASK (0x1f << 0)
  672. #define DA9150_AID_UNCLAMP_SHIFT 5
  673. #define DA9150_AID_UNCLAMP_MASK BIT(5)
  674. /* DA9150_ADETVB_CFG_D = 0x15A */
  675. #define DA9150_ID_MODE_SHIFT 0
  676. #define DA9150_ID_MODE_MASK (0x03 << 0)
  677. #define DA9150_DAT_MODE_SHIFT 2
  678. #define DA9150_DAT_MODE_MASK (0x0f << 2)
  679. #define DA9150_DAT_SWP_SHIFT 6
  680. #define DA9150_DAT_SWP_MASK BIT(6)
  681. #define DA9150_DAT_CLAMP_EXT_SHIFT 7
  682. #define DA9150_DAT_CLAMP_EXT_MASK BIT(7)
  683. /* DA9150_ADETID_CFG_A = 0x15B */
  684. #define DA9150_TID_POLL_SHIFT 0
  685. #define DA9150_TID_POLL_MASK (0x07 << 0)
  686. #define DA9150_RID_CONV_SHIFT 3
  687. #define DA9150_RID_CONV_MASK BIT(3)
  688. /* DA9150_ADET_RID_PT_CHG_H = 0x15C */
  689. #define DA9150_RID_PT_CHG_H_SHIFT 0
  690. #define DA9150_RID_PT_CHG_H_MASK (0xff << 0)
  691. /* DA9150_ADET_RID_PT_CHG_L = 0x15D */
  692. #define DA9150_RID_PT_CHG_L_SHIFT 6
  693. #define DA9150_RID_PT_CHG_L_MASK (0x03 << 6)
  694. /* DA9150_PPR_TCTR_B = 0x160 */
  695. #define DA9150_CHG_TCTR_VAL_SHIFT 0
  696. #define DA9150_CHG_TCTR_VAL_MASK (0xff << 0)
  697. /* DA9150_PPR_BKCTRL_A = 0x163 */
  698. #define DA9150_VBUS_MODE_SHIFT 0
  699. #define DA9150_VBUS_MODE_MASK (0x03 << 0)
  700. #define DA9150_VBUS_MODE_CHG BIT(0)
  701. #define DA9150_VBUS_MODE_OTG (0x02 << 0)
  702. #define DA9150_VBUS_LPM_SHIFT 2
  703. #define DA9150_VBUS_LPM_MASK (0x03 << 2)
  704. #define DA9150_VBUS_SUSP_SHIFT 4
  705. #define DA9150_VBUS_SUSP_MASK BIT(4)
  706. #define DA9150_VBUS_PWM_SHIFT 5
  707. #define DA9150_VBUS_PWM_MASK BIT(5)
  708. #define DA9150_VBUS_ISO_SHIFT 6
  709. #define DA9150_VBUS_ISO_MASK BIT(6)
  710. #define DA9150_VBUS_LDO_SHIFT 7
  711. #define DA9150_VBUS_LDO_MASK BIT(7)
  712. /* DA9150_PPR_BKCFG_A = 0x164 */
  713. #define DA9150_VBUS_ISET_SHIFT 0
  714. #define DA9150_VBUS_ISET_MASK (0x1f << 0)
  715. #define DA9150_VBUS_IMAX_SHIFT 5
  716. #define DA9150_VBUS_IMAX_MASK BIT(5)
  717. #define DA9150_VBUS_IOTG_SHIFT 6
  718. #define DA9150_VBUS_IOTG_MASK (0x03 << 6)
  719. /* DA9150_PPR_BKCFG_B = 0x165 */
  720. #define DA9150_VBUS_DROP_SHIFT 0
  721. #define DA9150_VBUS_DROP_MASK (0x0f << 0)
  722. #define DA9150_VBUS_FAULT_DIS_SHIFT 6
  723. #define DA9150_VBUS_FAULT_DIS_MASK BIT(6)
  724. #define DA9150_OTG_FAULT_DIS_SHIFT 7
  725. #define DA9150_OTG_FAULT_DIS_MASK BIT(7)
  726. /* DA9150_PPR_CHGCTRL_A = 0x166 */
  727. #define DA9150_CHG_EN_SHIFT 0
  728. #define DA9150_CHG_EN_MASK BIT(0)
  729. /* DA9150_PPR_CHGCTRL_B = 0x167 */
  730. #define DA9150_CHG_VBAT_SHIFT 0
  731. #define DA9150_CHG_VBAT_MASK (0x1f << 0)
  732. #define DA9150_CHG_VDROP_SHIFT 6
  733. #define DA9150_CHG_VDROP_MASK (0x03 << 6)
  734. /* DA9150_PPR_CHGCTRL_C = 0x168 */
  735. #define DA9150_CHG_VFAULT_SHIFT 0
  736. #define DA9150_CHG_VFAULT_MASK (0x0f << 0)
  737. #define DA9150_CHG_IPRE_SHIFT 4
  738. #define DA9150_CHG_IPRE_MASK (0x03 << 4)
  739. /* DA9150_PPR_TCTR_A = 0x169 */
  740. #define DA9150_CHG_TCTR_SHIFT 0
  741. #define DA9150_CHG_TCTR_MASK (0x07 << 0)
  742. #define DA9150_CHG_TCTR_MODE_SHIFT 4
  743. #define DA9150_CHG_TCTR_MODE_MASK BIT(4)
  744. /* DA9150_PPR_CHGCTRL_D = 0x16A */
  745. #define DA9150_CHG_IBAT_SHIFT 0
  746. #define DA9150_CHG_IBAT_MASK (0xff << 0)
  747. /* DA9150_PPR_CHGCTRL_E = 0x16B */
  748. #define DA9150_CHG_IEND_SHIFT 0
  749. #define DA9150_CHG_IEND_MASK (0xff << 0)
  750. /* DA9150_PPR_CHGCTRL_F = 0x16C */
  751. #define DA9150_CHG_VCOLD_SHIFT 0
  752. #define DA9150_CHG_VCOLD_MASK (0x1f << 0)
  753. #define DA9150_TBAT_TQA_EN_SHIFT 6
  754. #define DA9150_TBAT_TQA_EN_MASK BIT(6)
  755. #define DA9150_TBAT_TDP_EN_SHIFT 7
  756. #define DA9150_TBAT_TDP_EN_MASK BIT(7)
  757. /* DA9150_PPR_CHGCTRL_G = 0x16D */
  758. #define DA9150_CHG_VWARM_SHIFT 0
  759. #define DA9150_CHG_VWARM_MASK (0x1f << 0)
  760. /* DA9150_PPR_CHGCTRL_H = 0x16E */
  761. #define DA9150_CHG_VHOT_SHIFT 0
  762. #define DA9150_CHG_VHOT_MASK (0x1f << 0)
  763. /* DA9150_PPR_CHGCTRL_I = 0x16F */
  764. #define DA9150_CHG_ICOLD_SHIFT 0
  765. #define DA9150_CHG_ICOLD_MASK (0xff << 0)
  766. /* DA9150_PPR_CHGCTRL_J = 0x170 */
  767. #define DA9150_CHG_IWARM_SHIFT 0
  768. #define DA9150_CHG_IWARM_MASK (0xff << 0)
  769. /* DA9150_PPR_CHGCTRL_K = 0x171 */
  770. #define DA9150_CHG_IHOT_SHIFT 0
  771. #define DA9150_CHG_IHOT_MASK (0xff << 0)
  772. /* DA9150_PPR_CHGCTRL_L = 0x172 */
  773. #define DA9150_CHG_IBAT_TRED_SHIFT 0
  774. #define DA9150_CHG_IBAT_TRED_MASK (0xff << 0)
  775. /* DA9150_PPR_CHGCTRL_M = 0x173 */
  776. #define DA9150_CHG_VFLOAT_SHIFT 0
  777. #define DA9150_CHG_VFLOAT_MASK (0x0f << 0)
  778. #define DA9150_CHG_LPM_SHIFT 5
  779. #define DA9150_CHG_LPM_MASK BIT(5)
  780. #define DA9150_CHG_NBLO_SHIFT 6
  781. #define DA9150_CHG_NBLO_MASK BIT(6)
  782. #define DA9150_EBS_EN_SHIFT 7
  783. #define DA9150_EBS_EN_MASK BIT(7)
  784. /* DA9150_PPR_THYST_A = 0x174 */
  785. #define DA9150_TBAT_T1_SHIFT 0
  786. #define DA9150_TBAT_T1_MASK (0xff << 0)
  787. /* DA9150_PPR_THYST_B = 0x175 */
  788. #define DA9150_TBAT_T2_SHIFT 0
  789. #define DA9150_TBAT_T2_MASK (0xff << 0)
  790. /* DA9150_PPR_THYST_C = 0x176 */
  791. #define DA9150_TBAT_T3_SHIFT 0
  792. #define DA9150_TBAT_T3_MASK (0xff << 0)
  793. /* DA9150_PPR_THYST_D = 0x177 */
  794. #define DA9150_TBAT_T4_SHIFT 0
  795. #define DA9150_TBAT_T4_MASK (0xff << 0)
  796. /* DA9150_PPR_THYST_E = 0x178 */
  797. #define DA9150_TBAT_T5_SHIFT 0
  798. #define DA9150_TBAT_T5_MASK (0xff << 0)
  799. /* DA9150_PPR_THYST_F = 0x179 */
  800. #define DA9150_TBAT_H1_SHIFT 0
  801. #define DA9150_TBAT_H1_MASK (0xff << 0)
  802. /* DA9150_PPR_THYST_G = 0x17A */
  803. #define DA9150_TBAT_H5_SHIFT 0
  804. #define DA9150_TBAT_H5_MASK (0xff << 0)
  805. /* DA9150_PAGE_CON_3 = 0x180 */
  806. #define DA9150_PAGE_SHIFT 0
  807. #define DA9150_PAGE_MASK (0x3f << 0)
  808. #define DA9150_WRITE_MODE_SHIFT 6
  809. #define DA9150_WRITE_MODE_MASK BIT(6)
  810. #define DA9150_REVERT_SHIFT 7
  811. #define DA9150_REVERT_MASK BIT(7)
  812. /* DA9150_PAGE_CON_4 = 0x200 */
  813. #define DA9150_PAGE_SHIFT 0
  814. #define DA9150_PAGE_MASK (0x3f << 0)
  815. #define DA9150_WRITE_MODE_SHIFT 6
  816. #define DA9150_WRITE_MODE_MASK BIT(6)
  817. #define DA9150_REVERT_SHIFT 7
  818. #define DA9150_REVERT_MASK BIT(7)
  819. /* DA9150_PAGE_CON_5 = 0x280 */
  820. #define DA9150_PAGE_SHIFT 0
  821. #define DA9150_PAGE_MASK (0x3f << 0)
  822. #define DA9150_WRITE_MODE_SHIFT 6
  823. #define DA9150_WRITE_MODE_MASK BIT(6)
  824. #define DA9150_REVERT_SHIFT 7
  825. #define DA9150_REVERT_MASK BIT(7)
  826. /* DA9150_PAGE_CON_6 = 0x300 */
  827. #define DA9150_PAGE_SHIFT 0
  828. #define DA9150_PAGE_MASK (0x3f << 0)
  829. #define DA9150_WRITE_MODE_SHIFT 6
  830. #define DA9150_WRITE_MODE_MASK BIT(6)
  831. #define DA9150_REVERT_SHIFT 7
  832. #define DA9150_REVERT_MASK BIT(7)
  833. /* DA9150_COREBTLD_STAT_A = 0x302 */
  834. #define DA9150_BOOTLD_STAT_SHIFT 0
  835. #define DA9150_BOOTLD_STAT_MASK (0x03 << 0)
  836. #define DA9150_CORE_LOCKUP_SHIFT 2
  837. #define DA9150_CORE_LOCKUP_MASK BIT(2)
  838. /* DA9150_COREBTLD_CTRL_A = 0x303 */
  839. #define DA9150_CORE_RESET_SHIFT 0
  840. #define DA9150_CORE_RESET_MASK BIT(0)
  841. #define DA9150_CORE_STOP_SHIFT 1
  842. #define DA9150_CORE_STOP_MASK BIT(1)
  843. /* DA9150_CORE_CONFIG_A = 0x304 */
  844. #define DA9150_CORE_MEMMUX_SHIFT 0
  845. #define DA9150_CORE_MEMMUX_MASK (0x03 << 0)
  846. #define DA9150_WDT_AUTO_START_SHIFT 2
  847. #define DA9150_WDT_AUTO_START_MASK BIT(2)
  848. #define DA9150_WDT_AUTO_LOCK_SHIFT 3
  849. #define DA9150_WDT_AUTO_LOCK_MASK BIT(3)
  850. #define DA9150_WDT_HLT_NO_CLK_SHIFT 4
  851. #define DA9150_WDT_HLT_NO_CLK_MASK BIT(4)
  852. /* DA9150_CORE_CONFIG_C = 0x305 */
  853. #define DA9150_CORE_SW_SIZE_SHIFT 0
  854. #define DA9150_CORE_SW_SIZE_MASK (0xff << 0)
  855. /* DA9150_CORE_CONFIG_B = 0x306 */
  856. #define DA9150_BOOTLD_EN_SHIFT 0
  857. #define DA9150_BOOTLD_EN_MASK BIT(0)
  858. #define DA9150_CORE_EN_SHIFT 2
  859. #define DA9150_CORE_EN_MASK BIT(2)
  860. #define DA9150_CORE_SW_SRC_SHIFT 3
  861. #define DA9150_CORE_SW_SRC_MASK (0x07 << 3)
  862. #define DA9150_DEEP_SLEEP_EN_SHIFT 7
  863. #define DA9150_DEEP_SLEEP_EN_MASK BIT(7)
  864. /* DA9150_CORE_CFG_DATA_A = 0x307 */
  865. #define DA9150_CORE_CFG_DT_A_SHIFT 0
  866. #define DA9150_CORE_CFG_DT_A_MASK (0xff << 0)
  867. /* DA9150_CORE_CFG_DATA_B = 0x308 */
  868. #define DA9150_CORE_CFG_DT_B_SHIFT 0
  869. #define DA9150_CORE_CFG_DT_B_MASK (0xff << 0)
  870. /* DA9150_CORE_CMD_A = 0x309 */
  871. #define DA9150_CORE_CMD_SHIFT 0
  872. #define DA9150_CORE_CMD_MASK (0xff << 0)
  873. /* DA9150_CORE_DATA_A = 0x30A */
  874. #define DA9150_CORE_DATA_0_SHIFT 0
  875. #define DA9150_CORE_DATA_0_MASK (0xff << 0)
  876. /* DA9150_CORE_DATA_B = 0x30B */
  877. #define DA9150_CORE_DATA_1_SHIFT 0
  878. #define DA9150_CORE_DATA_1_MASK (0xff << 0)
  879. /* DA9150_CORE_DATA_C = 0x30C */
  880. #define DA9150_CORE_DATA_2_SHIFT 0
  881. #define DA9150_CORE_DATA_2_MASK (0xff << 0)
  882. /* DA9150_CORE_DATA_D = 0x30D */
  883. #define DA9150_CORE_DATA_3_SHIFT 0
  884. #define DA9150_CORE_DATA_3_MASK (0xff << 0)
  885. /* DA9150_CORE2WIRE_STAT_A = 0x310 */
  886. #define DA9150_FW_FWDL_ERR_SHIFT 7
  887. #define DA9150_FW_FWDL_ERR_MASK BIT(7)
  888. /* DA9150_CORE2WIRE_CTRL_A = 0x311 */
  889. #define DA9150_FW_FWDL_EN_SHIFT 0
  890. #define DA9150_FW_FWDL_EN_MASK BIT(0)
  891. #define DA9150_FG_QIF_EN_SHIFT 1
  892. #define DA9150_FG_QIF_EN_MASK BIT(1)
  893. #define DA9150_CORE_BASE_ADDR_SHIFT 4
  894. #define DA9150_CORE_BASE_ADDR_MASK (0x0f << 4)
  895. /* DA9150_FW_CTRL_A = 0x312 */
  896. #define DA9150_FW_SEAL_SHIFT 0
  897. #define DA9150_FW_SEAL_MASK (0xff << 0)
  898. /* DA9150_FW_CTRL_C = 0x313 */
  899. #define DA9150_FW_FWDL_CRC_SHIFT 0
  900. #define DA9150_FW_FWDL_CRC_MASK (0xff << 0)
  901. /* DA9150_FW_CTRL_D = 0x314 */
  902. #define DA9150_FW_FWDL_BASE_SHIFT 0
  903. #define DA9150_FW_FWDL_BASE_MASK (0x0f << 0)
  904. /* DA9150_FG_CTRL_A = 0x315 */
  905. #define DA9150_FG_QIF_CODE_SHIFT 0
  906. #define DA9150_FG_QIF_CODE_MASK (0xff << 0)
  907. /* DA9150_FG_CTRL_B = 0x316 */
  908. #define DA9150_FG_QIF_VALUE_SHIFT 0
  909. #define DA9150_FG_QIF_VALUE_MASK (0xff << 0)
  910. /* DA9150_FW_CTRL_E = 0x317 */
  911. #define DA9150_FW_FWDL_SEG_SHIFT 0
  912. #define DA9150_FW_FWDL_SEG_MASK (0xff << 0)
  913. /* DA9150_FW_CTRL_B = 0x318 */
  914. #define DA9150_FW_FWDL_VALUE_SHIFT 0
  915. #define DA9150_FW_FWDL_VALUE_MASK (0xff << 0)
  916. /* DA9150_GPADC_CMAN = 0x320 */
  917. #define DA9150_GPADC_CEN_SHIFT 0
  918. #define DA9150_GPADC_CEN_MASK BIT(0)
  919. #define DA9150_GPADC_CMUX_SHIFT 1
  920. #define DA9150_GPADC_CMUX_MASK (0x1f << 1)
  921. /* DA9150_GPADC_CRES_A = 0x322 */
  922. #define DA9150_GPADC_CRES_H_SHIFT 0
  923. #define DA9150_GPADC_CRES_H_MASK (0xff << 0)
  924. /* DA9150_GPADC_CRES_B = 0x323 */
  925. #define DA9150_GPADC_CRUN_SHIFT 0
  926. #define DA9150_GPADC_CRUN_MASK BIT(0)
  927. #define DA9150_GPADC_CRES_L_SHIFT 6
  928. #define DA9150_GPADC_CRES_L_MASK (0x03 << 6)
  929. /* DA9150_CC_CFG_A = 0x328 */
  930. #define DA9150_CC_EN_SHIFT 0
  931. #define DA9150_CC_EN_MASK BIT(0)
  932. #define DA9150_CC_TIMEBASE_SHIFT 1
  933. #define DA9150_CC_TIMEBASE_MASK (0x03 << 1)
  934. #define DA9150_CC_CFG_SHIFT 5
  935. #define DA9150_CC_CFG_MASK (0x03 << 5)
  936. #define DA9150_CC_ENDLESS_MODE_SHIFT 7
  937. #define DA9150_CC_ENDLESS_MODE_MASK BIT(7)
  938. /* DA9150_CC_CFG_B = 0x329 */
  939. #define DA9150_CC_OPT_SHIFT 0
  940. #define DA9150_CC_OPT_MASK (0x03 << 0)
  941. #define DA9150_CC_PREAMP_SHIFT 2
  942. #define DA9150_CC_PREAMP_MASK (0x03 << 2)
  943. /* DA9150_CC_ICHG_RES_A = 0x32A */
  944. #define DA9150_CC_ICHG_RES_H_SHIFT 0
  945. #define DA9150_CC_ICHG_RES_H_MASK (0xff << 0)
  946. /* DA9150_CC_ICHG_RES_B = 0x32B */
  947. #define DA9150_CC_ICHG_RES_L_SHIFT 3
  948. #define DA9150_CC_ICHG_RES_L_MASK (0x1f << 3)
  949. /* DA9150_CC_IAVG_RES_A = 0x32C */
  950. #define DA9150_CC_IAVG_RES_H_SHIFT 0
  951. #define DA9150_CC_IAVG_RES_H_MASK (0xff << 0)
  952. /* DA9150_CC_IAVG_RES_B = 0x32D */
  953. #define DA9150_CC_IAVG_RES_L_SHIFT 0
  954. #define DA9150_CC_IAVG_RES_L_MASK (0xff << 0)
  955. /* DA9150_TAUX_CTRL_A = 0x330 */
  956. #define DA9150_TAUX_EN_SHIFT 0
  957. #define DA9150_TAUX_EN_MASK BIT(0)
  958. #define DA9150_TAUX_MOD_SHIFT 1
  959. #define DA9150_TAUX_MOD_MASK BIT(1)
  960. #define DA9150_TAUX_UPDATE_SHIFT 2
  961. #define DA9150_TAUX_UPDATE_MASK BIT(2)
  962. /* DA9150_TAUX_RELOAD_H = 0x332 */
  963. #define DA9150_TAUX_RLD_H_SHIFT 0
  964. #define DA9150_TAUX_RLD_H_MASK (0xff << 0)
  965. /* DA9150_TAUX_RELOAD_L = 0x333 */
  966. #define DA9150_TAUX_RLD_L_SHIFT 3
  967. #define DA9150_TAUX_RLD_L_MASK (0x1f << 3)
  968. /* DA9150_TAUX_VALUE_H = 0x334 */
  969. #define DA9150_TAUX_VAL_H_SHIFT 0
  970. #define DA9150_TAUX_VAL_H_MASK (0xff << 0)
  971. /* DA9150_TAUX_VALUE_L = 0x335 */
  972. #define DA9150_TAUX_VAL_L_SHIFT 3
  973. #define DA9150_TAUX_VAL_L_MASK (0x1f << 3)
  974. /* DA9150_AUX_DATA_0 = 0x338 */
  975. #define DA9150_AUX_DAT_0_SHIFT 0
  976. #define DA9150_AUX_DAT_0_MASK (0xff << 0)
  977. /* DA9150_AUX_DATA_1 = 0x339 */
  978. #define DA9150_AUX_DAT_1_SHIFT 0
  979. #define DA9150_AUX_DAT_1_MASK (0xff << 0)
  980. /* DA9150_AUX_DATA_2 = 0x33A */
  981. #define DA9150_AUX_DAT_2_SHIFT 0
  982. #define DA9150_AUX_DAT_2_MASK (0xff << 0)
  983. /* DA9150_AUX_DATA_3 = 0x33B */
  984. #define DA9150_AUX_DAT_3_SHIFT 0
  985. #define DA9150_AUX_DAT_3_MASK (0xff << 0)
  986. /* DA9150_BIF_CTRL = 0x340 */
  987. #define DA9150_BIF_ISRC_EN_SHIFT 0
  988. #define DA9150_BIF_ISRC_EN_MASK BIT(0)
  989. /* DA9150_TBAT_CTRL_A = 0x342 */
  990. #define DA9150_TBAT_EN_SHIFT 0
  991. #define DA9150_TBAT_EN_MASK BIT(0)
  992. #define DA9150_TBAT_SW1_SHIFT 1
  993. #define DA9150_TBAT_SW1_MASK BIT(1)
  994. #define DA9150_TBAT_SW2_SHIFT 2
  995. #define DA9150_TBAT_SW2_MASK BIT(2)
  996. /* DA9150_TBAT_CTRL_B = 0x343 */
  997. #define DA9150_TBAT_SW_FRC_SHIFT 0
  998. #define DA9150_TBAT_SW_FRC_MASK BIT(0)
  999. #define DA9150_TBAT_STAT_SW1_SHIFT 1
  1000. #define DA9150_TBAT_STAT_SW1_MASK BIT(1)
  1001. #define DA9150_TBAT_STAT_SW2_SHIFT 2
  1002. #define DA9150_TBAT_STAT_SW2_MASK BIT(2)
  1003. #define DA9150_TBAT_HIGH_CURR_SHIFT 3
  1004. #define DA9150_TBAT_HIGH_CURR_MASK BIT(3)
  1005. /* DA9150_TBAT_RES_A = 0x344 */
  1006. #define DA9150_TBAT_RES_H_SHIFT 0
  1007. #define DA9150_TBAT_RES_H_MASK (0xff << 0)
  1008. /* DA9150_TBAT_RES_B = 0x345 */
  1009. #define DA9150_TBAT_RES_DIS_SHIFT 0
  1010. #define DA9150_TBAT_RES_DIS_MASK BIT(0)
  1011. #define DA9150_TBAT_RES_L_SHIFT 6
  1012. #define DA9150_TBAT_RES_L_MASK (0x03 << 6)
  1013. #endif /* __DA9150_REGISTERS_H */