]> git.itanic.dy.fi Git - linux-stable/commit
power: supply: bq27xxx: Add cache parameter to bq27xxx_battery_current_and_status()
authorHans de Goede <hdegoede@redhat.com>
Sat, 15 Apr 2023 18:23:35 +0000 (20:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 13:17:25 +0000 (14:17 +0100)
commit9f30c3f6ceb4219d680fe821b1839e3b9a35c813
tree9504d6b1667bb3b43afe1cf227fbe4689fbce883
parentb12faeca0e819ea09051a705fef9df7ea7e9e18c
power: supply: bq27xxx: Add cache parameter to bq27xxx_battery_current_and_status()

commit 35092c5819f8c5acc7bafe3fdbb13d6307c4f5e1 upstream.

Add a cache parameter to bq27xxx_battery_current_and_status() so that
it can optionally use cached flags instead of re-reading them itself.

This is a preparation patch for making bq27xxx_battery_update() check
the status and have it call power_supply_changed() on status changes.

Fixes: 297a533b3e62 ("bq27x00: Cache battery registers")
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/bq27xxx_battery.c