qpnp-smb5.txt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. Qualcomm Technologies, Inc. SMB5 Charger Specific Bindings
  2. SMB5 Charger is an efficient programmable battery charger capable of charging a
  3. high-capacity lithium-ion battery over micro-USB or USB Type-C ultrafast with
  4. Quick Charge 2.0, Quick Charge 3.0, and USB Power Delivery support. Wireless
  5. charging features full A4WP Rezence 1.2, WPC 1.2, and PMA support.
  6. =======================
  7. Required Node Structure
  8. =======================
  9. SMB5 Charger must be described in two levels of devices nodes.
  10. ===============================
  11. First Level Node - SMB5 Charger
  12. ===============================
  13. Charger specific properties:
  14. - compatible
  15. Usage: required
  16. Value type: <string>
  17. Definition: "qcom,qpnp-smb5".
  18. - qcom,pmic-revid
  19. Usage: required
  20. Value type: phandle
  21. Definition: Should specify the phandle of PMI's revid module. This is used to
  22. identify the PMI subtype.
  23. - qcom,batteryless-platform
  24. Usage: optional
  25. Value type: <empty>
  26. Definition: Boolean flag which indicates that the platform does not have a
  27. battery, and therefore charging should be disabled. In
  28. addition battery properties will be faked such that the device
  29. assumes normal operation.
  30. - qcom,fcc-max-ua
  31. Usage: optional
  32. Value type: <u32>
  33. Definition: Specifies the maximum fast charge current in micro-amps.
  34. If the value is not present, 1Amp is used as default.
  35. - qcom,fv-max-uv
  36. Usage: optional
  37. Value type: <u32>
  38. Definition: Specifies the maximum float voltage in micro-volts.
  39. If the value is not present, 4.35V is used as default.
  40. - qcom,usb-icl-ua
  41. Usage: optional
  42. Value type: <u32>
  43. Definition: Specifies the USB input current limit in micro-amps.
  44. If the value is not present, 1.5Amps is used as default.
  45. - qcom,usb-ocl-ua
  46. Usage: optional
  47. Value type: <u32>
  48. Definition: Specifies the OTG output current limit in micro-amps.
  49. If the value is not present, 1.5Amps is used as default.
  50. - qcom,dc-icl-ua
  51. Usage: optional
  52. Value type: <u32>
  53. Definition: Specifies the DC input current limit in micro-amps.
  54. - qcom,boost-threshold-ua
  55. Usage: optional
  56. Value type: <u32>
  57. Definition: Specifies the boost current threshold in micro-amps.
  58. If the value is not present, 100mA is used as default.
  59. - qcom,thermal-mitigation
  60. Usage: optional
  61. Value type: Array of <u32>
  62. Definition: Array of fast charge current limit values for
  63. different system thermal mitigation levels.
  64. This should be a flat array that denotes the
  65. maximum charge current in mA for each thermal
  66. level.
  67. - qcom,float-option
  68. Usage: optional
  69. Value type: <u32>
  70. Definition: Configures how the charger behaves when a float charger is
  71. detected by APSD.
  72. 1 - Treat as a DCP.
  73. 2 - Treat as a SDP.
  74. 3 - Disable charging.
  75. 4 - Suspend USB input.
  76. - qcom,hvdcp-disable
  77. Usage: optional
  78. Value type: <empty>
  79. Definition: Specifies if hvdcp charging is to be enabled or not.
  80. If this property is not specified hvdcp will be enabled.
  81. If this property is specified, hvdcp 2.0 detection will still
  82. happen but the adapter won't be asked to switch to a higher
  83. voltage point.
  84. - qcom,chg-inhibit-threshold-mv
  85. Usage: optional
  86. Value type: <u32>
  87. Definition: Charge inhibit threshold in milli-volts. Charging will be
  88. inhibited when the battery voltage is within this threshold
  89. from Vfloat at charger insertion. If this is not specified
  90. then charge inhibit will be disabled by default.
  91. Allowed values are: 50, 100, 200, 300.
  92. - qcom,auto-recharge-soc
  93. Usage: optional
  94. Value type: <u32>
  95. Definition: Specifies the SOC threshold at which the charger will
  96. restart charging after termination. The value specified
  97. ranges from 0 - 100. The feature is enabled if this
  98. property is specified with a valid SOC value.
  99. - qcom,auto-recharge-vbat-mv
  100. Usage: optional
  101. Value type: <u32>
  102. Definition: Specifies the battery voltage threshold at which the charger
  103. will restart charging after termination. The value specified
  104. is in milli-volts.
  105. - qcom,suspend-input-on-debug-batt
  106. Usage: optional
  107. Value type: <empty>
  108. Definition: Boolean flag which when present enables input suspend for
  109. debug battery.
  110. - qcom,min-freq-khz
  111. Usage: optional
  112. Value type: <u32>
  113. Definition: Specifies the minimum charger buck/boost switching frequency
  114. in KHz. It overrides the min frequency defined for the charger.
  115. - qcom,max-freq-khz
  116. Usage: optional
  117. Value type: <u32>
  118. Definition: Specifies the maximum charger buck/boost switching frequency in
  119. KHz. It overrides the max frequency defined for the charger.
  120. - qcom,otg-deglitch-time-ms
  121. Usage: optional
  122. Value type: <u32>
  123. Definition: Specifies the deglitch interval for OTG detection.
  124. If the value is not present, 50 msec is used as default.
  125. - qcom,step-charging-enable
  126. Usage: optional
  127. Value type: bool
  128. Definition: Boolean flag which when present enables step-charging.
  129. - qcom,wd-bark-time-secs
  130. Usage: optional
  131. Value type: <u32>
  132. Definition: WD bark-timeout in seconds. The possible values are
  133. 16, 32, 64, 128. If not defined it defaults to 64.
  134. - qcom,sw-jeita-enable
  135. Usage: optional
  136. Value type: bool
  137. Definition: Boolean flag which when present enables sw compensation for
  138. jeita.
  139. - qcom,battery-data
  140. Usage: optional
  141. Value type: <phandle>
  142. Definition: Specifies the phandle of the node which contains the battery
  143. profiles supported on the device.
  144. - qcom,flash-derating-soc
  145. Usage: optional
  146. Value type: <u32>
  147. Definition: SOC threshold in percentage below which hardware will start
  148. derating flash. This is only applicable to certain PMICs like
  149. PMI632 which has SCHGM_FLASH peripheral.
  150. - qcom,flash-disable-soc
  151. Usage: optional
  152. Value type: <u32>
  153. Definition: SOC threshold in percentage below which hardware will disable
  154. flash. This is only applicable to certain PMICs like PMI632
  155. which has SCHGM_FLASH peripheral.
  156. - qcom,headroom-mode
  157. Usage: optional
  158. Value type: <u32>
  159. Definition: Specifies flash hardware headroom management policy. The
  160. possible values are:
  161. <0>: Fixed mode, constant 5V at flash input.
  162. <1>: Adaptive mode allows charger output voltage to be
  163. dynamically controlled by the flash module based on the
  164. required flash headroom.
  165. This is only applicable to certain PMICs like PMI632 which
  166. has SCHGM_FLASH peripheral.
  167. - qcom,chg-vadc
  168. Usage: optional
  169. Value type: <phandle>
  170. Definition: Phandle for the VADC node, it is used to obtain USBIN_V
  171. and USBIN_I readings on PMIC632 based platform.
  172. =============================================
  173. Second Level Nodes - SMB5 Charger Peripherals
  174. =============================================
  175. Peripheral specific properties:
  176. - reg
  177. Usage: required
  178. Value type: <prop-encoded-array>
  179. Definition: Address and size of the peripheral's register block.
  180. - interrupts
  181. Usage: required
  182. Value type: <prop-encoded-array>
  183. Definition: Peripheral interrupt specifier.
  184. - interrupt-names
  185. Usage: required
  186. Value type: <stringlist>
  187. Definition: Interrupt names. This list must match up 1-to-1 with the
  188. interrupts specified in the 'interrupts' property.
  189. =======
  190. Example
  191. =======
  192. pmi8998_charger: qcom,qpnp-smb5 {
  193. compatible = "qcom,qpnp-smb5";
  194. #address-cells = <1>;
  195. #size-cells = <1>;
  196. dpdm-supply = <&qusb_phy0>;
  197. qcom,chgr@1000 {
  198. reg = <0x1000 0x100>;
  199. interrupts = <0x2 0x10 0x0 IRQ_TYPE_NONE>,
  200. <0x2 0x10 0x1 IRQ_TYPE_NONE>,
  201. <0x2 0x10 0x2 IRQ_TYPE_NONE>,
  202. <0x2 0x10 0x3 IRQ_TYPE_NONE>,
  203. <0x2 0x10 0x4 IRQ_TYPE_NONE>;
  204. interrupt-names = "chg-error",
  205. "chg-state-change",
  206. "step-chg-state-change",
  207. "step-chg-soc-update-fail",
  208. "step-chg-soc-update-request";
  209. };
  210. qcom,otg@1100 {
  211. reg = <0x1100 0x100>;
  212. interrupts = <0x2 0x11 0x0 IRQ_TYPE_NONE>,
  213. <0x2 0x11 0x1 IRQ_TYPE_NONE>,
  214. <0x2 0x11 0x2 IRQ_TYPE_NONE>,
  215. <0x2 0x11 0x3 IRQ_TYPE_NONE>;
  216. interrupt-names = "otg-fail",
  217. "otg-overcurrent",
  218. "otg-oc-dis-sw-sts",
  219. "testmode-change-detect";
  220. };
  221. qcom,bat-if@1200 {
  222. reg = <0x1200 0x100>;
  223. interrupts = <0x2 0x12 0x0 IRQ_TYPE_NONE>,
  224. <0x2 0x12 0x1 IRQ_TYPE_NONE>,
  225. <0x2 0x12 0x2 IRQ_TYPE_NONE>,
  226. <0x2 0x12 0x3 IRQ_TYPE_NONE>,
  227. <0x2 0x12 0x4 IRQ_TYPE_NONE>,
  228. <0x2 0x12 0x5 IRQ_TYPE_NONE>;
  229. interrupt-names = "bat-temp",
  230. "bat-ocp",
  231. "bat-ov",
  232. "bat-low",
  233. "bat-therm-or-id-missing",
  234. "bat-terminal-missing";
  235. };
  236. qcom,usb-chgpth@1300 {
  237. reg = <0x1300 0x100>;
  238. interrupts = <0x2 0x13 0x0 IRQ_TYPE_NONE>,
  239. <0x2 0x13 0x1 IRQ_TYPE_NONE>,
  240. <0x2 0x13 0x2 IRQ_TYPE_NONE>,
  241. <0x2 0x13 0x3 IRQ_TYPE_NONE>,
  242. <0x2 0x13 0x4 IRQ_TYPE_NONE>,
  243. <0x2 0x13 0x5 IRQ_TYPE_NONE>,
  244. <0x2 0x13 0x6 IRQ_TYPE_NONE>,
  245. <0x2 0x13 0x7 IRQ_TYPE_NONE>;
  246. interrupt-names = "usbin-collapse",
  247. "usbin-lt-3p6v",
  248. "usbin-uv",
  249. "usbin-ov",
  250. "usbin-plugin",
  251. "usbin-src-change",
  252. "usbin-icl-change",
  253. "type-c-change";
  254. };
  255. qcom,dc-chgpth@1400 {
  256. reg = <0x1400 0x100>;
  257. interrupts = <0x2 0x14 0x0 IRQ_TYPE_NONE>,
  258. <0x2 0x14 0x1 IRQ_TYPE_NONE>,
  259. <0x2 0x14 0x2 IRQ_TYPE_NONE>,
  260. <0x2 0x14 0x3 IRQ_TYPE_NONE>,
  261. <0x2 0x14 0x4 IRQ_TYPE_NONE>,
  262. <0x2 0x14 0x5 IRQ_TYPE_NONE>,
  263. <0x2 0x14 0x6 IRQ_TYPE_NONE>;
  264. interrupt-names = "dcin-collapse",
  265. "dcin-lt-3p6v",
  266. "dcin-uv",
  267. "dcin-ov",
  268. "dcin-plugin",
  269. "div2-en-dg",
  270. "dcin-icl-change";
  271. };
  272. qcom,chgr-misc@1600 {
  273. reg = <0x1600 0x100>;
  274. interrupts = <0x2 0x16 0x0 IRQ_TYPE_NONE>,
  275. <0x2 0x16 0x1 IRQ_TYPE_NONE>,
  276. <0x2 0x16 0x2 IRQ_TYPE_NONE>,
  277. <0x2 0x16 0x3 IRQ_TYPE_NONE>,
  278. <0x2 0x16 0x4 IRQ_TYPE_NONE>,
  279. <0x2 0x16 0x5 IRQ_TYPE_NONE>,
  280. <0x2 0x16 0x6 IRQ_TYPE_NONE>,
  281. <0x2 0x16 0x7 IRQ_TYPE_NONE>;
  282. interrupt-names = "wdog-snarl",
  283. "wdog-bark",
  284. "aicl-fail",
  285. "aicl-done",
  286. "high-duty-cycle",
  287. "input-current-limiting",
  288. "temperature-change",
  289. "switcher-power-ok";
  290. };
  291. qcom,schgm-flash@a600 {
  292. reg = <0xa600 0x100>;
  293. interrupts = <0x2 0xa6 0x0 IRQ_TYPE_NONE>,
  294. <0x2 0xa6 0x1 IRQ_TYPE_NONE>,
  295. <0x2 0xa6 0x2 IRQ_TYPE_NONE>,
  296. <0x2 0xa6 0x3 IRQ_TYPE_NONE>,
  297. <0x2 0xa6 0x4 IRQ_TYPE_NONE>,
  298. <0x2 0xa6 0x5 IRQ_TYPE_NONE>,
  299. <0x2 0xa6 0x6 IRQ_TYPE_NONE>,
  300. <0x2 0xa6 0x7 IRQ_TYPE_NONE>;
  301. interrupt-names = "flash-en",
  302. "torch-req",
  303. "flash-state-change",
  304. "vout-up",
  305. "vout-down",
  306. "ilim1-s1",
  307. "ilim2-s2",
  308. "vreg-ok";
  309. };
  310. };