mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
power: supply: generic-adc-battery: fix unit scaling
[ Upstream commit44263f5006
] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c58ea97aa9
commit
3d7c6f2076
1 changed files with 3 additions and 0 deletions
|
@ -135,6 +135,9 @@ static int read_channel(struct gab *adc_bat, enum power_supply_property psp,
|
||||||
result);
|
result);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
pr_err("read channel error\n");
|
pr_err("read channel error\n");
|
||||||
|
else
|
||||||
|
*result *= 1000;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue