Re: [PATCH 1/3] power: supply: bq27xxx: report discharging at zero current without a charger
From: Michael Auer
Date: Sat Nov 21 2026 - 16:33:55 EST
Hi,
A sashiko review of this series (not mailed to the list) found a
problem in this patch that I can confirm:
power_supply_is_system_supplied() also counts this battery, so on a
board whose charger is not registered in Linux it returns 0. A full
battery on such a charger at zero current would then report
Discharging instead of Not charging, the case that commit c3a6d6a1dfc8
("power: supply: bq27xxx: make status more robust") fixed.
For v2 I plan to use power_supply_am_i_supplied(di->bat) instead. It
returns -ENODEV when no supplier is linked, so those boards keep Not
charging, and it does not read this battery, so the check can also run
in the cached update. On the OnePlus 6 this needs the gauge linked to
the charger in the DT (power-supplies), which I would send as a
separate patch.
Patch 3/3 needs a fix too: its status fallback returns the status of
the cached update, which has the same zero current problem, and which
is never set on BQ27XXX_O_ZERO gauges.
If you prefer another way, please tell me before v2.
Michael