|
@@ -1137,12 +1137,40 @@ omap_i2c_remove(struct platform_device *pdev)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+#ifdef CONFIG_SUSPEND
|
|
|
+static int omap_i2c_suspend(struct device *dev)
|
|
|
+{
|
|
|
+ if (!pm_runtime_suspended(dev))
|
|
|
+ if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_suspend)
|
|
|
+ dev->bus->pm->runtime_suspend(dev);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static int omap_i2c_resume(struct device *dev)
|
|
|
+{
|
|
|
+ if (!pm_runtime_suspended(dev))
|
|
|
+ if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_resume)
|
|
|
+ dev->bus->pm->runtime_resume(dev);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static struct dev_pm_ops omap_i2c_pm_ops = {
|
|
|
+ .suspend = omap_i2c_suspend,
|
|
|
+ .resume = omap_i2c_resume,
|
|
|
+};
|
|
|
+#else
|
|
|
+#define omap_i2c_pm_ops NULL
|
|
|
+#endif
|
|
|
+
|
|
|
static struct platform_driver omap_i2c_driver = {
|
|
|
.probe = omap_i2c_probe,
|
|
|
.remove = omap_i2c_remove,
|
|
|
.driver = {
|
|
|
.name = "omap_i2c",
|
|
|
.owner = THIS_MODULE,
|
|
|
+ .pm = &omap_i2c_pm_ops,
|
|
|
},
|
|
|
};
|
|
|
|