]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: bq24190: Call power_supply_changed() after updating input current
authorHans de Goede <hdegoede@redhat.com>
Sat, 15 Apr 2023 18:23:41 +0000 (20:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 13:03:22 +0000 (14:03 +0100)
commit2ba667422f9382cfb49b3c847ac7e3a90e226a28
tree3c11a1baa91c132f82f933b0f664d91f75cee2ac
parent86fd88db207c20b570f677a864e3b4258868f04c
power: supply: bq24190: Call power_supply_changed() after updating input current

commit 77c2a3097d7029441e8a91aa0de1b4e5464593da upstream.

The bq24192 model relies on external charger-type detection and once
that is done the bq24190_charger code will update the input current.

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. This allows the fuel-gauge driver to timely recheck
if the battery is charging after the new input current has been applied
and then it can immediately notify userspace about this.

Fixes: 4844e773c5ee ("power: supply: bq24190_charger: Get input_current_limit from our supplier")
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/bq24190_charger.c