power: supply: adc-battery-helper: Add support for optional charge_finished GPIO
authorHans de Goede <hansg@kernel.org>
Sun, 31 Aug 2025 12:29:40 +0000 (14:29 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 5 Sep 2025 23:50:01 +0000 (01:50 +0200)
commit926b144366c589a0c0c471d02a71590ed24284e0
tree43610f91708c7575ed06307f508e79cdcfce8aa6
parenteede3f72a9658a3c82725ed36723d3189a91b3e5
power: supply: adc-battery-helper: Add support for optional charge_finished GPIO

Charger ICs often have a status pin which indicates when the charger has
finished charging the battery. Sometimes the status of this pin can be
read over a GPIO.

Add support for optionally reading a charge-finished GPIO and when
available use this to determine when to return POWER_SUPPLY_STATUS_FULL.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250831122942.47875-5-hansg@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/adc-battery-helper.c
drivers/power/supply/adc-battery-helper.h
drivers/power/supply/ug3105_battery.c