aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh/pm_runtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sh/pm_runtime.c')
-rw-r--r--drivers/sh/pm_runtime.c40
1 files changed, 34 insertions, 6 deletions
diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
index 10c65eb51f85..72f63817a1a0 100644
--- a/drivers/sh/pm_runtime.c
+++ b/drivers/sh/pm_runtime.c
@@ -21,18 +21,43 @@
21#include <linux/slab.h> 21#include <linux/slab.h>
22 22
23#ifdef CONFIG_PM_RUNTIME 23#ifdef CONFIG_PM_RUNTIME
24 24static int sh_pm_runtime_suspend(struct device *dev)
25static int default_platform_runtime_idle(struct device *dev)
26{ 25{
27 /* suspend synchronously to disable clocks immediately */ 26 int ret;
27
28 ret = pm_generic_runtime_suspend(dev);
29 if (ret) {
30 dev_err(dev, "failed to suspend device\n");
31 return ret;
32 }
33
34 ret = pm_clk_suspend(dev);
35 if (ret) {
36 dev_err(dev, "failed to suspend clock\n");
37 pm_generic_runtime_resume(dev);
38 return ret;
39 }
40
28 return 0; 41 return 0;
29} 42}
30 43
44static int sh_pm_runtime_resume(struct device *dev)
45{
46 int ret;
47
48 ret = pm_clk_resume(dev);
49 if (ret) {
50 dev_err(dev, "failed to resume clock\n");
51 return ret;
52 }
53
54 return pm_generic_runtime_resume(dev);
55}
56
31static struct dev_pm_domain default_pm_domain = { 57static struct dev_pm_domain default_pm_domain = {
32 .ops = { 58 .ops = {
33 .runtime_suspend = pm_clk_suspend, 59 .runtime_suspend = sh_pm_runtime_suspend,
34 .runtime_resume = pm_clk_resume, 60 .runtime_resume = sh_pm_runtime_resume,
35 .runtime_idle = default_platform_runtime_idle,
36 USE_PLATFORM_PM_SLEEP_OPS 61 USE_PLATFORM_PM_SLEEP_OPS
37 }, 62 },
38}; 63};
@@ -63,6 +88,9 @@ static int __init sh_pm_runtime_init(void)
63 !of_machine_is_compatible("renesas,r8a7779") && 88 !of_machine_is_compatible("renesas,r8a7779") &&
64 !of_machine_is_compatible("renesas,r8a7790") && 89 !of_machine_is_compatible("renesas,r8a7790") &&
65 !of_machine_is_compatible("renesas,r8a7791") && 90 !of_machine_is_compatible("renesas,r8a7791") &&
91 !of_machine_is_compatible("renesas,r8a7792") &&
92 !of_machine_is_compatible("renesas,r8a7793") &&
93 !of_machine_is_compatible("renesas,r8a7794") &&
66 !of_machine_is_compatible("renesas,sh7372") && 94 !of_machine_is_compatible("renesas,sh7372") &&
67 !of_machine_is_compatible("renesas,sh73a0")) 95 !of_machine_is_compatible("renesas,sh73a0"))
68 return 0; 96 return 0;