qpnp-linear-charger.txt 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. Qualcomm QPNP Linear Charger
  2. The charger module supports the linear battery charger peripherals on
  3. Qualcomm PMIC chips.
  4. There are four different peripherals in the charger module.
  5. Each of these peripherals are implemented as subnodes.
  6. - qcom,chgr: Supports charging control and status reporting
  7. - qcom,bat-if: Battery status reporting such as presence and
  8. temperature reporting.
  9. - qcom,usb-chgpth: USB charge path detection and input current
  10. limiting configuration.
  11. - qcom,chg-misc: Miscellaneous features such as comparator override
  12. features etc.
  13. Parent node required properties:
  14. - qcom,vddmax-mv: Target voltage of battery in mV.
  15. - qcom,vddsafe-mv: Maximum Vdd voltage in mV.
  16. - qcom,vinmin-mv: Minimum input voltage in mV.
  17. - qcom,ibatsafe-ma: Safety battery current setting
  18. Parent node optional properties:
  19. - qcom,vbatweak-uv: Weak battery voltage threshold in uV,
  20. above which fast charging can start.
  21. The supported voltage range is from
  22. 3000000uV to 3581250uV with a step
  23. size of 18750000 uV.
  24. - qcom,charging-disabled: Set this property to disable charging
  25. by default.
  26. - qcom,use-default-batt-values: Set this flag to force reporting of
  27. fake battery.
  28. - qcom,warm-bat-decidegc: Warm battery temperature in decidegC.
  29. - qcom,cool-bat-decidegc: Cool battery temperature in decidegC.
  30. Note that if both warm and cool
  31. battery temperatures are set, the
  32. corresponding ibatmax and bat-mv
  33. properties are required to be set.
  34. - qcom,ibatmax-cool-ma: Maximum cool battery charge current.
  35. - qcom,ibatmax-warm-ma: Maximum warm battery charge current.
  36. - qcom,warm-bat-mv: Warm temperature battery target
  37. voltage.
  38. - qcom,cool-bat-mv: Cool temperature battery target
  39. voltage.
  40. - qcom,thermal-mitigation: Array of ibatmax values for different
  41. system thermal mitigation level.
  42. - qcom,tchg-mins: Maximum total software initialized
  43. charge time.
  44. - qcom,bpd-detection: Select a battery presence detection
  45. scheme by specifying either "bpd_thm"
  46. "bpd_id" or "bpd_thm_id". "bpd_thm"
  47. selects the temperature pin, "bpd_id"
  48. uses the id pin for battery presence
  49. detection, "bpd_thm_id" selects both.
  50. If the property is not set, the
  51. temperatue pin will be used.
  52. - qcom,btc-disabled: If flag is set battery hot and cold
  53. monitoring is disabled in hardware.
  54. This monitoring is turned on by
  55. default.
  56. - qcom,batt-hot-percentage: Specify a supported hot threshold
  57. percentage.
  58. Supported thresholds: 25% and 35%. If
  59. none is specified hardware defaults
  60. will be used.
  61. - qcom,batt-cold-percentage: Specify a supported cold threshold
  62. percentage. Supported thresholds: 70%
  63. and 80%. If none is specified
  64. hardwaredefaults will be used.
  65. - qcom,chg-adc_tm Corresponding ADC TM device's phandle
  66. to set recurring measurements and
  67. receive notification for batt_therm.
  68. -qcom,float-charge If specified enable float charging.
  69. - qcom,chg-vadc Corresponding VADC device's phandle.
  70. - qcom,charger-detect-eoc If specified charger hardware will
  71. detect end-of-charge.
  72. If not specified charger driver
  73. depends on BMSfor end-of-charge
  74. detection.
  75. - qcom,disable-vbatdet-based-recharge If specified disable VBATDET irq
  76. and charging can only be resumed
  77. if charger is re-inserted or SOC
  78. falls below resume SOC.
  79. This property should always be used
  80. along with the BMS property:
  81. "qcom,disable-suspend-on-usb".
  82. - qcom,use-external-charger If specified the LBC module will
  83. be disabled and the driver will not
  84. register. It also enables BID for
  85. BPD and disables BTC. Declare this node
  86. only if you are using an external charger
  87. and not the PMIC internal LBC.
  88. - qcom,chgr-led-support There is a current sink device in linear
  89. charger module, it is used to control a
  90. led which can act as a charger led as well
  91. as a general notification led.
  92. - qcom,parallel-charger This is a bool property to indicate the
  93. LBC will operate as a secondary charger
  94. in the parallel mode. If this is enabled
  95. the charging operations will be controlled by
  96. the primary-charger.
  97. - qcom,collapsible-chgr-support If specified the collapsible charger feature
  98. will be supported. LBC will disable VIN_MIN
  99. comparator and use chg_gone interrupt to
  100. detect charger removal.
  101. Sub node required structure:
  102. - A qcom,charger node must be a child of an SPMI node that has specified
  103. the spmi-dev-container property. Each subnode reflects
  104. a hardware peripheral which adds a unique set of features
  105. to the collective charging device. For example USB detection
  106. and the battery interface are each separate peripherals and
  107. each should be their own subnode.
  108. Sub node required properties:
  109. - compatible: Must be "qcom,qpnp-linear-charger".
  110. - reg: Specifies the SPMI address and size for this
  111. peripheral.
  112. - interrupts: Specifies the interrupt associated with the
  113. peripheral.
  114. - interrupt-names: Specifies the interrupt names for the peripheral.
  115. Every available interrupt needs to have an associated
  116. name with it to indentify its purpose.
  117. The following lists each subnode and their
  118. corresponding required interrupt names:
  119. qcom,usb-chgpth:
  120. - usbin-valid
  121. The following interrupts are available:
  122. qcom,usb-chgpth:
  123. - usbin-valid: Indicates valid USB
  124. connection.
  125. - coarse-det-usb: Coarse detect interrupt
  126. triggers at low voltage on
  127. USB_IN.
  128. - chg-gone: Triggers on VCHG line.
  129. - overtemp: Triggers on over temperature
  130. condition
  131. qcom,chgr:
  132. - chg-done: Triggers on charge completion.
  133. - chg-failed: Notifies of charge failures.
  134. - fast-chg-on: Notifies of fast charging.
  135. - vbat-det-lo: Triggers on vbat-det-lo
  136. voltage.
  137. Example:
  138. pm8916-chg: qcom,charger {
  139. spmi-dev-container;
  140. compatible = "qcom,qpnp-linear-charger";
  141. #address-cells = <1>;
  142. #size-cells = <1>;
  143. qcom,vddmax-mv = <4200>;
  144. qcom,vddsafe-mv = <4200>;
  145. qcom,vinmin-mv = <4200>;
  146. qcom,ibatsafe-ma = <1440>;
  147. qcom,vbatweak-uv = <3200>;
  148. qcom,thermal-mitigation = <1500 700 600 325>;
  149. qcom,cool-bat-decidegc = <100>;
  150. qcom,warm-bat-decidegc = <450>;
  151. qcom,cool-bat-mv = <4100>;
  152. qcom,ibatmax-warm-ma = <360>;
  153. qcom,ibatmax-cool-ma = <360>;
  154. qcom,warm-bat-mv = <4100>;
  155. qcom,batt-hot-percentage = <25>;
  156. qcom,batt-cold-percentage = <85>;
  157. qcom,tchg-mins = <152>;
  158. qcom,resume-soc = <99>;
  159. qcom,btc-disabled = <0>;
  160. qcom,chg-vadc = <&pm8916_vadc>;
  161. qcom,chgr@1000 {
  162. reg = <0x1000 0x100>;
  163. interrupts = <0x0 0x10 0x7>,
  164. <0x0 0x10 0x6>,
  165. <0x0 0x10 0x5>,
  166. <0x0 0x10 0x0>;
  167. interrupt-names = "chg-done",
  168. "chg-failed",
  169. "fast-chg-on",
  170. "vbat-det-lo";
  171. };
  172. qcom,bat-if@1200 {
  173. reg = <0x1200 0x100>;
  174. interrupts = <0x0 0x12 0x1>,
  175. <0x0 0x12 0x0>;
  176. interrupt-names = "bat-temp-ok",
  177. "batt-pres";
  178. };
  179. qcom,usb-chgpth@1300 {
  180. reg = <0x1300 0x100>;
  181. interrupts = <0 0x13 0x2>,
  182. <0 0x13 0x1>;
  183. interrupt-names = "chg-gone",
  184. "usbin-valid";
  185. };
  186. qcom,chg-misc@1600 {
  187. reg = <0x1600 0x100>;
  188. };
  189. };