/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
- QTI's QPNP PMIC Fuel Gauge Device
- QPNP PMIC FG provides interface to clients to read properties related
- to the battery. Its main function is to retrieve the State of Charge (SOC),
- a 0-100 percentage representing the amount of charge left in the battery.
- There are two required peripherals in the FG driver, both implemented as
- subnodes in the example. These peripherals must not be disabled if the FG
- device is to enabled:
- - qcom,fg-soc : The main FG device. Supports battery fuel gauge controls and
- sensors.
- - qcom,fg-batt : The FG battery device supports interrupts and controls with
- respect to the state of the connected battery.For example: the
- peripheral informs the driver if the battery has been identified
- by the fuel gauge based on a given battery resistance range.
- Optionally ADC nodes can be added
- - qcom,fg-adc-vbat : A subnode with a register address for the FG_ADC_USR
- peripheral which is used mainly for battery current limiting (BCL).
- This node maps out the VBAT reading register which allows to have
- a +/- 32 mV accurate reading of VBAT.
- - qcom,fg-adc-ibat : A subnode with a register address for the FG_ADC_USR
- peripheral which is used mainly for battery current limiting (BCL).
- This node maps out the IBAT current reading register which allows
- to have a +/- 32 mA accurate reading of IBAT.
- Parent node required properties:
- - compatible : should be "qcom,qpnp-fg" for the FG driver.
- Parent node optional properties:
- - qcom,warm-bat-decidegc: Warm battery temperature in decidegC.
- - qcom,cool-bat-decidegc: Cool battery temperature in decidegC.
- - qcom,hot-bat-decidegc: Hot battery temperature in decidegC.
- - qcom,cold-bat-decidegc: Cold battery temperature in decidegC.
- - qcom,ext-sense-type: Current sense channel used by the FG.
- Set this to use external rsense.
- - qcom,thermal-coefficients: Byte array of thermal coefficients for
- reading battery thermistor. This should
- be exactly 6 bytes in length.
- Example: [01 02 03 04 05 06]
- - qcom,resume-soc: soc to resume charging in percentage.
- - qcom,use-otp-profile: Specify this flag to avoid RAM loading
- any battery profile.
- qcom,fg-soc node required properties:
- - reg : offset and length of the PMIC peripheral register map.
- - interrupts : the interrupt mappings.
- The format should be
- <slave-id peripheral-id interrupt-number>.
- - interrupt-names : names for the mapped fg soc interrupts
- The following interrupts are required:
- 0: high-soc
- 1: low-soc
- 2: full-soc
- 3: empty-soc
- 4: delta-soc
- 5: first-est-done
- 6: sw-fallbk-ocv
- 7: sw-fallbk-new-battrt-sts
- qcom,fg-memif node required properties:
- - reg : offset and length of the PMIC peripheral register map.
- - interrupts : the interrupt mappings.
- The format should be
- <slave-id peripheral-id interrupt-number>.
- - interrupt-names : names for the mapped fg adc interrupts
- The following interrupts are required:
- 0: mem-avail
- Example:
- pmi8994_fg: qcom,fg {
- spmi-dev-container;
- compatible = "qcom,qpnp-fg";
- #address-cells = <1>;
- #size-cells = <1>;
- status = "disabled";
- qcom,fg-soc@4000 {
- reg = <0x4000 0x100>;
- interrupts = <0x2 0x40 0x0>,
- <0x2 0x40 0x1>,
- <0x2 0x40 0x2>,
- <0x2 0x40 0x3>,
- <0x2 0x40 0x4>,
- <0x2 0x40 0x5>,
- <0x2 0x40 0x6>,
- <0x2 0x40 0x7>;
- interrupt-names = "high-soc",
- "low-soc",
- "full-soc",
- "empty-soc",
- "delta-soc",
- "first-est-done",
- "sw-fallbk-ocv",
- "sw-fallbk-new-battrt-sts",
- "fg-soc-irq-count";
- };
- qcom,fg-batt@4100 {
- reg = <0x4100 0x100>;
- interrupts = <0x2 0x41 0x0>,
- <0x2 0x41 0x1>,
- <0x2 0x41 0x2>,
- <0x2 0x41 0x3>,
- <0x2 0x41 0x4>,
- <0x2 0x41 0x5>,
- <0x2 0x41 0x6>,
- <0x2 0x41 0x7>;
- interrupt-names = "soft-cold",
- "soft-hot",
- "vbatt-low",
- "batt-ided",
- "batt-id-req",
- "batt-unknown",
- "batt-missing",
- "batt-match";
- };
- qcom,fg-adc-vbat@4254 {
- reg = <0x4254 0x1>;
- };
- qcom,fg-adc-ibat@4255 {
- reg = <0x4255 0x1>;
- };
- qcom,fg-memif@4400 {
- reg = <0x4400 0x100>;
- interrupts = <0x2 0x44 0x0>,
- <0x2 0x44 0x1>;
- interrupt-names = "mem-avail",
- "data-rcvry-sug";
- };
- };