devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Mike Turquette <mturquette@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Simon Horman <horms@verge.net.au>,
	Magnus Damm <magnus.damm@gmail.com>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Kevin Hilman <khilman@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-clk@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH v2 14/14] ARM: shmobile: R-Mobile: Use CPG Clock Domain attach/detach helpers
Date: Thu, 28 May 2015 20:53:39 +0200	[thread overview]
Message-ID: <1432839219-475-15-git-send-email-geert+renesas@glider.be> (raw)
In-Reply-To: <1432839219-475-1-git-send-email-geert+renesas@glider.be>

The R-Mobile PM Domain driver manages both power domains and a clock
domain.

The clock domain part is very similar to the CPG Clock Domain, which is
used on shmobile SoCs without device power domains, except for the way
how clocks suitable for power management are selected:
  - The former uses the first clock tied to the device through the NULL
    con_id, which is a relic from the legacy pm_clk_notifier-based
    method in drivers/sh/pm_runtime.c,
  - The latter looks for suitable clocks in DT, which is more
    future-proof.

Hence switch to using the CPG Clock Domain helpers for DT-based
multi-platform builds.

The old method, using a NULL con_id, is still used for legacy builds.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2:
  - New.
---
 arch/arm/mach-shmobile/pm-rmobile.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
index 747d557b7016ec6d..cac564c5348cd851 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -12,6 +12,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  */
+#include <linux/clk/shmobile.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/of.h>
@@ -118,6 +119,7 @@ static bool rmobile_pd_active_wakeup(struct device *dev)
 	return true;
 }
 
+#ifdef CONFIG_ARCH_SHMOBILE_LEGACY
 static int rmobile_pd_attach_dev(struct generic_pm_domain *domain,
 				 struct device *dev)
 {
@@ -147,6 +149,10 @@ static void rmobile_pd_detach_dev(struct generic_pm_domain *domain,
 {
 	pm_clk_destroy(dev);
 }
+#else /* CONFIG_ARCH_SHMOBILE_LEGACY */
+#define rmobile_pd_attach_dev	cpg_mstp_attach_dev
+#define rmobile_pd_detach_dev	cpg_mstp_detach_dev
+#endif /* CONFIG_ARCH_SHMOBILE_LEGACY */
 
 static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
 {
-- 
1.9.1


  parent reply	other threads:[~2015-05-28 18:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 18:53 [PATCH v2 00/14] ARM: shmobile: Add CPG Clock Domains Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 02/14] clk: shmobile: r8a7778: Add CPG Clock Domain support Geert Uytterhoeven
     [not found] ` <1432839219-475-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2015-05-28 18:53   ` [PATCH v2 01/14] clk: shmobile: " Geert Uytterhoeven
2015-06-22 15:07     ` Geert Uytterhoeven
2015-05-28 18:53   ` [PATCH v2 03/14] clk: shmobile: r8a7779: " Geert Uytterhoeven
2015-06-15 16:15   ` [PATCH v2 00/14] ARM: shmobile: Add CPG Clock Domains Geert Uytterhoeven
2015-06-15 18:39     ` Kevin Hilman
2015-06-22 20:46     ` Michael Turquette
2015-06-23  8:59       ` Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 04/14] clk: shmobile: rcar-gen2: Add CPG Clock Domain support Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 05/14] clk: shmobile: rz: " Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 06/14] ARM: shmobile: r7s72100 dtsi: Add CPG Clock Domain Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 07/14] ARM: shmobile: r8a7778 " Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 08/14] ARM: shmobile: r8a7779 " Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 09/14] ARM: shmobile: r8a7790 " Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 10/14] ARM: shmobile: r8a7791 " Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 11/14] ARM: shmobile: r8a7794 " Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 12/14] drivers: sh: Stop using pm_runtime.c for multi-platform shmobile with genpd Geert Uytterhoeven
2015-06-15 19:44   ` Geert Uytterhoeven
2015-05-28 18:53 ` [PATCH v2 13/14] clk: shmobile: mstp: Consider "zb_clk" suitable for power management Geert Uytterhoeven
2015-06-22 20:05   ` Michael Turquette
2015-06-22 20:17     ` Geert Uytterhoeven
2015-05-28 18:53 ` Geert Uytterhoeven [this message]
2015-06-08 21:42 ` [PATCH v2 00/14] ARM: shmobile: Add CPG Clock Domains Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432839219-475-15-git-send-email-geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=devicetree@vger.kernel.org \
    --cc=horms@verge.net.au \
    --cc=khilman@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mturquette@linaro.org \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@codeaurora.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).