Loading Documentation/devicetree/bindings/power/supply/qcom/qpnp-fg-gen4.txt +7 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,13 @@ First Level Node - FG Gen4 device decrease when the battery SOC is low but not converging to zero with battery voltage dropping rapidly below Vcutoff. - qcom,five-pin-battery Usage: optional Value type: <empty> Definition: A boolean property that when specified indicates that a five pin battery is used. Based on this, time to full calculations would use the Rbatt calculated properly. ========================================================== Second Level Nodes - Peripherals managed by FG Gen4 driver ========================================================== Loading arch/arm64/boot/dts/qcom/sm8150-mtp.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -305,6 +305,7 @@ qcom,battery-data = <&mtp_batterydata>; qcom,hold-soc-while-full; qcom,linearize-soc; qcom,five-pin-battery; /* ESR fast calibration */ qcom,fg-esr-timer-chg-fast = <0 7>; qcom,fg-esr-timer-dischg-fast = <0 7>; Loading arch/arm64/boot/dts/qcom/sm8150-qrd.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ qcom,battery-data = <&qrd_batterydata>; qcom,hold-soc-while-full; qcom,linearize-soc; qcom,five-pin-battery; /* ESR fast calibration */ qcom,fg-esr-timer-chg-fast = <0 7>; qcom,fg-esr-timer-dischg-fast = <0 7>; Loading drivers/power/supply/qcom/fg-core.h +4 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,8 @@ enum fg_sram_param_id { FG_SRAM_MONOTONIC_SOC, FG_SRAM_VOLTAGE_PRED, FG_SRAM_OCV, FG_SRAM_VBAT_FINAL, FG_SRAM_IBAT_FINAL, FG_SRAM_ESR, FG_SRAM_ESR_MDL, FG_SRAM_ESR_ACT, Loading Loading @@ -491,6 +493,8 @@ struct fg_dbgfs { extern int fg_decode_voltage_15b(struct fg_sram_param *sp, enum fg_sram_param_id id, int val); extern int fg_decode_current_16b(struct fg_sram_param *sp, enum fg_sram_param_id id, int val); extern int fg_decode_cc_soc(struct fg_sram_param *sp, enum fg_sram_param_id id, int value); extern int fg_decode_value_16b(struct fg_sram_param *sp, Loading drivers/power/supply/qcom/fg-util.c +10 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,16 @@ int fg_decode_voltage_15b(struct fg_sram_param *sp, return sp[id].value; } int fg_decode_current_16b(struct fg_sram_param *sp, enum fg_sram_param_id id, int value) { value = sign_extend32(value, 15); sp[id].value = div_s64((s64)value * sp[id].denmtr, sp[id].numrtr); pr_debug("id: %d raw value: %x decoded value: %d\n", id, value, sp[id].value); return sp[id].value; } int fg_decode_cc_soc(struct fg_sram_param *sp, enum fg_sram_param_id id, int value) { Loading Loading
Documentation/devicetree/bindings/power/supply/qcom/qpnp-fg-gen4.txt +7 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,13 @@ First Level Node - FG Gen4 device decrease when the battery SOC is low but not converging to zero with battery voltage dropping rapidly below Vcutoff. - qcom,five-pin-battery Usage: optional Value type: <empty> Definition: A boolean property that when specified indicates that a five pin battery is used. Based on this, time to full calculations would use the Rbatt calculated properly. ========================================================== Second Level Nodes - Peripherals managed by FG Gen4 driver ========================================================== Loading
arch/arm64/boot/dts/qcom/sm8150-mtp.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -305,6 +305,7 @@ qcom,battery-data = <&mtp_batterydata>; qcom,hold-soc-while-full; qcom,linearize-soc; qcom,five-pin-battery; /* ESR fast calibration */ qcom,fg-esr-timer-chg-fast = <0 7>; qcom,fg-esr-timer-dischg-fast = <0 7>; Loading
arch/arm64/boot/dts/qcom/sm8150-qrd.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ qcom,battery-data = <&qrd_batterydata>; qcom,hold-soc-while-full; qcom,linearize-soc; qcom,five-pin-battery; /* ESR fast calibration */ qcom,fg-esr-timer-chg-fast = <0 7>; qcom,fg-esr-timer-dischg-fast = <0 7>; Loading
drivers/power/supply/qcom/fg-core.h +4 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,8 @@ enum fg_sram_param_id { FG_SRAM_MONOTONIC_SOC, FG_SRAM_VOLTAGE_PRED, FG_SRAM_OCV, FG_SRAM_VBAT_FINAL, FG_SRAM_IBAT_FINAL, FG_SRAM_ESR, FG_SRAM_ESR_MDL, FG_SRAM_ESR_ACT, Loading Loading @@ -491,6 +493,8 @@ struct fg_dbgfs { extern int fg_decode_voltage_15b(struct fg_sram_param *sp, enum fg_sram_param_id id, int val); extern int fg_decode_current_16b(struct fg_sram_param *sp, enum fg_sram_param_id id, int val); extern int fg_decode_cc_soc(struct fg_sram_param *sp, enum fg_sram_param_id id, int value); extern int fg_decode_value_16b(struct fg_sram_param *sp, Loading
drivers/power/supply/qcom/fg-util.c +10 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,16 @@ int fg_decode_voltage_15b(struct fg_sram_param *sp, return sp[id].value; } int fg_decode_current_16b(struct fg_sram_param *sp, enum fg_sram_param_id id, int value) { value = sign_extend32(value, 15); sp[id].value = div_s64((s64)value * sp[id].denmtr, sp[id].numrtr); pr_debug("id: %d raw value: %x decoded value: %d\n", id, value, sp[id].value); return sp[id].value; } int fg_decode_cc_soc(struct fg_sram_param *sp, enum fg_sram_param_id id, int value) { Loading