]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: ab8500: Exit maintenance if too low voltage
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 15 Apr 2022 20:36:38 +0000 (22:36 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Thu, 9 Jun 2022 20:10:05 +0000 (22:10 +0200)
commit656a72272fd1219b37f51cbb49a239490efbbf68
tree531042babd79fad3369c52bcf3a5aad04c222888
parent619ba2dd03387f544b4c5b4bcb6c5f2e8706e6b5
power: supply: ab8500: Exit maintenance if too low voltage

The maintenance charging is supposedly designed such that the
maintenance current compensates for the battery discharge curve,
and as the charging progress from CC/CV -> maintenance A ->
maintenance B states, we end up on a reasonable voltage to
restart ordinary CC/CV charging after the safety timer at the
maintenance B state exits.

However: old batteries discharge quicker, and in an old
battery we might not get to the expiration of the maintenance B
timer before the battery is completely depleted and the system
powers off with an empty battery.

This is hardly the desire of anyone leaving their phone in the
charger for a few days!

Introduce a second clause in both maintenance states such that
we exit the state and return to ordinary CC/CV charging if
the voltage drops below charge_restart_voltage_uv or 95%
if this is not defined for the battery.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ab8500_chargalg.c