Skip to content

Commit 4a527b3

Browse files
committed
power: supply: qti_battery_charger: Fix charging_enabled node disabled state
The previous logic was flawed, since it was limiting charge to 1A when charging control was disabled. Default to thermal limit to mimic what restrict_chg node does. Change-Id: I18fb4f18ade276b561171f3217ddafa0e48a4555
1 parent 801da2a commit 4a527b3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/power/supply/qti_battery_charger.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,13 +1801,13 @@ static ssize_t charging_enabled_store(struct class *c,
18011801
if (val) {
18021802
/*
18031803
* Enable charging, i.e. set the restricted current back to
1804-
* its default value and unset the restriction boolean flag.
1804+
* the thermal limit and unset the restriction boolean flag.
18051805
*/
18061806
rc = __battery_psy_set_charge_current(bcdev,
1807-
DEFAULT_RESTRICT_FCC_UA);
1807+
bcdev->thermal_fcc_ua);
18081808
if (rc < 0)
18091809
return rc;
1810-
bcdev->restrict_fcc_ua = DEFAULT_RESTRICT_FCC_UA;
1810+
bcdev->restrict_fcc_ua = bcdev->thermal_fcc_ua;
18111811
bcdev->restrict_chg_en = 0;
18121812
} else {
18131813
/*

0 commit comments

Comments
 (0)