da9030.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. * (C) Copyright 2006 DENX Software Engineering
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. /* DA9030 register definitions */
  23. #define CID 0x00
  24. #define EVENT_A 0x01
  25. #define EVENT_B 0x02
  26. #define EVENT_C 0x03
  27. #define STATUS 0x04
  28. #define IRQ_MASK_A 0x05
  29. #define IRQ_MASK_B 0x06
  30. #define IRQ_MASK_C 0x07
  31. #define SYS_CONTROL_A 0x08
  32. #define SYS_CONTROL_B 0x09
  33. #define FAULT_LOG 0x0A
  34. #define LDO_10_11 0x10
  35. #define LDO_15 0x11
  36. #define LDO_14_16 0x12
  37. #define LDO_18_19 0x13
  38. #define LDO_17_SIMCP0 0x14
  39. #define BUCK2_DVC1 0x15
  40. #define BUCK2_DVC2 0x16
  41. #define REG_CONTROL_1_17 0x17
  42. #define REG_CONTROL_2_18 0x18
  43. #define USBPUMP 0x19
  44. #define SLEEP_CONTROL 0x1A
  45. #define STARTUP_CONTROL 0x1B
  46. #define LED1_CONTROL 0x20
  47. #define LED2_CONTROL 0x21
  48. #define LED3_CONTROL 0x22
  49. #define LED4_CONTROL 0x23
  50. #define LEDPC_CONTROL 0x24
  51. #define WLED_CONTROL 0x25
  52. #define MISC_CONTROLA 0x26
  53. #define MISC_CONTROLB 0x27
  54. #define CHARGE_CONTROL 0x28
  55. #define CCTR_CONTROL 0x29
  56. #define TCTR_CONTROL 0x2A
  57. #define CHARGE_PULSE 0x2B
  58. /* ... some missing ...*/
  59. #define LDO1 0x90
  60. #define LDO2_3 0x91
  61. #define LDO4_5 0x92
  62. #define LDO6_SIMCP 0x93
  63. #define LDO7_8 0x94
  64. #define LDO9_12 0x95
  65. #define BUCK 0x96
  66. #define REG_CONTROL_1_97 0x97
  67. #define REG_CONTROL_2_98 0x98
  68. #define REG_SLEEP_CONTROL1 0x99
  69. #define REG_SLEEP_CONTROL2 0x9A
  70. #define REG_SLEEP_CONTROL3 0x9B
  71. #define ADC_MAN_CONTROL 0xA0
  72. #define ADC_AUTO_CONTROL 0xA1
  73. #define VBATMON 0xA2
  74. #define VBATMONTXMON 0xA3
  75. #define TBATHIGHP 0xA4
  76. #define TBATHIGHN 0xA5
  77. #define TBATLOW 0xA6
  78. #define MAN_RES 0xB0
  79. #define VBAT_RES 0xB1
  80. #define VBATMIN_RES 0xB2
  81. #define VBATMINTXON_RES 0xB3
  82. #define ICHMAX_RES 0xB4
  83. #define ICHMIN_RES 0xB5
  84. #define ICHAVERAGE_RES 0xB6
  85. #define VCHMAX_RES 0xB7
  86. #define VCHMIN_RES 0xB8
  87. #define TBAT_RES 0xB9
  88. #define ADC_IN4_RES 0xBA
  89. #define STATUS_ONKEY_N 0x1 /* current ONKEY_N value */
  90. #define STATUS_PWREN1 (1<<1) /* PWREN1 value */
  91. #define STATUS_EXTON (1<<2) /* EXTON value */
  92. #define STATUS_CHDET (1<<3) /* Charger detection status */
  93. #define STATUS_TBAT (1<<4) /* Battery over/under temperature status */
  94. #define STATUS_VBATMON (1<<5) /* VBATMON comparison status */
  95. #define STATUS_VBATMONTXON (1<<6) /* VBATMONTXON comparison status */
  96. #define STATUS_CHIOVER (1<<7) /* Charge overcurrent */
  97. #define SYS_CONTROL_A_SLEEP_N_PIN_ENABLE 0x1
  98. #define SYS_CONTROL_A_SHUT_DOWN (1<<1)
  99. #define SYS_CONTROL_A_HWRES_ENABLE (1<<2)
  100. #define SYS_CONTROL_A_WDOG_ACTION (1<<3)
  101. #define SYS_CONTROL_A_WATCHDOG (1<<7)
  102. #define MISC_CONTROLB_USB_INT_RISING (1<<2)
  103. #define MISC_CONTROLB_SESSION_VALID_EN (1<<3)
  104. #define USB_PUMP_USBVE (1<<0)
  105. #define USB_PUMP_USBVEP (1<<1)
  106. #define USB_PUMP_SRP_DETECT (1<<2)
  107. #define USB_PUMP_SESSION_VALID (1<<3)
  108. #define USB_PUMP_VBUS_VALID_4_0 (1<<4)
  109. #define USB_PUMP_VBUS_VALID_4_4 (1<<5)
  110. #define USB_PUMP_EN_USBVE (1<<6)
  111. #define USB_PUMP_EN_USBVEP (1<<7)