From 4a527b37031ef509d62324138baef7e8a062601f Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Wed, 7 May 2025 08:33:28 +0300 Subject: [PATCH] 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 --- drivers/power/supply/qti_battery_charger.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/power/supply/qti_battery_charger.c b/drivers/power/supply/qti_battery_charger.c index 3f2993698fcc..3ba574ab29d9 100644 --- a/drivers/power/supply/qti_battery_charger.c +++ b/drivers/power/supply/qti_battery_charger.c @@ -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 { /*