Commit 44263f50 authored by Sebastian Reichel's avatar Sebastian Reichel

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: e60fea79 ("power: battery: Generic battery driver using IIO")
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarMatti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent 93297ef6
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment