linux-stable/include/linux/power
Hans de Goede 939a116142 power: supply: bq27xxx: Ensure power_supply_changed() is called on current sign changes
On gauges where the current register is signed, there is no charging
flag in the flags register. So only checking flags will not result
in power_supply_changed() getting called when e.g. a charger is plugged
in and the current sign changes from negative (discharging) to
positive (charging).

This causes userspace's notion of the status to lag until userspace
does a poll.

And when a power_supply_leds.c LED trigger is used to indicate charging
status with a LED, this LED will lag until the capacity percentage
changes, which may take many minutes (because the LED trigger only is
updated on power_supply_changed() calls).

Fix this by calling bq27xxx_battery_current_and_status() on gauges with
a signed current register and checking if the status has changed.

Fixes: 297a533b3e ("bq27x00: Cache battery registers")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2023-05-08 15:29:12 +02:00
..
bq27xxx_battery.h power: supply: bq27xxx: Ensure power_supply_changed() is called on current sign changes 2023-05-08 15:29:12 +02:00
bq2415x_charger.h
bq24190_charger.h
bq24735-charger.h
bq25890_charger.h power: supply: bq25890: Add support for registering the Vbus boost converter as a regulator 2022-02-01 14:55:12 +01:00
charger-manager.h
gpio-charger.h
jz4740-battery.h
max17042_battery.h
sbs-battery.h
smartreflex.h ARM: omap2: smartreflex: remove on_init control 2023-01-09 17:00:54 +01:00
twl4030_madc_battery.h