diff options
author | Marek Vasut <marex@denx.de> | 2023-11-04 16:49:06 +0100 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2023-11-15 23:13:26 +0100 |
commit | dfcb264a01a9199e8338a548731baf5bbe77ef19 (patch) | |
tree | 0bb9aba3e87e1992d09807d18fed4e25e04884b1 /include | |
parent | 5739da3e16ad0ebe99c31cabe960856b53eaaabe (diff) | |
download | linux-stable-dfcb264a01a9199e8338a548731baf5bbe77ef19.tar.gz linux-stable-dfcb264a01a9199e8338a548731baf5bbe77ef19.tar.bz2 linux-stable-dfcb264a01a9199e8338a548731baf5bbe77ef19.zip |
power: supply: bq27xxx: Stop and start delayed work in suspend and resume
This driver uses delayed work to perform periodic battery state read out.
This delayed work is not stopped across suspend and resume cycle. The
read out can occur early in the resume cycle. In case of an I2C variant
of this hardware, that read out triggers I2C transfer. That I2C transfer
may happen while the I2C controller is still suspended, which produces a
WARNING in the kernel log.
Fix this by introducing trivial PM ops, which stop the delayed work before
the system enters suspend, and schedule the delayed work right after the
system resumes.
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20231104154920.68585-1-marex@denx.de
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/power/bq27xxx_battery.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/power/bq27xxx_battery.h b/include/linux/power/bq27xxx_battery.h index 7c8d65414a70..7d8025fb74b7 100644 --- a/include/linux/power/bq27xxx_battery.h +++ b/include/linux/power/bq27xxx_battery.h @@ -83,5 +83,6 @@ struct bq27xxx_device_info { void bq27xxx_battery_update(struct bq27xxx_device_info *di); int bq27xxx_battery_setup(struct bq27xxx_device_info *di); void bq27xxx_battery_teardown(struct bq27xxx_device_info *di); +extern const struct dev_pm_ops bq27xxx_battery_battery_pm_ops; #endif |