Skip to content

Commit bded860

Browse files
macromorgansre
authored andcommitted
power: supply: rk817: stop updating info in suspend
The driver has a thread that checks the battery every 8 seconds. Stop this thread during device suspend as while the device is suspended not all values seem to be read correctly (such as battery voltage). The resume function triggers the thread to start again. Signed-off-by: Chris Morgan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent c46a9ee commit bded860

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/power/supply/rk817_charger.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,15 @@ static int rk817_charger_probe(struct platform_device *pdev)
12021202
return 0;
12031203
}
12041204

1205+
static int __maybe_unused rk817_suspend(struct device *dev)
1206+
{
1207+
struct rk817_charger *charger = dev_get_drvdata(dev);
1208+
1209+
cancel_delayed_work_sync(&charger->work);
1210+
1211+
return 0;
1212+
}
1213+
12051214
static int __maybe_unused rk817_resume(struct device *dev)
12061215
{
12071216

@@ -1213,7 +1222,7 @@ static int __maybe_unused rk817_resume(struct device *dev)
12131222
return 0;
12141223
}
12151224

1216-
static SIMPLE_DEV_PM_OPS(rk817_charger_pm, NULL, rk817_resume);
1225+
static SIMPLE_DEV_PM_OPS(rk817_charger_pm, rk817_suspend, rk817_resume);
12171226

12181227
static struct platform_driver rk817_charger_driver = {
12191228
.probe = rk817_charger_probe,

0 commit comments

Comments
 (0)