]> git.baikalelectronics.ru Git - kernel.git/commit
power/supply: ingenic-battery: Don't change scale if there's only one
authorPaul Cercueil <paul@crapouillou.net>
Sat, 16 Nov 2019 13:56:19 +0000 (14:56 +0100)
committerSebastian Reichel <sre@kernel.org>
Thu, 19 Dec 2019 00:07:53 +0000 (01:07 +0100)
commitdecfc95a5c981b1bc533b3d57e95ff7180b8609d
tree38cff080e190c68500cf55a9816a42267ed08abf
parent23ddcbbaa8cf0e251539bc8a8e8d39af494f0daa
power/supply: ingenic-battery: Don't change scale if there's only one

The ADC in the JZ4740 can work either in high-precision mode with a 2.5V
range, or in low-precision mode with a 7.5V range. The code in place in
this driver will select the proper scale according to the maximum
voltage of the battery.

The JZ4770 however only has one mode, with a 6.6V range. If only one
scale is available, there's no need to change it (and nothing to change
it to), and trying to do so will fail with -EINVAL.

Fixes: 3fe47302756e ("power: supply: add Ingenic JZ47xx battery driver.")
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Acked-by: Artur Rojek <contact@artur-rojek.eu>
Cc: stable@vger.kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ingenic-battery.c