]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: bq25890: Call power_supply_changed() after updating input current...
authorHans de Goede <hdegoede@redhat.com>
Sat, 15 Apr 2023 18:23:40 +0000 (20:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 13:03:21 +0000 (14:03 +0100)
commit86fd88db207c20b570f677a864e3b4258868f04c
tree7963ee0ee75c35c007f6c1b9bc19849a6e0a1b49
parent3a8afcf2d45d5d3f5a57ea5e547bfebbce927b3d
power: supply: bq25890: Call power_supply_changed() after updating input current or voltage

commit ad3d9c779b1f09f3f3a6fefd07af407c7bc7c9a7 upstream.

The bq25892 model relies on external charger-type detection and once
that is done the bq25890_charger code will update the input current
and if pumpexpress is used also the input voltage.

In this case, when the initial power_supply_changed() call is made
from the interrupt handler, the input settings are 5V/0.5A which
on many devices is not enough power to charge (while the device is on).

On many devices the fuel-gauge relies in its external_power_changed
callback to timely signal userspace about charging <-> discharging
status changes. Add a power_supply_changed() call after updating
the input current or voltage. This allows the fuel-gauge driver
to timely recheck if the battery is charging after the new input
settings have been applied and then it can immediately notify
userspace about this.

Fixes: 2023dd163da2 ("power: supply: bq25890: Support higher charging voltages through Pump Express+ protocol")
Fixes: c79dce5ba4b5 ("power: supply: bq25890: On the bq25892 set the IINLIM based on external charger detection")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/power/supply/bq25890_charger.c