]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: generic-adc-battery: fix unit scaling
authorSebastian Reichel <sre@kernel.org>
Fri, 17 Mar 2023 22:56:57 +0000 (23:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:35:51 +0000 (11:35 +0200)
commit3f0baeb6a8c16f3bc78da77ad9708ed5c3025f60
tree6e7a39637eb18a2a948a0e273c9da179c24b3657
parent2384110d6fbf08e2c8a6c3dacfd24e82cb94bb0e
power: supply: generic-adc-battery: fix unit scaling

[ Upstream commit 44263f50065969f2344808388bd589740f026167 ]

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: 67307c2a20c6 ("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>
drivers/power/supply/generic-adc-battery.c