mc13892.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. /*
  2. * (C) Copyright 2010
  3. * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
  4. *
  5. * (C) Copyright 2009 Freescale Semiconductor, Inc.
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #ifndef __MC13892_H__
  26. #define __MC13892_H__
  27. /* REG_CHARGE */
  28. #define VCHRG0 (1 << 0)
  29. #define VCHRG1 (1 << 1)
  30. #define VCHRG2 (1 << 2)
  31. #define ICHRG0 (1 << 3)
  32. #define ICHRG1 (1 << 4)
  33. #define ICHRG2 (1 << 5)
  34. #define ICHRG3 (1 << 6)
  35. #define TREN (1 << 7)
  36. #define ACKLPB (1 << 8)
  37. #define THCHKB (1 << 9)
  38. #define FETOVRD (1 << 10)
  39. #define FETCTRL (1 << 11)
  40. #define RVRSMODE (1 << 13)
  41. #define PLIM0 (1 << 15)
  42. #define PLIM1 (1 << 16)
  43. #define PLIMDIS (1 << 17)
  44. #define CHRGLEDEN (1 << 18)
  45. #define CHGTMRRST (1 << 19)
  46. #define CHGRESTART (1 << 20)
  47. #define CHGAUTOB (1 << 21)
  48. #define CYCLB (1 << 22)
  49. #define CHGAUTOVIB (1 << 23)
  50. /* REG_SETTING_0/1 */
  51. #define VO_1_20V 0
  52. #define VO_1_30V 1
  53. #define VO_1_50V 2
  54. #define VO_1_80V 3
  55. #define VO_1_10V 4
  56. #define VO_2_00V 5
  57. #define VO_2_77V 6
  58. #define VO_2_40V 7
  59. #define VIOL 2
  60. #define VDIG 4
  61. #define VGEN 6
  62. /* SWxMode for Normal/Standby Mode */
  63. #define SWMODE_OFF_OFF 0
  64. #define SWMODE_PWM_OFF 1
  65. #define SWMODE_PWMPS_OFF 2
  66. #define SWMODE_PFM_OFF 3
  67. #define SWMODE_AUTO_OFF 4
  68. #define SWMODE_PWM_PWM 5
  69. #define SWMODE_PWM_AUTO 6
  70. #define SWMODE_AUTO_AUTO 8
  71. #define SWMODE_PWM_PWMPS 9
  72. #define SWMODE_PWMS_PWMPS 10
  73. #define SWMODE_PWMS_AUTO 11
  74. #define SWMODE_AUTO_PFM 12
  75. #define SWMODE_PWM_PFM 13
  76. #define SWMODE_PWMS_PFM 14
  77. #define SWMODE_PFM_PFM 15
  78. #define SWMODE_MASK 0x0F
  79. #define SWMODE1_SHIFT 0
  80. #define SWMODE2_SHIFT 10
  81. #define SWMODE3_SHIFT 0
  82. #define SWMODE4_SHIFT 8
  83. /* Fields in REG_SETTING_1 */
  84. #define VVIDEO_2_7 (0 << 2)
  85. #define VVIDEO_2_775 (1 << 2)
  86. #define VVIDEO_2_5 (2 << 2)
  87. #define VVIDEO_2_6 (3 << 2)
  88. #define VVIDEO_MASK (3 << 2)
  89. #define VAUDIO_2_3 (0 << 4)
  90. #define VAUDIO_2_5 (1 << 4)
  91. #define VAUDIO_2_775 (2 << 4)
  92. #define VAUDIO_3_0 (3 << 4)
  93. #define VAUDIO_MASK (3 << 4)
  94. #define VSD_1_8 (0 << 6)
  95. #define VSD_2_0 (1 << 6)
  96. #define VSD_2_6 (2 << 6)
  97. #define VSD_2_7 (3 << 6)
  98. #define VSD_2_8 (4 << 6)
  99. #define VSD_2_9 (5 << 6)
  100. #define VSD_3_0 (6 << 6)
  101. #define VSD_3_15 (7 << 6)
  102. #define VSD_MASK (7 << 6)
  103. #define VGEN1_1_2 0
  104. #define VGEN1_1_5 1
  105. #define VGEN1_2_775 2
  106. #define VGEN1_3_15 3
  107. #define VGEN1_MASK 3
  108. #define VGEN2_1_2 (0 << 6)
  109. #define VGEN2_1_5 (1 << 6)
  110. #define VGEN2_1_6 (2 << 6)
  111. #define VGEN2_1_8 (3 << 6)
  112. #define VGEN2_2_7 (4 << 6)
  113. #define VGEN2_2_8 (5 << 6)
  114. #define VGEN2_3_0 (6 << 6)
  115. #define VGEN2_3_15 (7 << 6)
  116. #define VGEN2_MASK (7 << 6)
  117. /* Fields in REG_SETTING_1 */
  118. #define VGEN3_1_8 (0 << 14)
  119. #define VGEN3_2_9 (1 << 14)
  120. #define VGEN3_MASK (1 << 14)
  121. #define VDIG_1_05 (0 << 4)
  122. #define VDIG_1_25 (1 << 4)
  123. #define VDIG_1_65 (2 << 4)
  124. #define VDIG_1_8 (3 << 4)
  125. #define VDIG_MASK (3 << 4)
  126. #define VCAM_2_5 (0 << 16)
  127. #define VCAM_2_6 (1 << 16)
  128. #define VCAM_2_75 (2 << 16)
  129. #define VCAM_3_0 (3 << 16)
  130. #define VCAM_MASK (3 << 16)
  131. /* Reg Mode 0 */
  132. #define VGEN1EN (1 << 0)
  133. #define VGEN1STBY (1 << 1)
  134. #define VGEN1MODE (1 << 2)
  135. #define VIOHIEN (1 << 3)
  136. #define VIOHISTBY (1 << 4)
  137. #define VDIGEN (1 << 9)
  138. #define VDIGSTBY (1 << 10)
  139. #define VGEN2EN (1 << 12)
  140. #define VGEN2STBY (1 << 13)
  141. #define VGEN2MODE (1 << 14)
  142. #define VPLLEN (1 << 15)
  143. #define VPLLSTBY (1 << 16)
  144. #define VUSBEN (1 << 18)
  145. #define VUSBSTBY (1 << 19)
  146. /* Reg Mode 1 */
  147. #define VGEN3EN (1 << 0)
  148. #define VGEN3STBY (1 << 1)
  149. #define VGEN3MODE (1 << 2)
  150. #define VGEN3CONFIG (1 << 3)
  151. #define VCAMEN (1 << 6)
  152. #define VCAMSTBY (1 << 7)
  153. #define VCAMMODE (1 << 8)
  154. #define VCAMCONFIG (1 << 9)
  155. #define VVIDEOEN (1 << 12)
  156. #define VIDEOSTBY (1 << 13)
  157. #define VVIDEOMODE (1 << 14)
  158. #define VAUDIOEN (1 << 15)
  159. #define VAUDIOSTBY (1 << 16)
  160. #define VSDEN (1 << 18)
  161. #define VSDSTBY (1 << 19)
  162. #define VSDMODE (1 << 20)
  163. /* Reg Power Control 2*/
  164. #define WDIRESET (1 << 12)
  165. /* SWx Output Volts */
  166. #define SWX_OUT_MASK 0x1F
  167. #define SWX_OUT_1_25 0x1A
  168. #define SWX_OUT_1_30 0X1C
  169. /* Buck Switchers (SW1,2,3,4) Output Voltage */
  170. /*
  171. * NOTE: These values are for SWxHI = 0,
  172. * SWxHI = 1 adds 0.5V to the desired voltage
  173. */
  174. #define SWx_0_600V 0
  175. #define SWx_0_625V 1
  176. #define SWx_0_650V 2
  177. #define SWx_0_675V 3
  178. #define SWx_0_700V 4
  179. #define SWx_0_725V 5
  180. #define SWx_0_750V 6
  181. #define SWx_0_775V 7
  182. #define SWx_0_800V 8
  183. #define SWx_0_825V 9
  184. #define SWx_0_850V 10
  185. #define SWx_0_875V 11
  186. #define SWx_0_900V 12
  187. #define SWx_0_925V 13
  188. #define SWx_0_950V 14
  189. #define SWx_0_975V 15
  190. #define SWx_1_000V 16
  191. #define SWx_1_025V 17
  192. #define SWx_1_050V 18
  193. #define SWx_1_075V 19
  194. #define SWx_1_100V 20
  195. #define SWx_1_125V 21
  196. #define SWx_1_150V 22
  197. #define SWx_1_175V 23
  198. #define SWx_1_200V 24
  199. #define SWx_1_225V 25
  200. #define SWx_1_250V 26
  201. #define SWx_1_275V 27
  202. #define SWx_1_300V 28
  203. #define SWx_1_325V 29
  204. #define SWx_1_350V 30
  205. #define SWx_1_375V 31
  206. #define SWx_VOLT_MASK 0x1F
  207. #endif