android_kernel_motorola_sm6375/drivers/power
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jerry Lv a9f710fc7a power: supply: bq27xxx: Retrieve again when busy
[ Upstream commit f16d9fb6cf03fdbdefa41a8b32ba1e57afb7ae3d ]

Multiple applications may access the battery gauge at the same time, so
the gauge may be busy and EBUSY will be returned. The driver will set a
flag to record the EBUSY state, and this flag will be kept until the next
periodic update. When this flag is set, bq27xxx_battery_get_property()
will just return ENODEV until the flag is updated.

Even if the gauge was busy during the last accessing attempt, returning
ENODEV is not ideal, and can cause confusion in the applications layer.

Instead, retry accessing the I2C to update the flag is as expected, for
the gauge typically recovers from busy state within a few milliseconds.
If still failed to access the gauge, the real error code would be returned
instead of ENODEV (as suggested by Pali Rohár).

Reviewed-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Jerry Lv <Jerry.Lv@axis.com>
Link: https://lore.kernel.org/r/20250415-foo-fix-v2-1-5b45a395e4cc@axis.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-06-27 11:02:53 +01:00
..
avs soc: ti: smartreflex: Use IRQF_NO_AUTOEN flag in request_irq() 2024-12-14 19:44:24 +01:00
reset power: reset: brcmstb: Do not go into infinite loop if reset fails 2024-11-08 16:20:38 +01:00
supply power: supply: bq27xxx: Retrieve again when busy 2025-06-27 11:02:53 +01:00
Kconfig
Makefile