mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
power: supply: rk817: query battery properties right after resume
The driver reads battery properties every 8 seconds. In order to prevent problems with wrong property values right after resume, trigger an update of those properties on resuming the system and restart the 8-second interval from there. Signed-off-by: Maximilian Weigand <mweigand@mweigand.net> Link: https://lore.kernel.org/r/20230601-rk817_query_at_resume-v1-1-630b0adefbd9@mweigand.net Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
814755c48f
commit
1769142a14
|
|
@ -1198,11 +1198,24 @@ static int rk817_charger_probe(struct platform_device *pdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused rk817_resume(struct device *dev)
|
||||
{
|
||||
|
||||
struct rk817_charger *charger = dev_get_drvdata(dev);
|
||||
|
||||
/* force an immediate update */
|
||||
mod_delayed_work(system_wq, &charger->work, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(rk817_charger_pm, NULL, rk817_resume);
|
||||
|
||||
static struct platform_driver rk817_charger_driver = {
|
||||
.probe = rk817_charger_probe,
|
||||
.driver = {
|
||||
.name = "rk817-charger",
|
||||
.pm = &rk817_charger_pm,
|
||||
},
|
||||
};
|
||||
module_platform_driver(rk817_charger_driver);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user