power: supply: generic-adc-battery: use simple-battery API
authorSebastian Reichel <sre@kernel.org>
Fri, 17 Mar 2023 22:57:01 +0000 (23:57 +0100)
committerSebastian Reichel <sre@kernel.org>
Wed, 29 Mar 2023 20:38:57 +0000 (22:38 +0200)
commit1b27bf793fd46219c882b8e545ec736cfadc0841
tree3282e1fe0034354d6d6711fd8a97f52c447d4801
parent2f25b9750fa0d79090cadf6e7d0e3edba4fa58e3
power: supply: generic-adc-battery: use simple-battery API

Constant battery data is available through power-supply's simple-battery
API. This works automatically, so the manual handling can be removed
without loosing any feature :)

Note, that the POWER_SUPPLY_STATUS_FULL check for the level variable can
be dropped, since the variable is never written. It can be re-introduced
properly once the driver gets functionality to calculate the current
charge level. Apart from that the check must be done fuzzy anyways,
since charge estimation usually is not precise enough to always return
exactly the full charge capacity for a full battery.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/supply/generic-adc-battery.c
include/linux/power/generic-adc-battery.h [deleted file]