diff mbox series

i2c: qup: use pm runtime func to manage clk

Message ID 20200803080808.28134-1-jun.nie@linaro.org
State New
Headers show
Series i2c: qup: use pm runtime func to manage clk | expand

Commit Message

Jun Nie Aug. 3, 2020, 8:08 a.m. UTC
Use pm runtime callback to manage clock. Otherwise, clock is
enabled in resume without notifying pm rumetime core and result
no gating in next suspend.

Signed-off-by: Jun Nie <jun.nie@linaro.org>

---
 drivers/i2c/busses/i2c-qup.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

-- 
2.17.1
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index fbc04b60cfd1..b447fcbaa3f0 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -1943,15 +1943,13 @@  static int qup_i2c_pm_resume_runtime(struct device *device)
 #ifdef CONFIG_PM_SLEEP
 static int qup_i2c_suspend(struct device *device)
 {
-	if (!pm_runtime_suspended(device))
-		return qup_i2c_pm_suspend_runtime(device);
+	pm_runtime_force_suspend(device);
 	return 0;
 }
 
 static int qup_i2c_resume(struct device *device)
 {
-	qup_i2c_pm_resume_runtime(device);
-	pm_runtime_mark_last_busy(device);
+	pm_runtime_force_resume(device);
 	pm_request_autosuspend(device);
 	return 0;
 }