qpnp-smb2.txt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. Qualcomm Technologies, Inc. SMB2 Charger Specific Bindings
  2. SMB2 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. SMB2 Charger must be described in two levels of devices nodes.
  10. ===============================
  11. First Level Node - SMB2 Charger
  12. ===============================
  13. Charger specific properties:
  14. - compatible
  15. Usage: required
  16. Value type: <string>
  17. Definition: "qcom,qpnp-smb2".
  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,use-extcon
  31. Usage: optional
  32. Value type: <empty>
  33. Definition: Boolean flag which specify that SMB2 will act as main charger
  34. to do extcon USB calls. If not defined, other charger driver can
  35. act as main charger to do extcon USB calls.
  36. - qcom,fcc-max-ua
  37. Usage: optional
  38. Value type: <u32>
  39. Definition: Specifies the maximum fast charge current in micro-amps.
  40. If the value is not present, 1Amp is used as default.
  41. - qcom,fv-max-uv
  42. Usage: optional
  43. Value type: <u32>
  44. Definition: Specifies the maximum float voltage in micro-volts.
  45. If the value is not present, 4.35V is used as default.
  46. - qcom,usb-icl-ua
  47. Usage: optional
  48. Value type: <u32>
  49. Definition: Specifies the USB input current limit in micro-amps.
  50. If the value is not present, 1.5Amps is used as default.
  51. - qcom,usb-ocl-ua
  52. Usage: optional
  53. Value type: <u32>
  54. Definition: Specifies the OTG output current limit in micro-amps.
  55. If the value is not present, 1.5Amps is used as default
  56. - qcom,dc-icl-ua
  57. Usage: optional
  58. Value type: <u32>
  59. Definition: Specifies the DC input current limit in micro-amps.
  60. - qcom,boost-threshold-ua
  61. Usage: optional
  62. Value type: <u32>
  63. Definition: Specifies the boost current threshold in micro-amps.
  64. If the value is not present, 100mA is used as default.
  65. - qcom,wipower-max-uw
  66. Usage: optional
  67. Value type: <u32>
  68. Definition: Specifies the DC input power limit in micro-watts.
  69. If the value is not present, 8W is used as default.
  70. - qcom,thermal-mitigation
  71. Usage: optional
  72. Value type: Array of <u32>
  73. Definition: Array of fast charge current limit values for
  74. different system thermal mitigation levels.
  75. This should be a flat array that denotes the
  76. maximum charge current in mA for each thermal
  77. level.
  78. - google,wlc-thermal-mitigation
  79. Usage: optional
  80. Value type: Array of <u32>
  81. Definition: Array of DC input current limit values for
  82. different system thermal mitigation levels.
  83. This should be a flat array that denotes the
  84. maximum DC input current in micro-amps for each
  85. thermal level.
  86. - io-channels
  87. Usage: optional
  88. Value type: List of <phandle u32>
  89. Definition: List of phandle and IIO specifier pairs, one pair
  90. for each IIO input to the device. Note: if the
  91. IIO provider specifies '0' for #io-channel-cells,
  92. then only the phandle portion of the pair will appear.
  93. - io-channel-names
  94. Usage: optional
  95. Value type: List of <string>
  96. Definition: List of IIO input name strings sorted in the same
  97. order as the io-channels property. Consumer drivers
  98. will use io-channel-names to match IIO input names
  99. with IIO specifiers.
  100. - qcom,float-option
  101. Usage: optional
  102. Value type: <u32>
  103. Definition: Configures how the charger behaves when a float charger is
  104. detected by APSD
  105. 1 - Treat as a DCP
  106. 2 - Treat as a SDP
  107. 3 - Disable charging
  108. 4 - Suspend USB input
  109. - qcom,hvdcp-disable
  110. Usage: optional
  111. Value type: <empty>
  112. Definition: Specifies if hvdcp charging is to be enabled or not.
  113. If this property is not specified hvdcp will be enabled.
  114. If this property is specified, hvdcp 2.0 detection will still
  115. happen but the adapter won't be asked to switch to a higher
  116. voltage point.
  117. - qcom,chg-inhibit-threshold-mv
  118. Usage: optional
  119. Value type: <u32>
  120. Definition: Charge inhibit threshold in milli-volts. Charging will be
  121. inhibited when the battery voltage is within this threshold
  122. from Vfloat at charger insertion. If this is not specified
  123. then charge inhibit will be disabled by default.
  124. Allowed values are: 50, 100, 200, 300.
  125. - qcom,auto-recharge-soc
  126. Usage: optional
  127. Value type: <empty>
  128. Definition: Specifies if automatic recharge needs to be based off battery
  129. SOC. If this property is not specified, then auto recharge will
  130. be based off battery voltage. For both SOC and battery voltage,
  131. charger receives the signal from FG to resume charging.
  132. - qcom,suspend-input-on-debug-batt
  133. Usage: optional
  134. Value type: <empty>
  135. Definition: Boolean flag which when present enables input suspend for
  136. debug battery.
  137. - qcom,min-freq-khz
  138. Usage: optional
  139. Value type: <u32>
  140. Definition: Specifies the minimum charger buck/boost switching frequency
  141. in KHz. It overrides the min frequency defined for the charger.
  142. - qcom,max-freq-khz
  143. Usage: optional
  144. Value type: <u32>
  145. Definition: Specifies the maximum charger buck/boost switching frequency in
  146. KHz. It overrides the max frequency defined for the charger.
  147. - qcom,otg-deglitch-time-ms
  148. Usage: optional
  149. Value type: <u32>
  150. Definition: Specifies the deglitch interval for OTG detection.
  151. If the value is not present, 50 msec is used as default.
  152. - qcom,step-charging-enable
  153. Usage: optional
  154. Value type: bool
  155. Definition: Boolean flag which when present enables step-charging.
  156. - qcom,wd-bark-time-secs
  157. Usage: optional
  158. Value type: <u32>
  159. Definition: WD bark-timeout in seconds. The possible values are
  160. 16, 32, 64, 128. If not defined it defaults to 64.
  161. - qcom,sw-jeita-enable
  162. Usage: optional
  163. Value type: bool
  164. Definition: Boolean flag which when present enables sw compensation for jeita
  165. - qcom,battery-data
  166. Usage: optional
  167. Value type: <u32>
  168. Definition: Specifies the phandle of the node which contains the battery
  169. profiles supported on the device. This is only specified
  170. when step charging and sw-jeita configurations are desired
  171. to be get from these properties defined in battery profile:
  172. qcom,step-chg-ranges, qcom,jeita-fcc-ranges, qcom,jeita-fv-ranges.
  173. =============================================
  174. Second Level Nodes - SMB2 Charger Peripherals
  175. =============================================
  176. Peripheral specific properties:
  177. - reg
  178. Usage: required
  179. Value type: <prop-encoded-array>
  180. Definition: Address and size of the peripheral's register block.
  181. - interrupts
  182. Usage: required
  183. Value type: <prop-encoded-array>
  184. Definition: Peripheral interrupt specifier.
  185. - interrupt-names
  186. Usage: required
  187. Value type: <stringlist>
  188. Definition: Interrupt names. This list must match up 1-to-1 with the
  189. interrupts specified in the 'interrupts' property.
  190. =======
  191. Example
  192. =======
  193. pmi8998_charger: qcom,qpnp-smb2 {
  194. compatible = "qcom,qpnp-smb2";
  195. #address-cells = <1>;
  196. #size-cells = <1>;
  197. io-channels = <&pmic_rradc 0>;
  198. io-channel-names = "rradc_batt_id";
  199. dpdm-supply = <&qusb_phy0>;
  200. qcom,chgr@1000 {
  201. reg = <0x1000 0x100>;
  202. interrupts = <0x2 0x10 0x0 IRQ_TYPE_NONE>,
  203. <0x2 0x10 0x1 IRQ_TYPE_NONE>,
  204. <0x2 0x10 0x2 IRQ_TYPE_NONE>,
  205. <0x2 0x10 0x3 IRQ_TYPE_NONE>,
  206. <0x2 0x10 0x4 IRQ_TYPE_NONE>;
  207. interrupt-names = "chg-error",
  208. "chg-state-change",
  209. "step-chg-state-change",
  210. "step-chg-soc-update-fail",
  211. "step-chg-soc-update-request";
  212. };
  213. qcom,otg@1100 {
  214. reg = <0x1100 0x100>;
  215. interrupts = <0x2 0x11 0x0 IRQ_TYPE_NONE>,
  216. <0x2 0x11 0x1 IRQ_TYPE_NONE>,
  217. <0x2 0x11 0x2 IRQ_TYPE_NONE>,
  218. <0x2 0x11 0x3 IRQ_TYPE_NONE>;
  219. interrupt-names = "otg-fail",
  220. "otg-overcurrent",
  221. "otg-oc-dis-sw-sts",
  222. "testmode-change-detect";
  223. };
  224. qcom,bat-if@1200 {
  225. reg = <0x1200 0x100>;
  226. interrupts = <0x2 0x12 0x0 IRQ_TYPE_NONE>,
  227. <0x2 0x12 0x1 IRQ_TYPE_NONE>,
  228. <0x2 0x12 0x2 IRQ_TYPE_NONE>,
  229. <0x2 0x12 0x3 IRQ_TYPE_NONE>,
  230. <0x2 0x12 0x4 IRQ_TYPE_NONE>,
  231. <0x2 0x12 0x5 IRQ_TYPE_NONE>;
  232. interrupt-names = "bat-temp",
  233. "bat-ocp",
  234. "bat-ov",
  235. "bat-low",
  236. "bat-therm-or-id-missing",
  237. "bat-terminal-missing";
  238. };
  239. qcom,usb-chgpth@1300 {
  240. reg = <0x1300 0x100>;
  241. interrupts = <0x2 0x13 0x0 IRQ_TYPE_NONE>,
  242. <0x2 0x13 0x1 IRQ_TYPE_NONE>,
  243. <0x2 0x13 0x2 IRQ_TYPE_NONE>,
  244. <0x2 0x13 0x3 IRQ_TYPE_NONE>,
  245. <0x2 0x13 0x4 IRQ_TYPE_NONE>,
  246. <0x2 0x13 0x5 IRQ_TYPE_NONE>,
  247. <0x2 0x13 0x6 IRQ_TYPE_NONE>,
  248. <0x2 0x13 0x7 IRQ_TYPE_NONE>;
  249. interrupt-names = "usbin-collapse",
  250. "usbin-lt-3p6v",
  251. "usbin-uv",
  252. "usbin-ov",
  253. "usbin-plugin",
  254. "usbin-src-change",
  255. "usbin-icl-change",
  256. "type-c-change";
  257. };
  258. qcom,dc-chgpth@1400 {
  259. reg = <0x1400 0x100>;
  260. interrupts = <0x2 0x14 0x0 IRQ_TYPE_NONE>,
  261. <0x2 0x14 0x1 IRQ_TYPE_NONE>,
  262. <0x2 0x14 0x2 IRQ_TYPE_NONE>,
  263. <0x2 0x14 0x3 IRQ_TYPE_NONE>,
  264. <0x2 0x14 0x4 IRQ_TYPE_NONE>,
  265. <0x2 0x14 0x5 IRQ_TYPE_NONE>,
  266. <0x2 0x14 0x6 IRQ_TYPE_NONE>;
  267. interrupt-names = "dcin-collapse",
  268. "dcin-lt-3p6v",
  269. "dcin-uv",
  270. "dcin-ov",
  271. "dcin-plugin",
  272. "div2-en-dg",
  273. "dcin-icl-change";
  274. };
  275. qcom,chgr-misc@1600 {
  276. reg = <0x1600 0x100>;
  277. interrupts = <0x2 0x16 0x0 IRQ_TYPE_NONE>,
  278. <0x2 0x16 0x1 IRQ_TYPE_NONE>,
  279. <0x2 0x16 0x2 IRQ_TYPE_NONE>,
  280. <0x2 0x16 0x3 IRQ_TYPE_NONE>,
  281. <0x2 0x16 0x4 IRQ_TYPE_NONE>,
  282. <0x2 0x16 0x5 IRQ_TYPE_NONE>,
  283. <0x2 0x16 0x6 IRQ_TYPE_NONE>,
  284. <0x2 0x16 0x7 IRQ_TYPE_NONE>;
  285. interrupt-names = "wdog-snarl",
  286. "wdog-bark",
  287. "aicl-fail",
  288. "aicl-done",
  289. "high-duty-cycle",
  290. "input-current-limiting",
  291. "temperature-change",
  292. "switcher-power-ok";
  293. };
  294. };