power: supply: ab8500: Standardize capacity lookup
authorLinus Walleij <linus.walleij@linaro.org>
Sat, 20 Nov 2021 15:53:26 +0000 (16:53 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Mon, 22 Nov 2021 16:16:26 +0000 (17:16 +0100)
commit0525f34d02758b801619d5e7093003e66a7efe3c
tree0424a2890bdfbf070239eb19bbbd64815578a2e3
parent67acb291f3b6636cc52a3f859c91c05688992a15
power: supply: ab8500: Standardize capacity lookup

The AB8500 charger only has one capacity table with
unspecified temperature, so we assume this capacity is given
for 20 degrees Celsius.

Convert this table to use the OCV (open circuit voltage)
tables in struct power_supply_battery_ocv_table.

In the process, convert the fuel gauge driver to use
microvolts and microamperes so we can use the same internals
as the power supply subsystem without having to multiply
and divide with 1000 in a few places.

Also convert high_curr_threshold and lowbat_threshold to
use microamperes and microvolts as these are closely
related to these changes.

Drop the unused overbat_threshold member in the custom
struct ab8500_fg_parameters.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ab8500-bm.h
drivers/power/supply/ab8500_bmdata.c
drivers/power/supply/ab8500_fg.c