power: supply: axp288_fuel_gauge: Fix full status reporting
authorHans de Goede <hdegoede@redhat.com>
Thu, 15 Feb 2018 14:00:36 +0000 (15:00 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.co.uk>
Fri, 9 Mar 2018 17:02:20 +0000 (18:02 +0100)
commitf451655c722b6f8a15d152d7912ab8526a3fe8bd
tree6d1d10364588265f0edca8afea71154a8cb4c998
parent7638eb5666eb3c216dfdef63b573933ed9740676
power: supply: axp288_fuel_gauge: Fix full status reporting

Commit 2b5a4b4bf222 ("power: supply: axp288_fuel_gauge: Rework
get_status()"), switched from 0A current detection to using the capacity
register for full detection.

It turns out this fixes full reporting on some devices which keep trickle
charging long after the capacity register reach 100%, but breaks it on
some other devices where the charger stops charging before the capacity
register reaches 100%. This commit fixes this by also checking for
0A current when the reported capacity is above 90%.

Fixes: 2b5a4b4bf222 ("psy: axp288_fuel_gauge: Rework get_status()")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
drivers/power/supply/axp288_fuel_gauge.c