Skip to content
Commit a1d58baa authored by Paul Cercueil's avatar Paul Cercueil Committed by Greg Kroah-Hartman
Browse files

power/supply: ingenic-battery: Don't change scale if there's only one

commit 86b9182d upstream.

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: fb24ccfb

 ("power: supply: add Ingenic JZ47xx battery driver.")

Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Acked-by: default avatarArtur Rojek <contact@artur-rojek.eu>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3a9c7789
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