lkml.org 
[lkml]   [2021]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 2/2] media: i2c: hi846: use pm_runtime_force_suspend/resume for system suspend
Date
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 <martin.kepplinger@puri.sm>
---
drivers/media/i2c/hi846.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/hi846.c b/drivers/media/i2c/hi846.c
index ed55c3894284..9bb96754a091 100644
--- a/drivers/media/i2c/hi846.c
+++ b/drivers/media/i2c/hi846.c
@@ -2418,7 +2418,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", },
--
2.30.2
\
 
 \ /
  Last update: 2021-11-09 14:11    [W:0.084 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site