Skip to content

Commit

Permalink
media: i2c: hi846: use pm_runtime_force_suspend/resume for system sus…
Browse files Browse the repository at this point in the history
…pend

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]>
  • Loading branch information
merge authored and mchehab committed Dec 16, 2021
1 parent e1cc0a0 commit 69a1874
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/media/i2c/hi846.c
Original file line number Diff line number Diff line change
Expand Up @@ -2162,7 +2162,11 @@ static int hi846_remove(struct i2c_client *client)
return 0;
}

static UNIVERSAL_DEV_PM_OPS(hi846_pm_ops, hi846_suspend, hi846_resume, NULL);
static const struct dev_pm_ops hi846_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume)
SET_RUNTIME_PM_OPS(hi846_suspend, hi846_resume, NULL)
};

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

0 comments on commit 69a1874

Please sign in to comment.