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
This commit is contained in:
Michael Bestas 2025-05-07 08:33:28 +03:00
commit 4a527b3703

View file

@ -1801,13 +1801,13 @@ static ssize_t charging_enabled_store(struct class *c,
if (val) {
/*
* Enable charging, i.e. set the restricted current back to
* its default value and unset the restriction boolean flag.
* the thermal limit and unset the restriction boolean flag.
*/
rc = __battery_psy_set_charge_current(bcdev,
DEFAULT_RESTRICT_FCC_UA);
bcdev->thermal_fcc_ua);
if (rc < 0)
return rc;
bcdev->restrict_fcc_ua = DEFAULT_RESTRICT_FCC_UA;
bcdev->restrict_fcc_ua = bcdev->thermal_fcc_ua;
bcdev->restrict_chg_en = 0;
} else {
/*