diff options
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index a37b8eb65b76..49fc0df0c21f 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c | |||
@@ -84,6 +84,7 @@ | |||
84 | #include <linux/io.h> | 84 | #include <linux/io.h> |
85 | #include <linux/clk.h> | 85 | #include <linux/clk.h> |
86 | #include <linux/clkdev.h> | 86 | #include <linux/clkdev.h> |
87 | #include <linux/pm_runtime.h> | ||
87 | 88 | ||
88 | #include <plat/omap_device.h> | 89 | #include <plat/omap_device.h> |
89 | #include <plat/omap_hwmod.h> | 90 | #include <plat/omap_hwmod.h> |
@@ -539,20 +540,34 @@ int omap_early_device_register(struct omap_device *od) | |||
539 | static int _od_runtime_suspend(struct device *dev) | 540 | static int _od_runtime_suspend(struct device *dev) |
540 | { | 541 | { |
541 | struct platform_device *pdev = to_platform_device(dev); | 542 | struct platform_device *pdev = to_platform_device(dev); |
543 | int ret; | ||
544 | |||
545 | ret = pm_generic_runtime_suspend(dev); | ||
546 | |||
547 | if (!ret) | ||
548 | omap_device_idle(pdev); | ||
549 | |||
550 | return ret; | ||
551 | } | ||
542 | 552 | ||
543 | return omap_device_idle(pdev); | 553 | static int _od_runtime_idle(struct device *dev) |
554 | { | ||
555 | return pm_generic_runtime_idle(dev); | ||
544 | } | 556 | } |
545 | 557 | ||
546 | static int _od_runtime_resume(struct device *dev) | 558 | static int _od_runtime_resume(struct device *dev) |
547 | { | 559 | { |
548 | struct platform_device *pdev = to_platform_device(dev); | 560 | struct platform_device *pdev = to_platform_device(dev); |
549 | 561 | ||
550 | return omap_device_enable(pdev); | 562 | omap_device_enable(pdev); |
563 | |||
564 | return pm_generic_runtime_resume(dev); | ||
551 | } | 565 | } |
552 | 566 | ||
553 | static struct dev_power_domain omap_device_power_domain = { | 567 | static struct dev_power_domain omap_device_power_domain = { |
554 | .ops = { | 568 | .ops = { |
555 | .runtime_suspend = _od_runtime_suspend, | 569 | .runtime_suspend = _od_runtime_suspend, |
570 | .runtime_idle = _od_runtime_idle, | ||
556 | .runtime_resume = _od_runtime_resume, | 571 | .runtime_resume = _od_runtime_resume, |
557 | USE_PLATFORM_PM_SLEEP_OPS | 572 | USE_PLATFORM_PM_SLEEP_OPS |
558 | } | 573 | } |