@@ -267,7 +267,22 @@ static int dw_i2c_resume(struct device *dev)
}
#endif
-static SIMPLE_DEV_PM_OPS(dw_i2c_dev_pm_ops, dw_i2c_suspend, dw_i2c_resume);
+#ifdef CONFIG_PM_RUNTIME
+static int dw_i2c_runtime_idle(struct device *dev)
+{
+ /*
+ * Always schedule autosuspend regardless of what runtime PM the
+ * client devices use.
+ */
+ pm_runtime_autosuspend(dev);
+ return -EBUSY;
+}
+#endif
+
+static const struct dev_pm_ops dw_i2c_dev_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(dw_i2c_suspend, dw_i2c_resume)
+ SET_RUNTIME_PM_OPS(NULL, NULL, dw_i2c_runtime_idle)
+};
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:i2c_designware");