* [GIT PULL] SH Driver Updates for v3.16
@ 2014-06-06 12:44 Simon Horman
2014-06-06 12:44 ` [PATCH 1/4] drivers: sh: pm_runtime does not need idle callback Simon Horman
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Simon Horman @ 2014-06-06 12:44 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-sh, linux-kernel, Magnus Damm, Simon Horman
Hi Linus,
Please consider these SH Driver Updates for v3.16
This pull request is based on the SH Driver Updates for v3.15,
tagged as sh-drivers-for-v3.15, which you included in v3.15-rc6.
The following changes since commit 3c90c55dcde745bed81f6447f24ba96bda43d984:
drivers: sh: compile drivers/sh/pm_runtime.c if ARCH_SHMOBILE_MULTI (2014-05-12 16:05:01 +0900)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-sh-drivers-for-v3.16
for you to fetch changes up to 2f35fb3c8a6018a0a5fe4a7fb0948b853c157256:
drivers: sh: Enable PM runtime for new R-Car Gen2 SoCs (2014-06-05 09:50:11 +0900)
----------------------------------------------------------------
SH Driver Update for v3.16
* 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
----------------------------------------------------------------
Ben Dooks (2):
drivers: sh: pm_runtime does not need idle callback
drivers: sh: pm_runtime implementation needs to suspend and resume devices
Geert Uytterhoeven (2):
drivers: sh: Restrict INTC_USERIMASK to SH4A
drivers: sh: Enable PM runtime for new R-Car Gen2 SoCs
drivers/sh/intc/Kconfig | 2 +-
drivers/sh/pm_runtime.c | 40 ++++++++++++++++++++++++++++++++++------
2 files changed, 35 insertions(+), 7 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/4] drivers: sh: pm_runtime does not need idle callback
2014-06-06 12:44 [GIT PULL] SH Driver Updates for v3.16 Simon Horman
@ 2014-06-06 12:44 ` Simon Horman
2014-06-06 12:44 ` [PATCH 2/4] drivers: sh: Restrict INTC_USERIMASK to SH4A Simon Horman
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2014-06-06 12:44 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-sh, linux-kernel, Magnus Damm, Ben Dooks,
Geert Uytterhoeven, Simon Horman
From: Ben Dooks <ben.dooks@codethink.co.uk>
In the runtime_pm idle callback the code assumes that a NULL .runtime_idle
entry is the same as a .runtime_idle entry that returns 0 as a result. This
means the entry in drivers/sh/pm_runtime can be removed in favour of just
leaving the entry NULL.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [r8a7779 legacy]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/sh/pm_runtime.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
index 10c65eb..00b82ec 100644
--- a/drivers/sh/pm_runtime.c
+++ b/drivers/sh/pm_runtime.c
@@ -21,18 +21,10 @@
#include <linux/slab.h>
#ifdef CONFIG_PM_RUNTIME
-
-static int default_platform_runtime_idle(struct device *dev)
-{
- /* suspend synchronously to disable clocks immediately */
- return 0;
-}
-
static struct dev_pm_domain default_pm_domain = {
.ops = {
.runtime_suspend = pm_clk_suspend,
.runtime_resume = pm_clk_resume,
- .runtime_idle = default_platform_runtime_idle,
USE_PLATFORM_PM_SLEEP_OPS
},
};
--
1.8.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/4] drivers: sh: Restrict INTC_USERIMASK to SH4A
2014-06-06 12:44 [GIT PULL] SH Driver Updates for v3.16 Simon Horman
2014-06-06 12:44 ` [PATCH 1/4] drivers: sh: pm_runtime does not need idle callback Simon Horman
@ 2014-06-06 12:44 ` Simon Horman
2014-06-06 12:44 ` [PATCH 3/4] drivers: sh: pm_runtime implementation needs to suspend and resume devices Simon Horman
2014-06-06 12:44 ` [PATCH 4/4] drivers: sh: Enable PM runtime for new R-Car Gen2 SoCs Simon Horman
3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2014-06-06 12:44 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-sh, linux-kernel, Magnus Damm, Geert Uytterhoeven,
Simon Horman
From: Geert Uytterhoeven <geert+renesas@glider.be>
register_intc_userimask() is called from sh4a code only.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [r8a7779 legacy]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/sh/intc/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/sh/intc/Kconfig b/drivers/sh/intc/Kconfig
index f7d9061..60228fa 100644
--- a/drivers/sh/intc/Kconfig
+++ b/drivers/sh/intc/Kconfig
@@ -6,7 +6,7 @@ comment "Interrupt controller options"
config INTC_USERIMASK
bool "Userspace interrupt masking support"
- depends on ARCH_SHMOBILE || (SUPERH && CPU_SH4A) || COMPILE_TEST
+ depends on (SUPERH && CPU_SH4A) || COMPILE_TEST
help
This enables support for hardware-assisted userspace hardirq
masking.
--
1.8.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/4] drivers: sh: pm_runtime implementation needs to suspend and resume devices
2014-06-06 12:44 [GIT PULL] SH Driver Updates for v3.16 Simon Horman
2014-06-06 12:44 ` [PATCH 1/4] drivers: sh: pm_runtime does not need idle callback Simon Horman
2014-06-06 12:44 ` [PATCH 2/4] drivers: sh: Restrict INTC_USERIMASK to SH4A Simon Horman
@ 2014-06-06 12:44 ` Simon Horman
2014-06-06 12:44 ` [PATCH 4/4] drivers: sh: Enable PM runtime for new R-Car Gen2 SoCs Simon Horman
3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2014-06-06 12:44 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-sh, linux-kernel, Magnus Damm, Ben Dooks,
Geert Uytterhoeven, Simon Horman
From: Ben Dooks <ben.dooks@codethink.co.uk>
If we override the platform bus calls for pm_runtime then we end up
with the calls to the devices' suspend and resume methods ignored
in favour of the bus ones.
Change to calling the pm_runtime calls to suspend and resume the
devices specifically in the drivers/sh/pm_runtime.c implementation
to allow any device that may want to run power management to do so.
Note, all the current sh driver implementations do not use their
own power management code so this is not a major implementation
issues.
This also brings the implementation into line with the versions
used by the Davinci and Keystone PM domain code, so once fully
tested these implementations could be merged together.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/sh/pm_runtime.c | 37 +++++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
index 00b82ec..25eafbe 100644
--- a/drivers/sh/pm_runtime.c
+++ b/drivers/sh/pm_runtime.c
@@ -21,10 +21,43 @@
#include <linux/slab.h>
#ifdef CONFIG_PM_RUNTIME
+static int sh_pm_runtime_suspend(struct device *dev)
+{
+ int ret;
+
+ ret = pm_generic_runtime_suspend(dev);
+ if (ret) {
+ dev_err(dev, "failed to suspend device\n");
+ return ret;
+ }
+
+ ret = pm_clk_suspend(dev);
+ if (ret) {
+ dev_err(dev, "failed to suspend clock\n");
+ pm_generic_runtime_resume(dev);
+ return ret;
+ }
+
+ return 0;
+}
+
+static int sh_pm_runtime_resume(struct device *dev)
+{
+ int ret;
+
+ ret = pm_clk_resume(dev);
+ if (ret) {
+ dev_err(dev, "failed to resume clock\n");
+ return ret;
+ }
+
+ return pm_generic_runtime_resume(dev);
+}
+
static struct dev_pm_domain default_pm_domain = {
.ops = {
- .runtime_suspend = pm_clk_suspend,
- .runtime_resume = pm_clk_resume,
+ .runtime_suspend = sh_pm_runtime_suspend,
+ .runtime_resume = sh_pm_runtime_resume,
USE_PLATFORM_PM_SLEEP_OPS
},
};
--
1.8.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 4/4] drivers: sh: Enable PM runtime for new R-Car Gen2 SoCs
2014-06-06 12:44 [GIT PULL] SH Driver Updates for v3.16 Simon Horman
` (2 preceding siblings ...)
2014-06-06 12:44 ` [PATCH 3/4] drivers: sh: pm_runtime implementation needs to suspend and resume devices Simon Horman
@ 2014-06-06 12:44 ` Simon Horman
3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2014-06-06 12:44 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-sh, linux-kernel, Magnus Damm, Geert Uytterhoeven,
Simon Horman
From: Geert Uytterhoeven <geert+renesas@glider.be>
The PM runtime code should also be enabled for:
- r8a7792 (R-Car V2H)
- r8a7793 (R-Car M2-N)
- r8a7794 (R-Car E2)
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/sh/pm_runtime.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
index 25eafbe..72f6381 100644
--- a/drivers/sh/pm_runtime.c
+++ b/drivers/sh/pm_runtime.c
@@ -88,6 +88,9 @@ static int __init sh_pm_runtime_init(void)
!of_machine_is_compatible("renesas,r8a7779") &&
!of_machine_is_compatible("renesas,r8a7790") &&
!of_machine_is_compatible("renesas,r8a7791") &&
+ !of_machine_is_compatible("renesas,r8a7792") &&
+ !of_machine_is_compatible("renesas,r8a7793") &&
+ !of_machine_is_compatible("renesas,r8a7794") &&
!of_machine_is_compatible("renesas,sh7372") &&
!of_machine_is_compatible("renesas,sh73a0"))
return 0;
--
1.8.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-06-06 12:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-06 12:44 [GIT PULL] SH Driver Updates for v3.16 Simon Horman
2014-06-06 12:44 ` [PATCH 1/4] drivers: sh: pm_runtime does not need idle callback Simon Horman
2014-06-06 12:44 ` [PATCH 2/4] drivers: sh: Restrict INTC_USERIMASK to SH4A Simon Horman
2014-06-06 12:44 ` [PATCH 3/4] drivers: sh: pm_runtime implementation needs to suspend and resume devices Simon Horman
2014-06-06 12:44 ` [PATCH 4/4] drivers: sh: Enable PM runtime for new R-Car Gen2 SoCs Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).