]> git.proxmox.com Git - mirror_ubuntu-eoan-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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 13 Mar 2020 04:52:39 +0000 (00:52 -0400)
commitaa75a656277e5d71b14253f4ca502f36910d322a
treea17d0b28317eba8b434200e6011cf7681f5202fe
parent0b736e75ad2e5448db6160db7fd1b9df9f2bb50a
power/supply: ingenic-battery: Don't change scale if there's only one

BugLink: https://bugs.launchpad.net/bugs/1866403
commit 86b9182df8bb12610d4d6feac45a69f3ed57bfd2 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: fb24ccfbe1e0 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/power/supply/ingenic-battery.c