]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
power: supply: bq27xxx: restrict no-battery detection to bq27000
authorH. Nikolaus Schaller <hns@goldelico.com>
Sat, 23 Aug 2025 10:34:57 +0000 (12:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Sep 2025 08:58:52 +0000 (10:58 +0200)
commit83ca7939cc32b3f14d638959a0db2908b8cb0df0
tree9e4149ff9f11e2b5d6e2443808b1604ac2138a43
parent208c60d86c75042a272f97608389f0843eee3af7
power: supply: bq27xxx: restrict no-battery detection to bq27000

commit 1e451977e1703b6db072719b37cd1b8e250b9cc9 upstream.

There are fuel gauges in the bq27xxx series (e.g. bq27z561) which may in some
cases report 0xff as the value of BQ27XXX_REG_FLAGS that should not be
interpreted as "no battery" like for a disconnected battery with some built
in bq27000 chip.

So restrict the no-battery detection originally introduced by

    commit 3dd843e1c26a ("bq27000: report missing device better.")

to the bq27000.

There is no need to backport further because this was hidden before

commit f16d9fb6cf03 ("power: supply: bq27xxx: Retrieve again when busy")

Fixes: f16d9fb6cf03 ("power: supply: bq27xxx: Retrieve again when busy")
Suggested-by: Jerry Lv <Jerry.Lv@axis.com>
Cc: stable@vger.kernel.org
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Link: https://lore.kernel.org/r/dd979fa6855fd051ee5117016c58daaa05966e24.1755945297.git.hns@goldelico.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/power/supply/bq27xxx_battery.c