|
@@ -84,6 +84,7 @@
|
|
|
#include <linux/io.h>
|
|
|
#include <linux/clk.h>
|
|
|
#include <linux/clkdev.h>
|
|
|
+#include <linux/pm_runtime.h>
|
|
|
|
|
|
#include <plat/omap_device.h>
|
|
|
#include <plat/omap_hwmod.h>
|
|
@@ -539,20 +540,34 @@ int omap_early_device_register(struct omap_device *od)
|
|
|
static int _od_runtime_suspend(struct device *dev)
|
|
|
{
|
|
|
struct platform_device *pdev = to_platform_device(dev);
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ ret = pm_generic_runtime_suspend(dev);
|
|
|
+
|
|
|
+ if (!ret)
|
|
|
+ omap_device_idle(pdev);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+}
|
|
|
|
|
|
- return omap_device_idle(pdev);
|
|
|
+static int _od_runtime_idle(struct device *dev)
|
|
|
+{
|
|
|
+ return pm_generic_runtime_idle(dev);
|
|
|
}
|
|
|
|
|
|
static int _od_runtime_resume(struct device *dev)
|
|
|
{
|
|
|
struct platform_device *pdev = to_platform_device(dev);
|
|
|
|
|
|
- return omap_device_enable(pdev);
|
|
|
+ omap_device_enable(pdev);
|
|
|
+
|
|
|
+ return pm_generic_runtime_resume(dev);
|
|
|
}
|
|
|
|
|
|
static struct dev_power_domain omap_device_power_domain = {
|
|
|
.ops = {
|
|
|
.runtime_suspend = _od_runtime_suspend,
|
|
|
+ .runtime_idle = _od_runtime_idle,
|
|
|
.runtime_resume = _od_runtime_resume,
|
|
|
USE_PLATFORM_PM_SLEEP_OPS
|
|
|
}
|