Skip to content

Commit 75bcc84

Browse files
committed
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
2 parents cc07aab + 2f35fb3 commit 75bcc84

2 files changed

Lines changed: 35 additions & 7 deletions

File tree

‎drivers/sh/intc/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ comment "Interrupt controller options"
66

77
config INTC_USERIMASK
88
bool "Userspace interrupt masking support"
9-
depends on ARCH_SHMOBILE || (SUPERH && CPU_SH4A) || COMPILE_TEST
9+
depends on (SUPERH && CPU_SH4A) || COMPILE_TEST
1010
help
1111
This enables support for hardware-assisted userspace hardirq
1212
masking.

‎drivers/sh/pm_runtime.c‎

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,43 @@
2121
#include <linux/slab.h>
2222

2323
#ifdef CONFIG_PM_RUNTIME
24-
25-
static int default_platform_runtime_idle(struct device *dev)
24+
static int sh_pm_runtime_suspend(struct device *dev)
2625
{
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+
2841
return 0;
2942
}
3043

44+
static 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+
3157
static struct dev_pm_domain default_pm_domain = {
3258
.ops = {
33-
.runtime_suspend = pm_clk_suspend,
34-
.runtime_resume = pm_clk_resume,
35-
.runtime_idle = default_platform_runtime_idle,
59+
.runtime_suspend = sh_pm_runtime_suspend,
60+
.runtime_resume = sh_pm_runtime_resume,
3661
USE_PLATFORM_PM_SLEEP_OPS
3762
},
3863
};
@@ -63,6 +88,9 @@ static int __init sh_pm_runtime_init(void)
6388
!of_machine_is_compatible("renesas,r8a7779") &&
6489
!of_machine_is_compatible("renesas,r8a7790") &&
6590
!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") &&
6694
!of_machine_is_compatible("renesas,sh7372") &&
6795
!of_machine_is_compatible("renesas,sh73a0"))
6896
return 0;

0 commit comments

Comments
 (0)