summaryrefslogtreecommitdiff
path: root/drivers/power/supply/ab8500_chargalg.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2022-01-29 01:49:16 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2022-02-11 20:24:53 +0100
commitd662a7df36e1edc65eaf166ec1c8527ce9d088ea (patch)
treebbb46e0c8ad140ef166d7704081662de78e3227f /drivers/power/supply/ab8500_chargalg.c
parentd58964be64f3bfc21fe8054dadbf4592cdd4e9c1 (diff)
power: supply: ab8500: Swap max and overvoltage
We should terminate charging when we reach the voltage_max_design_uv not overvoltage_limit_uv, this is an abuse of that struct member. The overvoltage limit is actually not configurable on the AB8500, it is fixed to 4.75 V so drop a comment about that in the code. Fixes: 2a5f41830aad ("power: supply: ab8500: Standardize voltages") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply/ab8500_chargalg.c')
-rw-r--r--drivers/power/supply/ab8500_chargalg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/ab8500_chargalg.c b/drivers/power/supply/ab8500_chargalg.c
index c4a2fe07126c..bcf85ae6828e 100644
--- a/drivers/power/supply/ab8500_chargalg.c
+++ b/drivers/power/supply/ab8500_chargalg.c
@@ -802,7 +802,7 @@ static void ab8500_chargalg_end_of_charge(struct ab8500_chargalg *di)
if (di->charge_status == POWER_SUPPLY_STATUS_CHARGING &&
di->charge_state == STATE_NORMAL &&
!di->maintenance_chg && (di->batt_data.volt_uv >=
- di->bm->bi->overvoltage_limit_uv ||
+ di->bm->bi->voltage_max_design_uv ||
di->events.usb_cv_active || di->events.ac_cv_active) &&
di->batt_data.avg_curr_ua <
di->bm->bi->charge_term_current_ua &&