power: supply: ab8500: Standardize temp res lookup
authorLinus Walleij <linus.walleij@linaro.org>
Sat, 20 Nov 2021 15:53:25 +0000 (16:53 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Mon, 22 Nov 2021 16:16:26 +0000 (17:16 +0100)
commit67acb291f3b6636cc52a3f859c91c05688992a15
tree59fa3a78c83cb0715c3e5418619af571fd7f256a
parentbc6e0287140216011b99392fdf687a92707675ad
power: supply: ab8500: Standardize temp res lookup

The lookup from battery temperature to internal resistance was
using its own format. Rewrite this to use the table inside
struct power_supply_battery_info:s resist_table.

The supplied resistance table has to be rewritten to express
the resistance in percent of the factory resistance as a
side effect.

We can then rely on the library function
power_supply_temp2resist_simple() to interpolate the internal
resistance percent from the temperature.

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