|
@@ -882,9 +882,8 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg)
|
|
return IRQ_HANDLED;
|
|
return IRQ_HANDLED;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-#ifdef CONFIG_PM
|
|
|
|
-static int nmk_i2c_suspend(struct device *dev)
|
|
|
|
|
|
+#ifdef CONFIG_PM_SLEEP
|
|
|
|
+static int nmk_i2c_suspend_late(struct device *dev)
|
|
{
|
|
{
|
|
struct amba_device *adev = to_amba_device(dev);
|
|
struct amba_device *adev = to_amba_device(dev);
|
|
struct nmk_i2c_dev *nmk_i2c = amba_get_drvdata(adev);
|
|
struct nmk_i2c_dev *nmk_i2c = amba_get_drvdata(adev);
|
|
@@ -897,7 +896,7 @@ static int nmk_i2c_suspend(struct device *dev)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static int nmk_i2c_resume(struct device *dev)
|
|
|
|
|
|
+static int nmk_i2c_resume_early(struct device *dev)
|
|
{
|
|
{
|
|
/* First go to the default state */
|
|
/* First go to the default state */
|
|
pinctrl_pm_select_default_state(dev);
|
|
pinctrl_pm_select_default_state(dev);
|
|
@@ -906,9 +905,6 @@ static int nmk_i2c_resume(struct device *dev)
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
-#else
|
|
|
|
-#define nmk_i2c_suspend NULL
|
|
|
|
-#define nmk_i2c_resume NULL
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef CONFIG_PM
|
|
#ifdef CONFIG_PM
|
|
@@ -946,14 +942,8 @@ static int nmk_i2c_runtime_resume(struct device *dev)
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-/*
|
|
|
|
- * We use noirq so that we suspend late and resume before the wakeup interrupt
|
|
|
|
- * to ensure that we do the !pm_runtime_suspended() check in resume before
|
|
|
|
- * there has been a regular pm runtime resume (via pm_runtime_get_sync()).
|
|
|
|
- */
|
|
|
|
static const struct dev_pm_ops nmk_i2c_pm = {
|
|
static const struct dev_pm_ops nmk_i2c_pm = {
|
|
- .suspend_noirq = nmk_i2c_suspend,
|
|
|
|
- .resume_noirq = nmk_i2c_resume,
|
|
|
|
|
|
+ SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early)
|
|
SET_PM_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
|
|
SET_PM_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend,
|
|
nmk_i2c_runtime_resume,
|
|
nmk_i2c_runtime_resume,
|
|
NULL)
|
|
NULL)
|