/Documentation/devicetree/bindings/power/qpnp-fg.txt

https://gitlab.com/webhaikal/SenseiFerrari · Plain Text · 138 lines · 121 code · 17 blank · 0 comment · 0 complexity · ced79b4ffe9a7c4cf89af00fb9dba371 MD5 · raw file

  1. QTI's QPNP PMIC Fuel Gauge Device
  2. QPNP PMIC FG provides interface to clients to read properties related
  3. to the battery. Its main function is to retrieve the State of Charge (SOC),
  4. a 0-100 percentage representing the amount of charge left in the battery.
  5. There are two required peripherals in the FG driver, both implemented as
  6. subnodes in the example. These peripherals must not be disabled if the FG
  7. device is to enabled:
  8. - qcom,fg-soc : The main FG device. Supports battery fuel gauge controls and
  9. sensors.
  10. - qcom,fg-batt : The FG battery device supports interrupts and controls with
  11. respect to the state of the connected battery.For example: the
  12. peripheral informs the driver if the battery has been identified
  13. by the fuel gauge based on a given battery resistance range.
  14. Optionally ADC nodes can be added
  15. - qcom,fg-adc-vbat : A subnode with a register address for the FG_ADC_USR
  16. peripheral which is used mainly for battery current limiting (BCL).
  17. This node maps out the VBAT reading register which allows to have
  18. a +/- 32 mV accurate reading of VBAT.
  19. - qcom,fg-adc-ibat : A subnode with a register address for the FG_ADC_USR
  20. peripheral which is used mainly for battery current limiting (BCL).
  21. This node maps out the IBAT current reading register which allows
  22. to have a +/- 32 mA accurate reading of IBAT.
  23. Parent node required properties:
  24. - compatible : should be "qcom,qpnp-fg" for the FG driver.
  25. Parent node optional properties:
  26. - qcom,warm-bat-decidegc: Warm battery temperature in decidegC.
  27. - qcom,cool-bat-decidegc: Cool battery temperature in decidegC.
  28. - qcom,hot-bat-decidegc: Hot battery temperature in decidegC.
  29. - qcom,cold-bat-decidegc: Cold battery temperature in decidegC.
  30. - qcom,ext-sense-type: Current sense channel used by the FG.
  31. Set this to use external rsense.
  32. - qcom,thermal-coefficients: Byte array of thermal coefficients for
  33. reading battery thermistor. This should
  34. be exactly 6 bytes in length.
  35. Example: [01 02 03 04 05 06]
  36. - qcom,resume-soc: soc to resume charging in percentage.
  37. - qcom,use-otp-profile: Specify this flag to avoid RAM loading
  38. any battery profile.
  39. qcom,fg-soc node required properties:
  40. - reg : offset and length of the PMIC peripheral register map.
  41. - interrupts : the interrupt mappings.
  42. The format should be
  43. <slave-id peripheral-id interrupt-number>.
  44. - interrupt-names : names for the mapped fg soc interrupts
  45. The following interrupts are required:
  46. 0: high-soc
  47. 1: low-soc
  48. 2: full-soc
  49. 3: empty-soc
  50. 4: delta-soc
  51. 5: first-est-done
  52. 6: sw-fallbk-ocv
  53. 7: sw-fallbk-new-battrt-sts
  54. qcom,fg-memif node required properties:
  55. - reg : offset and length of the PMIC peripheral register map.
  56. - interrupts : the interrupt mappings.
  57. The format should be
  58. <slave-id peripheral-id interrupt-number>.
  59. - interrupt-names : names for the mapped fg adc interrupts
  60. The following interrupts are required:
  61. 0: mem-avail
  62. Example:
  63. pmi8994_fg: qcom,fg {
  64. spmi-dev-container;
  65. compatible = "qcom,qpnp-fg";
  66. #address-cells = <1>;
  67. #size-cells = <1>;
  68. status = "disabled";
  69. qcom,fg-soc@4000 {
  70. reg = <0x4000 0x100>;
  71. interrupts = <0x2 0x40 0x0>,
  72. <0x2 0x40 0x1>,
  73. <0x2 0x40 0x2>,
  74. <0x2 0x40 0x3>,
  75. <0x2 0x40 0x4>,
  76. <0x2 0x40 0x5>,
  77. <0x2 0x40 0x6>,
  78. <0x2 0x40 0x7>;
  79. interrupt-names = "high-soc",
  80. "low-soc",
  81. "full-soc",
  82. "empty-soc",
  83. "delta-soc",
  84. "first-est-done",
  85. "sw-fallbk-ocv",
  86. "sw-fallbk-new-battrt-sts",
  87. "fg-soc-irq-count";
  88. };
  89. qcom,fg-batt@4100 {
  90. reg = <0x4100 0x100>;
  91. interrupts = <0x2 0x41 0x0>,
  92. <0x2 0x41 0x1>,
  93. <0x2 0x41 0x2>,
  94. <0x2 0x41 0x3>,
  95. <0x2 0x41 0x4>,
  96. <0x2 0x41 0x5>,
  97. <0x2 0x41 0x6>,
  98. <0x2 0x41 0x7>;
  99. interrupt-names = "soft-cold",
  100. "soft-hot",
  101. "vbatt-low",
  102. "batt-ided",
  103. "batt-id-req",
  104. "batt-unknown",
  105. "batt-missing",
  106. "batt-match";
  107. };
  108. qcom,fg-adc-vbat@4254 {
  109. reg = <0x4254 0x1>;
  110. };
  111. qcom,fg-adc-ibat@4255 {
  112. reg = <0x4255 0x1>;
  113. };
  114. qcom,fg-memif@4400 {
  115. reg = <0x4400 0x100>;
  116. interrupts = <0x2 0x44 0x0>,
  117. <0x2 0x44 0x1>;
  118. interrupt-names = "mem-avail",
  119. "data-rcvry-sug";
  120. };
  121. };