]> git.ipfire.org Git - thirdparty/linux.git/commit
power: supply: max17042: time to empty is meaningless when charging
authorAndré Draszik <andre.draszik@linaro.org>
Mon, 2 Mar 2026 13:32:06 +0000 (13:32 +0000)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Tue, 3 Mar 2026 22:58:07 +0000 (23:58 +0100)
commit0c5a6dc85d739c41f5240fd149f42f26f0665aab
treed6d31a78804cc1d8fa9202c7d08eb0a48684ac38
parent9a44949da669708f19d29141e65b3ac774d08f5a
power: supply: max17042: time to empty is meaningless when charging

When charging, the fuel gauge reports U16_MAX as time to empty.
Ignoring this special case (as this driver currently does), causes the
remaining time to be reported as ~102hours, which is incorrect.

Update the code to not return anything in this case.

Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260302-max77759-fg-v3-7-3c5f01dbda23@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/max17042_battery.c