Skip to content

Commit 69a1874

Browse files
mergemchehab
authored andcommitted
media: i2c: hi846: use pm_runtime_force_suspend/resume for system suspend
In cases like this when controlling regulators and clocks the suspend() and resume() functions are meant to be called balanced toggling the behaviour. It's wrong to use the same suspend function for runtime and system suspend in this case and leads to errors like [ 77.718890] Failed to disable vddd: -EIO Use pm_runtime_force_* helpers in order to support system suspend properly when runtime pm is already implemented and fix this. Signed-off-by: Martin Kepplinger <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent e1cc0a0 commit 69a1874

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/media/i2c/hi846.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2162,7 +2162,11 @@ static int hi846_remove(struct i2c_client *client)
21622162
return 0;
21632163
}
21642164

2165-
static UNIVERSAL_DEV_PM_OPS(hi846_pm_ops, hi846_suspend, hi846_resume, NULL);
2165+
static const struct dev_pm_ops hi846_pm_ops = {
2166+
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
2167+
pm_runtime_force_resume)
2168+
SET_RUNTIME_PM_OPS(hi846_suspend, hi846_resume, NULL)
2169+
};
21662170

21672171
static const struct of_device_id hi846_of_match[] = {
21682172
{ .compatible = "hynix,hi846", },

0 commit comments

Comments
 (0)