aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 14:44:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 14:44:09 -0400
commit75bcc84445bccf40a6215ff6fc6dd91978b1490e (patch)
tree1f2cb11a503ce3ae4d4c7ef6ffe9ac5f32536b50
parentcc07aabc53978ae09a1d539237189f7c9841060a (diff)
parent2f35fb3c8a6018a0a5fe4a7fb0948b853c157256 (diff)
Merge tag 'renesas-sh-drivers-for-v3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next
Pull SH driver update from Simon Horman: - PM Runtime enhancements targeted for use with ARM-based Renesas R-Car Gen2 SoCs - Restrict INTC_USERIMASK to SH4A as it is only used there * tag 'renesas-sh-drivers-for-v3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: drivers: sh: Enable PM runtime for new R-Car Gen2 SoCs drivers: sh: pm_runtime implementation needs to suspend and resume devices drivers: sh: Restrict INTC_USERIMASK to SH4A drivers: sh: pm_runtime does not need idle callback
-rw-r--r--drivers/sh/intc/Kconfig2
-rw-r--r--drivers/sh/pm_runtime.c40
2 files changed, 35 insertions, 7 deletions
diff --git a/drivers/sh/intc/Kconfig b/drivers/sh/intc/Kconfig
index f7d90617c9d9..60228fae943f 100644
--- a/drivers/sh/intc/Kconfig
+++ b/drivers/sh/intc/Kconfig
@@ -6,7 +6,7 @@ comment "Interrupt controller options"
6 6
7config INTC_USERIMASK 7config INTC_USERIMASK
8 bool "Userspace interrupt masking support" 8 bool "Userspace interrupt masking support"
9 depends on ARCH_SHMOBILE || (SUPERH && CPU_SH4A) || COMPILE_TEST 9 depends on (SUPERH && CPU_SH4A) || COMPILE_TEST
10 help 10 help
11 This enables support for hardware-assisted userspace hardirq 11 This enables support for hardware-assisted userspace hardirq
12 masking. 12 masking.
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;