registers.h 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073
  1. /*
  2. * Registers definition for DA9063 modules
  3. *
  4. * Copyright 2012 Dialog Semiconductor Ltd.
  5. *
  6. * Author: Michal Hajduk <michal.hajduk@diasemi.com>
  7. * Krystian Garbaciak <krystian.garbaciak@diasemi.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. *
  14. */
  15. #ifndef _DA9063_REG_H
  16. #define _DA9063_REG_H
  17. #define DA9063_I2C_PAGE_SEL_SHIFT 1
  18. #define DA9063_EVENT_REG_NUM 4
  19. /* Page selection I2C or SPI always in the begining of any page. */
  20. /* Page 0 : I2C access 0x000 - 0x0FF SPI access 0x000 - 0x07F */
  21. /* Page 1 : SPI access 0x080 - 0x0FF */
  22. /* Page 2 : I2C access 0x100 - 0x1FF SPI access 0x100 - 0x17F */
  23. /* Page 3 : SPI access 0x180 - 0x1FF */
  24. #define DA9063_REG_PAGE_CON 0x00
  25. /* System Control and Event Registers */
  26. #define DA9063_REG_STATUS_A 0x01
  27. #define DA9063_REG_STATUS_B 0x02
  28. #define DA9063_REG_STATUS_C 0x03
  29. #define DA9063_REG_STATUS_D 0x04
  30. #define DA9063_REG_FAULT_LOG 0x05
  31. #define DA9063_REG_EVENT_A 0x06
  32. #define DA9063_REG_EVENT_B 0x07
  33. #define DA9063_REG_EVENT_C 0x08
  34. #define DA9063_REG_EVENT_D 0x09
  35. #define DA9063_REG_IRQ_MASK_A 0x0A
  36. #define DA9063_REG_IRQ_MASK_B 0x0B
  37. #define DA9063_REG_IRQ_MASK_C 0x0C
  38. #define DA9063_REG_IRQ_MASK_D 0x0D
  39. #define DA9063_REG_CONTROL_A 0x0E
  40. #define DA9063_REG_CONTROL_B 0x0F
  41. #define DA9063_REG_CONTROL_C 0x10
  42. #define DA9063_REG_CONTROL_D 0x11
  43. #define DA9063_REG_CONTROL_E 0x12
  44. #define DA9063_REG_CONTROL_F 0x13
  45. #define DA9063_REG_PD_DIS 0x14
  46. /* GPIO Control Registers */
  47. #define DA9063_REG_GPIO_0_1 0x15
  48. #define DA9063_REG_GPIO_2_3 0x16
  49. #define DA9063_REG_GPIO_4_5 0x17
  50. #define DA9063_REG_GPIO_6_7 0x18
  51. #define DA9063_REG_GPIO_8_9 0x19
  52. #define DA9063_REG_GPIO_10_11 0x1A
  53. #define DA9063_REG_GPIO_12_13 0x1B
  54. #define DA9063_REG_GPIO_14_15 0x1C
  55. #define DA9063_REG_GPIO_MODE0_7 0x1D
  56. #define DA9063_REG_GPIO_MODE8_15 0x1E
  57. #define DA9063_REG_SWITCH_CONT 0x1F
  58. /* Regulator Control Registers */
  59. #define DA9063_REG_BCORE2_CONT 0x20
  60. #define DA9063_REG_BCORE1_CONT 0x21
  61. #define DA9063_REG_BPRO_CONT 0x22
  62. #define DA9063_REG_BMEM_CONT 0x23
  63. #define DA9063_REG_BIO_CONT 0x24
  64. #define DA9063_REG_BPERI_CONT 0x25
  65. #define DA9063_REG_LDO1_CONT 0x26
  66. #define DA9063_REG_LDO2_CONT 0x27
  67. #define DA9063_REG_LDO3_CONT 0x28
  68. #define DA9063_REG_LDO4_CONT 0x29
  69. #define DA9063_REG_LDO5_CONT 0x2A
  70. #define DA9063_REG_LDO6_CONT 0x2B
  71. #define DA9063_REG_LDO7_CONT 0x2C
  72. #define DA9063_REG_LDO8_CONT 0x2D
  73. #define DA9063_REG_LDO9_CONT 0x2E
  74. #define DA9063_REG_LDO10_CONT 0x2F
  75. #define DA9063_REG_LDO11_CONT 0x30
  76. #define DA9063_REG_SUPPLIES 0x31
  77. #define DA9063_REG_DVC_1 0x32
  78. #define DA9063_REG_DVC_2 0x33
  79. /* GP-ADC Control Registers */
  80. #define DA9063_REG_ADC_MAN 0x34
  81. #define DA9063_REG_ADC_CONT 0x35
  82. #define DA9063_REG_VSYS_MON 0x36
  83. #define DA9063_REG_ADC_RES_L 0x37
  84. #define DA9063_REG_ADC_RES_H 0x38
  85. #define DA9063_REG_VSYS_RES 0x39
  86. #define DA9063_REG_ADCIN1_RES 0x3A
  87. #define DA9063_REG_ADCIN2_RES 0x3B
  88. #define DA9063_REG_ADCIN3_RES 0x3C
  89. #define DA9063_REG_MON_A8_RES 0x3D
  90. #define DA9063_REG_MON_A9_RES 0x3E
  91. #define DA9063_REG_MON_A10_RES 0x3F
  92. /* RTC Calendar and Alarm Registers */
  93. #define DA9063_REG_COUNT_S 0x40
  94. #define DA9063_REG_COUNT_MI 0x41
  95. #define DA9063_REG_COUNT_H 0x42
  96. #define DA9063_REG_COUNT_D 0x43
  97. #define DA9063_REG_COUNT_MO 0x44
  98. #define DA9063_REG_COUNT_Y 0x45
  99. #define DA9063_AD_REG_ALARM_MI 0x46
  100. #define DA9063_AD_REG_ALARM_H 0x47
  101. #define DA9063_AD_REG_ALARM_D 0x48
  102. #define DA9063_AD_REG_ALARM_MO 0x49
  103. #define DA9063_AD_REG_ALARM_Y 0x4A
  104. #define DA9063_AD_REG_SECOND_A 0x4B
  105. #define DA9063_AD_REG_SECOND_B 0x4C
  106. #define DA9063_AD_REG_SECOND_C 0x4D
  107. #define DA9063_AD_REG_SECOND_D 0x4E
  108. #define DA9063_BB_REG_ALARM_S 0x46
  109. #define DA9063_BB_REG_ALARM_MI 0x47
  110. #define DA9063_BB_REG_ALARM_H 0x48
  111. #define DA9063_BB_REG_ALARM_D 0x49
  112. #define DA9063_BB_REG_ALARM_MO 0x4A
  113. #define DA9063_BB_REG_ALARM_Y 0x4B
  114. #define DA9063_BB_REG_SECOND_A 0x4C
  115. #define DA9063_BB_REG_SECOND_B 0x4D
  116. #define DA9063_BB_REG_SECOND_C 0x4E
  117. #define DA9063_BB_REG_SECOND_D 0x4F
  118. /* Sequencer Control Registers */
  119. #define DA9063_REG_SEQ 0x81
  120. #define DA9063_REG_SEQ_TIMER 0x82
  121. #define DA9063_REG_ID_2_1 0x83
  122. #define DA9063_REG_ID_4_3 0x84
  123. #define DA9063_REG_ID_6_5 0x85
  124. #define DA9063_REG_ID_8_7 0x86
  125. #define DA9063_REG_ID_10_9 0x87
  126. #define DA9063_REG_ID_12_11 0x88
  127. #define DA9063_REG_ID_14_13 0x89
  128. #define DA9063_REG_ID_16_15 0x8A
  129. #define DA9063_REG_ID_18_17 0x8B
  130. #define DA9063_REG_ID_20_19 0x8C
  131. #define DA9063_REG_ID_22_21 0x8D
  132. #define DA9063_REG_ID_24_23 0x8E
  133. #define DA9063_REG_ID_26_25 0x8F
  134. #define DA9063_REG_ID_28_27 0x90
  135. #define DA9063_REG_ID_30_29 0x91
  136. #define DA9063_REG_ID_32_31 0x92
  137. #define DA9063_REG_SEQ_A 0x95
  138. #define DA9063_REG_SEQ_B 0x96
  139. #define DA9063_REG_WAIT 0x97
  140. #define DA9063_REG_EN_32K 0x98
  141. #define DA9063_REG_RESET 0x99
  142. /* Regulator Setting Registers */
  143. #define DA9063_REG_BUCK_ILIM_A 0x9A
  144. #define DA9063_REG_BUCK_ILIM_B 0x9B
  145. #define DA9063_REG_BUCK_ILIM_C 0x9C
  146. #define DA9063_REG_BCORE2_CFG 0x9D
  147. #define DA9063_REG_BCORE1_CFG 0x9E
  148. #define DA9063_REG_BPRO_CFG 0x9F
  149. #define DA9063_REG_BIO_CFG 0xA0
  150. #define DA9063_REG_BMEM_CFG 0xA1
  151. #define DA9063_REG_BPERI_CFG 0xA2
  152. #define DA9063_REG_VBCORE2_A 0xA3
  153. #define DA9063_REG_VBCORE1_A 0xA4
  154. #define DA9063_REG_VBPRO_A 0xA5
  155. #define DA9063_REG_VBMEM_A 0xA6
  156. #define DA9063_REG_VBIO_A 0xA7
  157. #define DA9063_REG_VBPERI_A 0xA8
  158. #define DA9063_REG_VLDO1_A 0xA9
  159. #define DA9063_REG_VLDO2_A 0xAA
  160. #define DA9063_REG_VLDO3_A 0xAB
  161. #define DA9063_REG_VLDO4_A 0xAC
  162. #define DA9063_REG_VLDO5_A 0xAD
  163. #define DA9063_REG_VLDO6_A 0xAE
  164. #define DA9063_REG_VLDO7_A 0xAF
  165. #define DA9063_REG_VLDO8_A 0xB0
  166. #define DA9063_REG_VLDO9_A 0xB1
  167. #define DA9063_REG_VLDO10_A 0xB2
  168. #define DA9063_REG_VLDO11_A 0xB3
  169. #define DA9063_REG_VBCORE2_B 0xB4
  170. #define DA9063_REG_VBCORE1_B 0xB5
  171. #define DA9063_REG_VBPRO_B 0xB6
  172. #define DA9063_REG_VBMEM_B 0xB7
  173. #define DA9063_REG_VBIO_B 0xB8
  174. #define DA9063_REG_VBPERI_B 0xB9
  175. #define DA9063_REG_VLDO1_B 0xBA
  176. #define DA9063_REG_VLDO2_B 0xBB
  177. #define DA9063_REG_VLDO3_B 0xBC
  178. #define DA9063_REG_VLDO4_B 0xBD
  179. #define DA9063_REG_VLDO5_B 0xBE
  180. #define DA9063_REG_VLDO6_B 0xBF
  181. #define DA9063_REG_VLDO7_B 0xC0
  182. #define DA9063_REG_VLDO8_B 0xC1
  183. #define DA9063_REG_VLDO9_B 0xC2
  184. #define DA9063_REG_VLDO10_B 0xC3
  185. #define DA9063_REG_VLDO11_B 0xC4
  186. /* Backup Battery Charger Control Register */
  187. #define DA9063_REG_BBAT_CONT 0xC5
  188. /* GPIO PWM (LED) */
  189. #define DA9063_REG_GPO11_LED 0xC6
  190. #define DA9063_REG_GPO14_LED 0xC7
  191. #define DA9063_REG_GPO15_LED 0xC8
  192. /* GP-ADC Threshold Registers */
  193. #define DA9063_REG_ADC_CFG 0xC9
  194. #define DA9063_REG_AUTO1_HIGH 0xCA
  195. #define DA9063_REG_AUTO1_LOW 0xCB
  196. #define DA9063_REG_AUTO2_HIGH 0xCC
  197. #define DA9063_REG_AUTO2_LOW 0xCD
  198. #define DA9063_REG_AUTO3_HIGH 0xCE
  199. #define DA9063_REG_AUTO3_LOW 0xCF
  200. /* DA9063 Configuration registers */
  201. /* OTP */
  202. #define DA9063_REG_OPT_COUNT 0x101
  203. #define DA9063_REG_OPT_ADDR 0x102
  204. #define DA9063_REG_OPT_DATA 0x103
  205. /* Customer Trim and Configuration */
  206. #define DA9063_REG_T_OFFSET 0x104
  207. #define DA9063_REG_INTERFACE 0x105
  208. #define DA9063_REG_CONFIG_A 0x106
  209. #define DA9063_REG_CONFIG_B 0x107
  210. #define DA9063_REG_CONFIG_C 0x108
  211. #define DA9063_REG_CONFIG_D 0x109
  212. #define DA9063_REG_CONFIG_E 0x10A
  213. #define DA9063_REG_CONFIG_F 0x10B
  214. #define DA9063_REG_CONFIG_G 0x10C
  215. #define DA9063_REG_CONFIG_H 0x10D
  216. #define DA9063_REG_CONFIG_I 0x10E
  217. #define DA9063_REG_CONFIG_J 0x10F
  218. #define DA9063_REG_CONFIG_K 0x110
  219. #define DA9063_REG_CONFIG_L 0x111
  220. #define DA9063_AD_REG_MON_REG_1 0x112
  221. #define DA9063_AD_REG_MON_REG_2 0x113
  222. #define DA9063_AD_REG_MON_REG_3 0x114
  223. #define DA9063_AD_REG_MON_REG_4 0x115
  224. #define DA9063_AD_REG_MON_REG_5 0x116
  225. #define DA9063_AD_REG_MON_REG_6 0x117
  226. #define DA9063_AD_REG_TRIM_CLDR 0x118
  227. #define DA9063_AD_REG_GP_ID_0 0x119
  228. #define DA9063_AD_REG_GP_ID_1 0x11A
  229. #define DA9063_AD_REG_GP_ID_2 0x11B
  230. #define DA9063_AD_REG_GP_ID_3 0x11C
  231. #define DA9063_AD_REG_GP_ID_4 0x11D
  232. #define DA9063_AD_REG_GP_ID_5 0x11E
  233. #define DA9063_AD_REG_GP_ID_6 0x11F
  234. #define DA9063_AD_REG_GP_ID_7 0x120
  235. #define DA9063_AD_REG_GP_ID_8 0x121
  236. #define DA9063_AD_REG_GP_ID_9 0x122
  237. #define DA9063_AD_REG_GP_ID_10 0x123
  238. #define DA9063_AD_REG_GP_ID_11 0x124
  239. #define DA9063_AD_REG_GP_ID_12 0x125
  240. #define DA9063_AD_REG_GP_ID_13 0x126
  241. #define DA9063_AD_REG_GP_ID_14 0x127
  242. #define DA9063_AD_REG_GP_ID_15 0x128
  243. #define DA9063_AD_REG_GP_ID_16 0x129
  244. #define DA9063_AD_REG_GP_ID_17 0x12A
  245. #define DA9063_AD_REG_GP_ID_18 0x12B
  246. #define DA9063_AD_REG_GP_ID_19 0x12C
  247. #define DA9063_BB_REG_CONFIG_M 0x112
  248. #define DA9063_BB_REG_CONFIG_N 0x113
  249. #define DA9063_BB_REG_MON_REG_1 0x114
  250. #define DA9063_BB_REG_MON_REG_2 0x115
  251. #define DA9063_BB_REG_MON_REG_3 0x116
  252. #define DA9063_BB_REG_MON_REG_4 0x117
  253. #define DA9063_BB_REG_MON_REG_5 0x11E
  254. #define DA9063_BB_REG_MON_REG_6 0x11F
  255. #define DA9063_BB_REG_TRIM_CLDR 0x120
  256. /* General Purpose Registers */
  257. #define DA9063_BB_REG_GP_ID_0 0x121
  258. #define DA9063_BB_REG_GP_ID_1 0x122
  259. #define DA9063_BB_REG_GP_ID_2 0x123
  260. #define DA9063_BB_REG_GP_ID_3 0x124
  261. #define DA9063_BB_REG_GP_ID_4 0x125
  262. #define DA9063_BB_REG_GP_ID_5 0x126
  263. #define DA9063_BB_REG_GP_ID_6 0x127
  264. #define DA9063_BB_REG_GP_ID_7 0x128
  265. #define DA9063_BB_REG_GP_ID_8 0x129
  266. #define DA9063_BB_REG_GP_ID_9 0x12A
  267. #define DA9063_BB_REG_GP_ID_10 0x12B
  268. #define DA9063_BB_REG_GP_ID_11 0x12C
  269. #define DA9063_BB_REG_GP_ID_12 0x12D
  270. #define DA9063_BB_REG_GP_ID_13 0x12E
  271. #define DA9063_BB_REG_GP_ID_14 0x12F
  272. #define DA9063_BB_REG_GP_ID_15 0x130
  273. #define DA9063_BB_REG_GP_ID_16 0x131
  274. #define DA9063_BB_REG_GP_ID_17 0x132
  275. #define DA9063_BB_REG_GP_ID_18 0x133
  276. #define DA9063_BB_REG_GP_ID_19 0x134
  277. /* Chip ID and variant */
  278. #define DA9063_REG_CHIP_ID 0x181
  279. #define DA9063_REG_CHIP_VARIANT 0x182
  280. /*
  281. * PMIC registers bits
  282. */
  283. /* DA9063_REG_PAGE_CON (addr=0x00) */
  284. #define DA9063_PEG_PAGE_SHIFT 0
  285. #define DA9063_REG_PAGE_MASK 0x07
  286. #define DA9063_REG_PAGE0 0x00
  287. #define DA9063_REG_PAGE2 0x02
  288. #define DA9063_PAGE_WRITE_MODE 0x00
  289. #define DA9063_REPEAT_WRITE_MODE 0x40
  290. #define DA9063_PAGE_REVERT 0x80
  291. /* DA9063_REG_STATUS_A (addr=0x01) */
  292. #define DA9063_NONKEY 0x01
  293. #define DA9063_WAKE 0x02
  294. #define DA9063_DVC_BUSY 0x04
  295. #define DA9063_COMP_1V2 0x08
  296. /* DA9063_REG_STATUS_B (addr=0x02) */
  297. #define DA9063_GPI0 0x01
  298. #define DA9063_GPI1 0x02
  299. #define DA9063_GPI2 0x04
  300. #define DA9063_GPI3 0x08
  301. #define DA9063_GPI4 0x10
  302. #define DA9063_GPI5 0x20
  303. #define DA9063_GPI6 0x40
  304. #define DA9063_GPI7 0x80
  305. /* DA9063_REG_STATUS_C (addr=0x03) */
  306. #define DA9063_GPI8 0x01
  307. #define DA9063_GPI9 0x02
  308. #define DA9063_GPI10 0x04
  309. #define DA9063_GPI11 0x08
  310. #define DA9063_GPI12 0x10
  311. #define DA9063_GPI13 0x20
  312. #define DA9063_GPI14 0x40
  313. #define DA9063_GPI15 0x80
  314. /* DA9063_REG_STATUS_D (addr=0x04) */
  315. #define DA9063_LDO3_LIM 0x08
  316. #define DA9063_LDO4_LIM 0x10
  317. #define DA9063_LDO7_LIM 0x20
  318. #define DA9063_LDO8_LIM 0x40
  319. #define DA9063_LDO11_LIM 0x80
  320. /* DA9063_REG_FAULT_LOG (addr=0x05) */
  321. #define DA9063_TWD_ERROR 0x01
  322. #define DA9063_POR 0x02
  323. #define DA9063_VDD_FAULT 0x04
  324. #define DA9063_VDD_START 0x08
  325. #define DA9063_TEMP_CRIT 0x10
  326. #define DA9063_KEY_RESET 0x20
  327. #define DA9063_NSHUTDOWN 0x40
  328. #define DA9063_WAIT_SHUT 0x80
  329. /* DA9063_REG_EVENT_A (addr=0x06) */
  330. #define DA9063_E_NONKEY 0x01
  331. #define DA9063_E_ALARM 0x02
  332. #define DA9063_E_TICK 0x04
  333. #define DA9063_E_ADC_RDY 0x08
  334. #define DA9063_E_SEQ_RDY 0x10
  335. #define DA9063_EVENTS_B 0x20
  336. #define DA9063_EVENTS_C 0x40
  337. #define DA9063_EVENTS_D 0x80
  338. /* DA9063_REG_EVENT_B (addr=0x07) */
  339. #define DA9063_E_WAKE 0x01
  340. #define DA9063_E_TEMP 0x02
  341. #define DA9063_E_COMP_1V2 0x04
  342. #define DA9063_E_LDO_LIM 0x08
  343. #define DA9063_E_REG_UVOV 0x10
  344. #define DA9063_E_DVC_RDY 0x20
  345. #define DA9063_E_VDD_MON 0x40
  346. #define DA9063_E_VDD_WARN 0x80
  347. /* DA9063_REG_EVENT_C (addr=0x08) */
  348. #define DA9063_E_GPI0 0x01
  349. #define DA9063_E_GPI1 0x02
  350. #define DA9063_E_GPI2 0x04
  351. #define DA9063_E_GPI3 0x08
  352. #define DA9063_E_GPI4 0x10
  353. #define DA9063_E_GPI5 0x20
  354. #define DA9063_E_GPI6 0x40
  355. #define DA9063_E_GPI7 0x80
  356. /* DA9063_REG_EVENT_D (addr=0x09) */
  357. #define DA9063_E_GPI8 0x01
  358. #define DA9063_E_GPI9 0x02
  359. #define DA9063_E_GPI10 0x04
  360. #define DA9063_E_GPI11 0x08
  361. #define DA9063_E_GPI12 0x10
  362. #define DA9063_E_GPI13 0x20
  363. #define DA9063_E_GPI14 0x40
  364. #define DA9063_E_GPI15 0x80
  365. /* DA9063_REG_IRQ_MASK_A (addr=0x0A) */
  366. #define DA9063_M_ONKEY 0x01
  367. #define DA9063_M_ALARM 0x02
  368. #define DA9063_M_TICK 0x04
  369. #define DA9063_M_ADC_RDY 0x08
  370. #define DA9063_M_SEQ_RDY 0x10
  371. /* DA9063_REG_IRQ_MASK_B (addr=0x0B) */
  372. #define DA9063_M_WAKE 0x01
  373. #define DA9063_M_TEMP 0x02
  374. #define DA9063_M_COMP_1V2 0x04
  375. #define DA9063_M_LDO_LIM 0x08
  376. #define DA9063_M_UVOV 0x10
  377. #define DA9063_M_DVC_RDY 0x20
  378. #define DA9063_M_VDD_MON 0x40
  379. #define DA9063_M_VDD_WARN 0x80
  380. /* DA9063_REG_IRQ_MASK_C (addr=0x0C) */
  381. #define DA9063_M_GPI0 0x01
  382. #define DA9063_M_GPI1 0x02
  383. #define DA9063_M_GPI2 0x04
  384. #define DA9063_M_GPI3 0x08
  385. #define DA9063_M_GPI4 0x10
  386. #define DA9063_M_GPI5 0x20
  387. #define DA9063_M_GPI6 0x40
  388. #define DA9063_M_GPI7 0x80
  389. /* DA9063_REG_IRQ_MASK_D (addr=0x0D) */
  390. #define DA9063_M_GPI8 0x01
  391. #define DA9063_M_GPI9 0x02
  392. #define DA9063_M_GPI10 0x04
  393. #define DA9063_M_GPI11 0x08
  394. #define DA9063_M_GPI12 0x10
  395. #define DA9063_M_GPI13 0x20
  396. #define DA9063_M_GPI14 0x40
  397. #define DA9063_M_GPI15 0x80
  398. /* DA9063_REG_CONTROL_A (addr=0x0E) */
  399. #define DA9063_SYSTEM_EN 0x01
  400. #define DA9063_POWER_EN 0x02
  401. #define DA9063_POWER1_EN 0x04
  402. #define DA9063_STANDBY 0x08
  403. #define DA9063_M_SYSTEM_EN 0x10
  404. #define DA9063_M_POWER_EN 0x20
  405. #define DA9063_M_POWER1_EN 0x40
  406. #define DA9063_CP_EN 0x80
  407. /* DA9063_REG_CONTROL_B (addr=0x0F) */
  408. #define DA9063_CHG_SEL 0x01
  409. #define DA9063_WATCHDOG_PD 0x02
  410. #define DA9063_BB_RESET_BLINKING 0x04
  411. #define DA9063_NRES_MODE 0x08
  412. #define DA9063_NONKEY_LOCK 0x10
  413. #define DA9063_BB_BUCK_SLOWSTART 0x80
  414. /* DA9063_REG_CONTROL_C (addr=0x10) */
  415. #define DA9063_DEBOUNCING_MASK 0x07
  416. #define DA9063_DEBOUNCING_OFF 0x0
  417. #define DA9063_DEBOUNCING_0MS1 0x1
  418. #define DA9063_DEBOUNCING_1MS 0x2
  419. #define DA9063_DEBOUNCING_10MS24 0x3
  420. #define DA9063_DEBOUNCING_51MS2 0x4
  421. #define DA9063_DEBOUNCING_256MS 0x5
  422. #define DA9063_DEBOUNCING_512MS 0x6
  423. #define DA9063_DEBOUNCING_1024MS 0x7
  424. #define DA9063_AUTO_BOOT 0x08
  425. #define DA9063_OTPREAD_EN 0x10
  426. #define DA9063_SLEW_RATE_MASK 0x60
  427. #define DA9063_SLEW_RATE_4US 0x00
  428. #define DA9063_SLEW_RATE_3US 0x20
  429. #define DA9063_SLEW_RATE_1US 0x40
  430. #define DA9063_SLEW_RATE_0US5 0x60
  431. #define DA9063_DEF_SUPPLY 0x80
  432. /* DA9063_REG_CONTROL_D (addr=0x11) */
  433. #define DA9063_TWDSCALE_MASK 0x07
  434. #define DA9063_BLINK_FRQ_MASK 0x38
  435. #define DA9063_BLINK_FRQ_OFF 0x00
  436. #define DA9063_BLINK_FRQ_1S0 0x08
  437. #define DA9063_BLINK_FRQ_2S0 0x10
  438. #define DA9063_BLINK_FRQ_4S0 0x18
  439. #define DA9063_BLINK_FRQ_0S18 0x20
  440. #define DA9063_BLINK_FRQ_2S0_VDD 0x28
  441. #define DA9063_BLINK_FRQ_4S0_VDD 0x30
  442. #define DA9063_BLINK_FRQ_0S18_VDD 0x38
  443. #define DA9063_BLINK_DUR_MASK 0xC0
  444. #define DA9063_BLINK_DUR_10MS 0x00
  445. #define DA9063_BLINK_DUR_20MS 0x40
  446. #define DA9063_BLINK_DUR_40MS 0x80
  447. #define DA9063_BLINK_DUR_20MSDBL 0xC0
  448. /* DA9063_REG_CONTROL_E (addr=0x12) */
  449. #define DA9063_RTC_MODE_PD 0x01
  450. #define DA9063_RTC_MODE_SD 0x02
  451. #define DA9063_RTC_EN 0x04
  452. #define DA9063_ECO_MODE 0x08
  453. #define DA9063_PM_FB1_PIN 0x10
  454. #define DA9063_PM_FB2_PIN 0x20
  455. #define DA9063_PM_FB3_PIN 0x40
  456. #define DA9063_V_LOCK 0x80
  457. /* DA9063_REG_CONTROL_F (addr=0x13) */
  458. #define DA9063_WATCHDOG 0x01
  459. #define DA9063_SHUTDOWN 0x02
  460. #define DA9063_WAKE_UP 0x04
  461. /* DA9063_REG_PD_DIS (addr=0x14) */
  462. #define DA9063_GPI_DIS 0x01
  463. #define DA9063_GPADC_PAUSE 0x02
  464. #define DA9063_PMIF_DIS 0x04
  465. #define DA9063_HS2WIRE_DIS 0x08
  466. #define DA9063_BB_CLDR_PAUSE 0x10
  467. #define DA9063_BBAT_DIS 0x20
  468. #define DA9063_OUT_32K_PAUSE 0x40
  469. #define DA9063_PMCONT_DIS 0x80
  470. /* DA9063_REG_GPIO_0_1 (addr=0x15) */
  471. #define DA9063_GPIO0_PIN_MASK 0x03
  472. #define DA9063_GPIO0_PIN_ADCIN1 0x00
  473. #define DA9063_GPIO0_PIN_GPI 0x01
  474. #define DA9063_GPIO0_PIN_GPO_OD 0x02
  475. #define DA9063_GPIO0_PIN_GPO 0x03
  476. #define DA9063_GPIO0_TYPE 0x04
  477. #define DA9063_GPIO0_TYPE_GPI_ACT_LOW 0x00
  478. #define DA9063_GPIO0_TYPE_GPO_VDD_IO1 0x00
  479. #define DA9063_GPIO0_TYPE_GPI_ACT_HIGH 0x04
  480. #define DA9063_GPIO0_TYPE_GPO_VDD_IO2 0x04
  481. #define DA9063_GPIO0_NO_WAKEUP 0x08
  482. #define DA9063_GPIO1_PIN_MASK 0x30
  483. #define DA9063_GPIO1_PIN_ADCIN2_COMP 0x00
  484. #define DA9063_GPIO1_PIN_GPI 0x10
  485. #define DA9063_GPIO1_PIN_GPO_OD 0x20
  486. #define DA9063_GPIO1_PIN_GPO 0x30
  487. #define DA9063_GPIO1_TYPE 0x40
  488. #define DA9063_GPIO1_TYPE_GPI_ACT_LOW 0x00
  489. #define DA9063_GPIO1_TYPE_GPO_VDD_IO1 0x00
  490. #define DA9063_GPIO1_TYPE_GPI_ACT_HIGH 0x04
  491. #define DA9063_GPIO1_TYPE_GPO_VDD_IO2 0x04
  492. #define DA9063_GPIO1_NO_WAKEUP 0x80
  493. /* DA9063_REG_GPIO_2_3 (addr=0x16) */
  494. #define DA9063_GPIO2_PIN_MASK 0x03
  495. #define DA9063_GPIO2_PIN_ADCIN3 0x00
  496. #define DA9063_GPIO2_PIN_GPI 0x01
  497. #define DA9063_GPIO2_PIN_GPO_PSS 0x02
  498. #define DA9063_GPIO2_PIN_GPO 0x03
  499. #define DA9063_GPIO2_TYPE 0x04
  500. #define DA9063_GPIO2_TYPE_GPI_ACT_LOW 0x00
  501. #define DA9063_GPIO2_TYPE_GPO_VDD_IO1 0x00
  502. #define DA9063_GPIO2_TYPE_GPI_ACT_HIGH 0x04
  503. #define DA9063_GPIO2_TYPE_GPO_VDD_IO2 0x04
  504. #define DA9063_GPIO2_NO_WAKEUP 0x08
  505. #define DA9063_GPIO3_PIN_MASK 0x30
  506. #define DA9063_GPIO3_PIN_CORE_SW_G 0x00
  507. #define DA9063_GPIO3_PIN_GPI 0x10
  508. #define DA9063_GPIO3_PIN_GPO_OD 0x20
  509. #define DA9063_GPIO3_PIN_GPO 0x30
  510. #define DA9063_GPIO3_TYPE 0x40
  511. #define DA9063_GPIO3_TYPE_GPI_ACT_LOW 0x00
  512. #define DA9063_GPIO3_TYPE_GPO_VDD_IO1 0x00
  513. #define DA9063_GPIO3_TYPE_GPI_ACT_HIGH 0x04
  514. #define DA9063_GPIO3_TYPE_GPO_VDD_IO2 0x04
  515. #define DA9063_GPIO3_NO_WAKEUP 0x80
  516. /* DA9063_REG_GPIO_4_5 (addr=0x17) */
  517. #define DA9063_GPIO4_PIN_MASK 0x03
  518. #define DA9063_GPIO4_PIN_CORE_SW_S 0x00
  519. #define DA9063_GPIO4_PIN_GPI 0x01
  520. #define DA9063_GPIO4_PIN_GPO_OD 0x02
  521. #define DA9063_GPIO4_PIN_GPO 0x03
  522. #define DA9063_GPIO4_TYPE 0x04
  523. #define DA9063_GPIO4_TYPE_GPI_ACT_LOW 0x00
  524. #define DA9063_GPIO4_TYPE_GPO_VDD_IO1 0x00
  525. #define DA9063_GPIO4_TYPE_GPI_ACT_HIGH 0x04
  526. #define DA9063_GPIO4_TYPE_GPO_VDD_IO2 0x04
  527. #define DA9063_GPIO4_NO_WAKEUP 0x08
  528. #define DA9063_GPIO5_PIN_MASK 0x30
  529. #define DA9063_GPIO5_PIN_PERI_SW_G 0x00
  530. #define DA9063_GPIO5_PIN_GPI 0x10
  531. #define DA9063_GPIO5_PIN_GPO_OD 0x20
  532. #define DA9063_GPIO5_PIN_GPO 0x30
  533. #define DA9063_GPIO5_TYPE 0x40
  534. #define DA9063_GPIO5_TYPE_GPI_ACT_LOW 0x00
  535. #define DA9063_GPIO5_TYPE_GPO_VDD_IO1 0x00
  536. #define DA9063_GPIO5_TYPE_GPI_ACT_HIGH 0x04
  537. #define DA9063_GPIO5_TYPE_GPO_VDD_IO2 0x04
  538. #define DA9063_GPIO5_NO_WAKEUP 0x80
  539. /* DA9063_REG_GPIO_6_7 (addr=0x18) */
  540. #define DA9063_GPIO6_PIN_MASK 0x03
  541. #define DA9063_GPIO6_PIN_PERI_SW_S 0x00
  542. #define DA9063_GPIO6_PIN_GPI 0x01
  543. #define DA9063_GPIO6_PIN_GPO_OD 0x02
  544. #define DA9063_GPIO6_PIN_GPO 0x03
  545. #define DA9063_GPIO6_TYPE 0x04
  546. #define DA9063_GPIO6_TYPE_GPI_ACT_LOW 0x00
  547. #define DA9063_GPIO6_TYPE_GPO_VDD_IO1 0x00
  548. #define DA9063_GPIO6_TYPE_GPI_ACT_HIGH 0x04
  549. #define DA9063_GPIO6_TYPE_GPO_VDD_IO2 0x04
  550. #define DA9063_GPIO6_NO_WAKEUP 0x08
  551. #define DA9063_GPIO7_PIN_MASK 0x30
  552. #define DA9063_GPIO7_PIN_GPI 0x10
  553. #define DA9063_GPIO7_PIN_GPO_PSS 0x20
  554. #define DA9063_GPIO7_PIN_GPO 0x30
  555. #define DA9063_GPIO7_TYPE 0x40
  556. #define DA9063_GPIO7_TYPE_GPI_ACT_LOW 0x00
  557. #define DA9063_GPIO7_TYPE_GPO_VDD_IO1 0x00
  558. #define DA9063_GPIO7_TYPE_GPI_ACT_HIGH 0x04
  559. #define DA9063_GPIO7_TYPE_GPO_VDD_IO2 0x04
  560. #define DA9063_GPIO7_NO_WAKEUP 0x80
  561. /* DA9063_REG_GPIO_8_9 (addr=0x19) */
  562. #define DA9063_GPIO8_PIN_MASK 0x03
  563. #define DA9063_GPIO8_PIN_GPI_SYS_EN 0x00
  564. #define DA9063_GPIO8_PIN_GPI 0x01
  565. #define DA9063_GPIO8_PIN_GPO_PSS 0x02
  566. #define DA9063_GPIO8_PIN_GPO 0x03
  567. #define DA9063_GPIO8_TYPE 0x04
  568. #define DA9063_GPIO8_TYPE_GPI_ACT_LOW 0x00
  569. #define DA9063_GPIO8_TYPE_GPO_VDD_IO1 0x00
  570. #define DA9063_GPIO8_TYPE_GPI_ACT_HIGH 0x04
  571. #define DA9063_GPIO8_TYPE_GPO_VDD_IO2 0x04
  572. #define DA9063_GPIO8_NO_WAKEUP 0x08
  573. #define DA9063_GPIO9_PIN_MASK 0x30
  574. #define DA9063_GPIO9_PIN_GPI_PWR_EN 0x00
  575. #define DA9063_GPIO9_PIN_GPI 0x10
  576. #define DA9063_GPIO9_PIN_GPO_PSS 0x20
  577. #define DA9063_GPIO9_PIN_GPO 0x30
  578. #define DA9063_GPIO9_TYPE 0x40
  579. #define DA9063_GPIO9_TYPE_GPI_ACT_LOW 0x00
  580. #define DA9063_GPIO9_TYPE_GPO_VDD_IO1 0x00
  581. #define DA9063_GPIO9_TYPE_GPI_ACT_HIGH 0x04
  582. #define DA9063_GPIO9_TYPE_GPO_VDD_IO2 0x04
  583. #define DA9063_GPIO9_NO_WAKEUP 0x80
  584. /* DA9063_REG_GPIO_10_11 (addr=0x1A) */
  585. #define DA9063_GPIO10_PIN_MASK 0x03
  586. #define DA9063_GPIO10_PIN_GPI_PWR1_EN 0x00
  587. #define DA9063_GPIO10_PIN_GPI 0x01
  588. #define DA9063_GPIO10_PIN_GPO_OD 0x02
  589. #define DA9063_GPIO10_PIN_GPO 0x03
  590. #define DA9063_GPIO10_TYPE 0x04
  591. #define DA9063_GPIO10_TYPE_GPI_ACT_LOW 0x00
  592. #define DA9063_GPIO10_TYPE_GPO_VDD_IO1 0x00
  593. #define DA9063_GPIO10_TYPE_GPI_ACT_HIGH 0x04
  594. #define DA9063_GPIO10_TYPE_GPO_VDD_IO2 0x04
  595. #define DA9063_GPIO10_NO_WAKEUP 0x08
  596. #define DA9063_GPIO11_PIN_MASK 0x30
  597. #define DA9063_GPIO11_PIN_GPO_OD 0x00
  598. #define DA9063_GPIO11_PIN_GPI 0x10
  599. #define DA9063_GPIO11_PIN_GPO_PSS 0x20
  600. #define DA9063_GPIO11_PIN_GPO 0x30
  601. #define DA9063_GPIO11_TYPE 0x40
  602. #define DA9063_GPIO11_TYPE_GPI_ACT_LOW 0x00
  603. #define DA9063_GPIO11_TYPE_GPO_VDD_IO1 0x00
  604. #define DA9063_GPIO11_TYPE_GPI_ACT_HIGH 0x04
  605. #define DA9063_GPIO11_TYPE_GPO_VDD_IO2 0x04
  606. #define DA9063_GPIO11_NO_WAKEUP 0x80
  607. /* DA9063_REG_GPIO_12_13 (addr=0x1B) */
  608. #define DA9063_GPIO12_PIN_MASK 0x03
  609. #define DA9063_GPIO12_PIN_NVDDFLT_OUT 0x00
  610. #define DA9063_GPIO12_PIN_GPI 0x01
  611. #define DA9063_GPIO12_PIN_VSYSMON_OUT 0x02
  612. #define DA9063_GPIO12_PIN_GPO 0x03
  613. #define DA9063_GPIO12_TYPE 0x04
  614. #define DA9063_GPIO12_TYPE_GPI_ACT_LOW 0x00
  615. #define DA9063_GPIO12_TYPE_GPO_VDD_IO1 0x00
  616. #define DA9063_GPIO12_TYPE_GPI_ACT_HIGH 0x04
  617. #define DA9063_GPIO12_TYPE_GPO_VDD_IO2 0x04
  618. #define DA9063_GPIO12_NO_WAKEUP 0x08
  619. #define DA9063_GPIO13_PIN_MASK 0x30
  620. #define DA9063_GPIO13_PIN_GPFB1_OUT 0x00
  621. #define DA9063_GPIO13_PIN_GPI 0x10
  622. #define DA9063_GPIO13_PIN_GPFB1_OUTOD 0x20
  623. #define DA9063_GPIO13_PIN_GPO 0x30
  624. #define DA9063_GPIO13_TYPE 0x40
  625. #define DA9063_GPIO13_TYPE_GPFB1_OUT 0x00
  626. #define DA9063_GPIO13_TYPE_GPI 0x00
  627. #define DA9063_GPIO13_TYPE_GPFB1_OUTOD 0x04
  628. #define DA9063_GPIO13_TYPE_GPO 0x04
  629. #define DA9063_GPIO13_NO_WAKEUP 0x80
  630. /* DA9063_REG_GPIO_14_15 (addr=0x1C) */
  631. #define DA9063_GPIO14_PIN_MASK 0x03
  632. #define DA9063_GPIO14_PIN_GPO_OD 0x00
  633. #define DA9063_GPIO14_PIN_GPI 0x01
  634. #define DA9063_GPIO14_PIN_HS2DATA 0x02
  635. #define DA9063_GPIO14_PIN_GPO 0x03
  636. #define DA9063_GPIO14_TYPE 0x04
  637. #define DA9063_GPIO14_TYPE_GPI_ACT_LOW 0x00
  638. #define DA9063_GPIO14_TYPE_GPO_VDD_IO1 0x00
  639. #define DA9063_GPIO14_TYPE_GPI_ACT_HIGH 0x04
  640. #define DA9063_GPIO14_TYPE_GPO_VDD_IO2 0x04
  641. #define DA9063_GPIO14_NO_WAKEUP 0x08
  642. #define DA9063_GPIO15_PIN_MASK 0x30
  643. #define DA9063_GPIO15_PIN_GPO_OD 0x00
  644. #define DA9063_GPIO15_PIN_GPI 0x10
  645. #define DA9063_GPIO15_PIN_GPO 0x30
  646. #define DA9063_GPIO15_TYPE 0x40
  647. #define DA9063_GPIO15_TYPE_GPFB1_OUT 0x00
  648. #define DA9063_GPIO15_TYPE_GPI 0x00
  649. #define DA9063_GPIO15_TYPE_GPFB1_OUTOD 0x04
  650. #define DA9063_GPIO15_TYPE_GPO 0x04
  651. #define DA9063_GPIO15_NO_WAKEUP 0x80
  652. /* DA9063_REG_GPIO_MODE0_7 (addr=0x1D) */
  653. #define DA9063_GPIO0_MODE 0x01
  654. #define DA9063_GPIO1_MODE 0x02
  655. #define DA9063_GPIO2_MODE 0x04
  656. #define DA9063_GPIO3_MODE 0x08
  657. #define DA9063_GPIO4_MODE 0x10
  658. #define DA9063_GPIO5_MODE 0x20
  659. #define DA9063_GPIO6_MODE 0x40
  660. #define DA9063_GPIO7_MODE 0x80
  661. /* DA9063_REG_GPIO_MODE8_15 (addr=0x1E) */
  662. #define DA9063_GPIO8_MODE 0x01
  663. #define DA9063_GPIO9_MODE 0x02
  664. #define DA9063_GPIO10_MODE 0x04
  665. #define DA9063_GPIO11_MODE 0x08
  666. #define DA9063_GPIO11_MODE_LED_ACT_HIGH 0x00
  667. #define DA9063_GPIO11_MODE_LED_ACT_LOW 0x08
  668. #define DA9063_GPIO12_MODE 0x10
  669. #define DA9063_GPIO13_MODE 0x20
  670. #define DA9063_GPIO14_MODE 0x40
  671. #define DA9063_GPIO14_MODE_LED_ACT_HIGH 0x00
  672. #define DA9063_GPIO14_MODE_LED_ACT_LOW 0x40
  673. #define DA9063_GPIO15_MODE 0x80
  674. #define DA9063_GPIO15_MODE_LED_ACT_HIGH 0x00
  675. #define DA9063_GPIO15_MODE_LED_ACT_LOW 0x80
  676. /* DA9063_REG_SWITCH_CONT (addr=0x1F) */
  677. #define DA9063_CORE_SW_GPI_MASK 0x03
  678. #define DA9063_CORE_SW_GPI_OFF 0x00
  679. #define DA9063_CORE_SW_GPI_GPIO1 0x01
  680. #define DA9063_CORE_SW_GPI_GPIO2 0x02
  681. #define DA9063_CORE_SW_GPI_GPIO13 0x03
  682. #define DA9063_PERI_SW_GPI_MASK 0x0C
  683. #define DA9063_PERI_SW_GPI_OFF 0x00
  684. #define DA9063_PERI_SW_GPI_GPIO1 0x04
  685. #define DA9063_PERI_SW_GPI_GPIO2 0x08
  686. #define DA9063_PERI_SW_GPI_GPIO13 0x0C
  687. #define DA9063_SWITCH_SR_MASK 0x30
  688. #define DA9063_SWITCH_SR_1MV 0x00
  689. #define DA9063_SWITCH_SR_5MV 0x10
  690. #define DA9063_SWITCH_SR_10MV 0x20
  691. #define DA9063_SWITCH_SR_50MV 0x30
  692. #define DA9063_CORE_SW_INTERNAL 0x40
  693. #define DA9063_CP_EN_MODE 0x80
  694. /* DA9063_REGL_Bxxxx_CONT common bits (addr=0x20-0x25) */
  695. #define DA9063_BUCK_EN 0x01
  696. #define DA9063_BUCK_GPI_MASK 0x06
  697. #define DA9063_BUCK_GPI_OFF 0x00
  698. #define DA9063_BUCK_GPI_GPIO1 0x02
  699. #define DA9063_BUCK_GPI_GPIO2 0x04
  700. #define DA9063_BUCK_GPI_GPIO13 0x06
  701. #define DA9063_BUCK_CONF 0x08
  702. #define DA9063_VBUCK_GPI_MASK 0x60
  703. #define DA9063_VBUCK_GPI_OFF 0x00
  704. #define DA9063_VBUCK_GPI_GPIO1 0x20
  705. #define DA9063_VBUCK_GPI_GPIO2 0x40
  706. #define DA9063_VBUCK_GPI_GPIO13 0x60
  707. /* DA9063_REG_BCORE1_CONT specific bits (addr=0x21) */
  708. #define DA9063_CORE_SW_EN 0x10
  709. #define DA9063_CORE_SW_CONF 0x80
  710. /* DA9063_REG_BPERI_CONT specific bits (addr=0x25) */
  711. #define DA9063_PERI_SW_EN 0x10
  712. #define DA9063_PERI_SW_CONF 0x80
  713. /* DA9063_REG_LDOx_CONT common bits (addr=0x26-0x30) */
  714. #define DA9063_LDO_EN 0x01
  715. #define DA9063_LDO_GPI_MASK 0x06
  716. #define DA9063_LDO_GPI_OFF 0x00
  717. #define DA9063_LDO_GPI_GPIO1 0x02
  718. #define DA9063_LDO_GPI_GPIO2 0x04
  719. #define DA9063_LDO_GPI_GPIO13 0x06
  720. #define DA9063_LDO_PD_DIS 0x08
  721. #define DA9063_VLDO_GPI_MASK 0x60
  722. #define DA9063_VLDO_GPI_OFF 0x00
  723. #define DA9063_VLDO_GPI_GPIO1 0x20
  724. #define DA9063_VLDO_GPI_GPIO2 0x40
  725. #define DA9063_VLDO_GPI_GPIO13 0x60
  726. #define DA9063_LDO_CONF 0x80
  727. /* DA9063_REG_LDO5_CONT specific bits (addr=0x2A) */
  728. #define DA9063_VLDO5_SEL 0x10
  729. /* DA9063_REG_LDO6_CONT specific bits (addr=0x2B) */
  730. #define DA9063_VLDO6_SEL 0x10
  731. /* DA9063_REG_LDO7_CONT specific bits (addr=0x2C) */
  732. #define DA9063_VLDO7_SEL 0x10
  733. /* DA9063_REG_LDO8_CONT specific bits (addr=0x2D) */
  734. #define DA9063_VLDO8_SEL 0x10
  735. /* DA9063_REG_LDO9_CONT specific bits (addr=0x2E) */
  736. #define DA9063_VLDO9_SEL 0x10
  737. /* DA9063_REG_LDO10_CONT specific bits (addr=0x2F) */
  738. #define DA9063_VLDO10_SEL 0x10
  739. /* DA9063_REG_LDO11_CONT specific bits (addr=0x30) */
  740. #define DA9063_VLDO11_SEL 0x10
  741. /* DA9063_REG_VIB (addr=0x31) */
  742. #define DA9063_VIB_SET_MASK 0x3F
  743. #define DA9063_VIB_SET_OFF 0
  744. #define DA9063_VIB_SET_MAX 0x3F
  745. /* DA9063_REG_DVC_1 (addr=0x32) */
  746. #define DA9063_VBCORE1_SEL 0x01
  747. #define DA9063_VBCORE2_SEL 0x02
  748. #define DA9063_VBPRO_SEL 0x04
  749. #define DA9063_VBMEM_SEL 0x08
  750. #define DA9063_VBPERI_SEL 0x10
  751. #define DA9063_VLDO1_SEL 0x20
  752. #define DA9063_VLDO2_SEL 0x40
  753. #define DA9063_VLDO3_SEL 0x80
  754. /* DA9063_REG_DVC_2 (addr=0x33) */
  755. #define DA9063_VBIO_SEL 0x01
  756. #define DA9063_VLDO4_SEL 0x80
  757. /* DA9063_REG_ADC_MAN (addr=0x34) */
  758. #define DA9063_ADC_MUX_MASK 0x0F
  759. #define DA9063_ADC_MUX_VSYS 0x00
  760. #define DA9063_ADC_MUX_ADCIN1 0x01
  761. #define DA9063_ADC_MUX_ADCIN2 0x02
  762. #define DA9063_ADC_MUX_ADCIN3 0x03
  763. #define DA9063_ADC_MUX_T_SENSE 0x04
  764. #define DA9063_ADC_MUX_VBBAT 0x05
  765. #define DA9063_ADC_MUX_LDO_G1 0x08
  766. #define DA9063_ADC_MUX_LDO_G2 0x09
  767. #define DA9063_ADC_MUX_LDO_G3 0x0A
  768. #define DA9063_ADC_MAN 0x10
  769. #define DA9063_ADC_MODE 0x20
  770. /* DA9063_REG_ADC_CONT (addr=0x35) */
  771. #define DA9063_ADC_AUTO_VSYS_EN 0x01
  772. #define DA9063_ADC_AUTO_AD1_EN 0x02
  773. #define DA9063_ADC_AUTO_AD2_EN 0x04
  774. #define DA9063_ADC_AUTO_AD3_EN 0x08
  775. #define DA9063_ADC_AD1_ISRC_EN 0x10
  776. #define DA9063_ADC_AD2_ISRC_EN 0x20
  777. #define DA9063_ADC_AD3_ISRC_EN 0x40
  778. #define DA9063_COMP1V2_EN 0x80
  779. /* DA9063_REG_VSYS_MON (addr=0x36) */
  780. #define DA9063_VSYS_VAL_MASK 0xFF
  781. #define DA9063_VSYS_VAL_BASE 0x00
  782. /* DA9063_REG_ADC_RES_L (addr=0x37) */
  783. #define DA9063_ADC_RES_L_BITS 2
  784. #define DA9063_ADC_RES_L_MASK 0xC0
  785. /* DA9063_REG_ADC_RES_H (addr=0x38) */
  786. #define DA9063_ADC_RES_M_BITS 8
  787. #define DA9063_ADC_RES_M_MASK 0xFF
  788. /* DA9063_REG_(xxx_RES/ADC_RES_H) (addr=0x39-0x3F) */
  789. #define DA9063_ADC_VAL_MASK 0xFF
  790. /* DA9063_REG_COUNT_S (addr=0x40) */
  791. #define DA9063_RTC_READ 0x80
  792. #define DA9063_COUNT_SEC_MASK 0x3F
  793. /* DA9063_REG_COUNT_MI (addr=0x41) */
  794. #define DA9063_COUNT_MIN_MASK 0x3F
  795. /* DA9063_REG_COUNT_H (addr=0x42) */
  796. #define DA9063_COUNT_HOUR_MASK 0x1F
  797. /* DA9063_REG_COUNT_D (addr=0x43) */
  798. #define DA9063_COUNT_DAY_MASK 0x1F
  799. /* DA9063_REG_COUNT_MO (addr=0x44) */
  800. #define DA9063_COUNT_MONTH_MASK 0x0F
  801. /* DA9063_REG_COUNT_Y (addr=0x45) */
  802. #define DA9063_COUNT_YEAR_MASK 0x3F
  803. #define DA9063_MONITOR 0x40
  804. /* DA9063_REG_ALARM_S (addr=0x46) */
  805. #define DA9063_BB_ALARM_S_MASK 0x3F
  806. #define DA9063_ALARM_STATUS_ALARM 0x80
  807. #define DA9063_ALARM_STATUS_TICK 0x40
  808. /* DA9063_REG_ALARM_MI (addr=0x47) */
  809. #define DA9063_ALARM_MIN_MASK 0x3F
  810. /* DA9063_REG_ALARM_H (addr=0x48) */
  811. #define DA9063_ALARM_HOUR_MASK 0x1F
  812. /* DA9063_REG_ALARM_D (addr=0x49) */
  813. #define DA9063_ALARM_DAY_MASK 0x1F
  814. /* DA9063_REG_ALARM_MO (addr=0x4A) */
  815. #define DA9063_TICK_WAKE 0x20
  816. #define DA9063_TICK_TYPE 0x10
  817. #define DA9063_TICK_TYPE_SEC 0x00
  818. #define DA9063_TICK_TYPE_MIN 0x10
  819. #define DA9063_ALARM_MONTH_MASK 0x0F
  820. /* DA9063_REG_ALARM_Y (addr=0x4B) */
  821. #define DA9063_TICK_ON 0x80
  822. #define DA9063_ALARM_ON 0x40
  823. #define DA9063_ALARM_YEAR_MASK 0x3F
  824. /* DA9063_REG_WAIT (addr=0x97)*/
  825. #define DA9063_REG_WAIT_TIME_MASK 0xF
  826. #define DA9063_WAIT_TIME_0_US 0x0
  827. #define DA9063_WAIT_TIME_512_US 0x1
  828. #define DA9063_WAIT_TIME_1_MS 0x2
  829. #define DA9063_WAIT_TIME_2_MS 0x3
  830. #define DA9063_WAIT_TIME_4_1_MS 0x4
  831. #define DA9063_WAIT_TIME_8_2_MS 0x5
  832. #define DA9063_WAIT_TIME_16_4_MS 0x6
  833. #define DA9063_WAIT_TIME_32_8_MS 0x7
  834. #define DA9063_WAIT_TIME_65_5_MS 0x8
  835. #define DA9063_WAIT_TIME_128_MS 0x9
  836. #define DA9063_WAIT_TIME_256_MS 0xA
  837. #define DA9063_WAIT_TIME_512_MS 0xB
  838. #define DA9063_WAIT_TIME_1_S 0xC
  839. #define DA9063_WAIT_TIME_2_1_S 0xD
  840. /* DA9063_REG_EN_32K (addr=0x98)*/
  841. #define DA9063_STABILIZ_TIME_MASK 0x7
  842. #define DA9063_CRYSTAL 0x08
  843. #define DA9063_DELAY_MODE 0x10
  844. #define DA9063_OUT_CLOCK 0x20
  845. #define DA9063_RTC_CLOCK 0x40
  846. #define DA9063_OUT_32K_EN 0x80
  847. /* DA9063_REG_CHIP_VARIANT */
  848. #define DA9063_CHIP_VARIANT_SHIFT 4
  849. /* DA9063_REG_BUCK_ILIM_A (addr=0x9A) */
  850. #define DA9063_BIO_ILIM_MASK 0x0F
  851. #define DA9063_BMEM_ILIM_MASK 0xF0
  852. /* DA9063_REG_BUCK_ILIM_B (addr=0x9B) */
  853. #define DA9063_BPRO_ILIM_MASK 0x0F
  854. #define DA9063_BPERI_ILIM_MASK 0xF0
  855. /* DA9063_REG_BUCK_ILIM_C (addr=0x9C) */
  856. #define DA9063_BCORE1_ILIM_MASK 0x0F
  857. #define DA9063_BCORE2_ILIM_MASK 0xF0
  858. /* DA9063_REG_Bxxxx_CFG common bits (addr=0x9D-0xA2) */
  859. #define DA9063_BUCK_FB_MASK 0x07
  860. #define DA9063_BUCK_PD_DIS_MASK 0x20
  861. #define DA9063_BUCK_MODE_MASK 0xC0
  862. #define DA9063_BUCK_MODE_MANUAL 0x00
  863. #define DA9063_BUCK_MODE_SLEEP 0x40
  864. #define DA9063_BUCK_MODE_SYNC 0x80
  865. #define DA9063_BUCK_MODE_AUTO 0xC0
  866. /* DA9063_REG_BPRO_CFG (addr=0x9F) */
  867. #define DA9063_BPRO_VTTR_EN 0x08
  868. #define DA9063_BPRO_VTT_EN 0x10
  869. /* DA9063_REG_VBxxxx_A/B (addr=0xA3-0xA8, 0xB4-0xB9) */
  870. #define DA9063_VBUCK_MASK 0x7F
  871. #define DA9063_VBUCK_BIAS 0
  872. #define DA9063_BUCK_SL 0x80
  873. /* DA9063_REG_VLDOx_A/B (addr=0xA9-0x3, 0xBA-0xC4) */
  874. #define DA9063_LDO_SL 0x80
  875. /* DA9063_REG_VLDO1_A/B (addr=0xA9, 0xBA) */
  876. #define DA9063_VLDO1_MASK 0x3F
  877. #define DA9063_VLDO1_BIAS 0
  878. /* DA9063_REG_VLDO2_A/B (addr=0xAA, 0xBB) */
  879. #define DA9063_VLDO2_MASK 0x3F
  880. #define DA9063_VLDO2_BIAS 0
  881. /* DA9063_REG_VLDO3_A/B (addr=0xAB, 0xBC) */
  882. #define DA9063_VLDO3_MASK 0x7F
  883. #define DA9063_VLDO3_BIAS 0
  884. /* DA9063_REG_VLDO4_A/B (addr=0xAC, 0xBD) */
  885. #define DA9063_VLDO4_MASK 0x7F
  886. #define DA9063_VLDO4_BIAS 0
  887. /* DA9063_REG_VLDO5_A/B (addr=0xAD, 0xBE) */
  888. #define DA9063_VLDO5_MASK 0x3F
  889. #define DA9063_VLDO5_BIAS 2
  890. /* DA9063_REG_VLDO6_A/B (addr=0xAE, 0xBF) */
  891. #define DA9063_VLDO6_MASK 0x3F
  892. #define DA9063_VLDO6_BIAS 2
  893. /* DA9063_REG_VLDO7_A/B (addr=0xAF, 0xC0) */
  894. #define DA9063_VLDO7_MASK 0x3F
  895. #define DA9063_VLDO7_BIAS 2
  896. /* DA9063_REG_VLDO8_A/B (addr=0xB0, 0xC1) */
  897. #define DA9063_VLDO8_MASK 0x3F
  898. #define DA9063_VLDO8_BIAS 2
  899. /* DA9063_REG_VLDO9_A/B (addr=0xB1, 0xC2) */
  900. #define DA9063_VLDO9_MASK 0x3F
  901. #define DA9063_VLDO9_BIAS 3
  902. /* DA9063_REG_VLDO10_A/B (addr=0xB2, 0xC3) */
  903. #define DA9063_VLDO10_MASK 0x3F
  904. #define DA9063_VLDO10_BIAS 2
  905. /* DA9063_REG_VLDO11_A/B (addr=0xB3, 0xC4) */
  906. #define DA9063_VLDO11_MASK 0x3F
  907. #define DA9063_VLDO11_BIAS 2
  908. /* DA9063_REG_GPO11_LED (addr=0xC6) */
  909. /* DA9063_REG_GPO14_LED (addr=0xC7) */
  910. /* DA9063_REG_GPO15_LED (addr=0xC8) */
  911. #define DA9063_GPIO_DIM 0x80
  912. #define DA9063_GPIO_PWM_MASK 0x7F
  913. /* DA9063_REG_CONFIG_H (addr=0x10D) */
  914. #define DA9063_PWM_CLK_MASK 0x01
  915. #define DA9063_PWM_CLK_PWM2MHZ 0x00
  916. #define DA9063_PWM_CLK_PWM1MHZ 0x01
  917. #define DA9063_LDO8_MODE_MASK 0x02
  918. #define DA9063_LDO8_MODE_LDO 0
  919. #define DA9063_LDO8_MODE_VIBR 0x02
  920. #define DA9063_MERGE_SENSE_MASK 0x04
  921. #define DA9063_MERGE_SENSE_GP_FB2 0x00
  922. #define DA9063_MERGE_SENSE_GPIO4 0x04
  923. #define DA9063_BCORE_MERGE 0x08
  924. #define DA9063_BPRO_OD 0x10
  925. #define DA9063_BCORE2_OD 0x20
  926. #define DA9063_BCORE1_OD 0x40
  927. #define DA9063_BUCK_MERGE 0x80
  928. /* DA9063_REG_CONFIG_I (addr=0x10E) */
  929. #define DA9063_NONKEY_PIN_MASK 0x03
  930. #define DA9063_NONKEY_PIN_PORT 0x00
  931. #define DA9063_NONKEY_PIN_SWDOWN 0x01
  932. #define DA9063_NONKEY_PIN_AUTODOWN 0x02
  933. #define DA9063_NONKEY_PIN_AUTOFLPRT 0x03
  934. /* DA9063_REG_MON_REG_5 (addr=0x116) */
  935. #define DA9063_MON_A8_IDX_MASK 0x07
  936. #define DA9063_MON_A8_IDX_NONE 0x00
  937. #define DA9063_MON_A8_IDX_BCORE1 0x01
  938. #define DA9063_MON_A8_IDX_BCORE2 0x02
  939. #define DA9063_MON_A8_IDX_BPRO 0x03
  940. #define DA9063_MON_A8_IDX_LDO3 0x04
  941. #define DA9063_MON_A8_IDX_LDO4 0x05
  942. #define DA9063_MON_A8_IDX_LDO11 0x06
  943. #define DA9063_MON_A9_IDX_MASK 0x70
  944. #define DA9063_MON_A9_IDX_NONE 0x00
  945. #define DA9063_MON_A9_IDX_BIO 0x01
  946. #define DA9063_MON_A9_IDX_BMEM 0x02
  947. #define DA9063_MON_A9_IDX_BPERI 0x03
  948. #define DA9063_MON_A9_IDX_LDO1 0x04
  949. #define DA9063_MON_A9_IDX_LDO2 0x05
  950. #define DA9063_MON_A9_IDX_LDO5 0x06
  951. /* DA9063_REG_MON_REG_6 (addr=0x117) */
  952. #define DA9063_MON_A10_IDX_MASK 0x07
  953. #define DA9063_MON_A10_IDX_NONE 0x00
  954. #define DA9063_MON_A10_IDX_LDO6 0x01
  955. #define DA9063_MON_A10_IDX_LDO7 0x02
  956. #define DA9063_MON_A10_IDX_LDO8 0x03
  957. #define DA9063_MON_A10_IDX_LDO9 0x04
  958. #define DA9063_MON_A10_IDX_LDO10 0x05
  959. #endif /* _DA9063_REG_H */