]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
power: supply: cros_charge-control: hide start threshold on v2 cmd
authorThomas Weißschuh <linux@weissschuh.net>
Sun, 8 Dec 2024 14:59:28 +0000 (15:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Jan 2025 09:34:23 +0000 (10:34 +0100)
commitc110095013ad13d5e834e00569682b2936ebb483
treedbfabcefb7ec90d1a23a6a41f16925add65d5aae
parent5792ae1cb1b00ae91ce514d2ec94c2efd954e6ca
power: supply: cros_charge-control: hide start threshold on v2 cmd

commit c28dc9fc24f5fa802d44ef7620a511035bdd803e upstream.

ECs implementing the v2 command will not stop charging when the end
threshold is reached. Instead they will begin discharging until the
start threshold is reached, leading to permanent charge and discharge
cycles. This defeats the point of the charge control mechanism.

Avoid the issue by hiding the start threshold on v2 systems.
Instead on those systems program the EC with start == end which forces
the EC to reach and stay at that level.

v1 does not support thresholds and v3 works correctly,
at least judging from the code.

Reported-by: Thomas Koch <linrunner@gmx.net>
Fixes: c6ed48ef5259 ("power: supply: add ChromeOS EC based charge control driver")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20241208-cros_charge-control-v2-v1-3-8d168d0f08a3@weissschuh.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/power/supply/cros_charge-control.c