power: supply: generic-adc-battery: fix unit scaling

power-supply properties are reported in µV, µA and µW.
The IIO API provides mV, mA, mW, so the values need to
be multiplied by 1000.

Fixes: e60fea794e ("power: battery: Generic battery driver using IIO")
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
This commit is contained in:
Sebastian Reichel 2023-03-17 23:56:57 +01:00
parent 93297ef692
commit 44263f5006
1 changed files with 3 additions and 0 deletions

View File

@ -136,6 +136,9 @@ static int read_channel(struct gab *adc_bat, enum power_supply_property psp,
result);
if (ret < 0)
pr_err("read channel error\n");
else
*result *= 1000;
return ret;
}