From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Simon Horman <horms@verge.net.au>,
Magnus Damm <magnus.damm@gmail.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@codeaurora.org>,
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 v4 02/16] clk: shmobile: r8a7778: Add CPG/MSTP Clock Domain support
Date: Tue, 4 Aug 2015 14:28:03 +0200 [thread overview]
Message-ID: <1438691297-29235-3-git-send-email-geert+renesas@glider.be> (raw)
In-Reply-To: <1438691297-29235-1-git-send-email-geert+renesas@glider.be>
Add Clock Domain support to the R-Car M1A Clock Pulse Generator (CPG)
driver using the generic PM Domain. This allows to power-manage the
module clocks of SoC devices that are part of the CPG/MSTP Clock Domain
using Runtime PM, or for system suspend/resume.
SoC devices that are part of the CPG/MSTP Clock Domain and can be
power-managed through an MSTP clock should be tagged in DT with a proper
"power-domains" property.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
---
v4:
- Add Reviewed-by,
v3:
- Add Acked-by,
- Use "CPG/MSTP Clock Domain" instead of "CPG Clock Domain",
v2:
- New.
---
.../bindings/clock/renesas,r8a7778-cpg-clocks.txt | 29 +++++++++++++++++++---
arch/arm/mach-shmobile/Kconfig | 1 +
drivers/clk/shmobile/clk-r8a7778.c | 2 ++
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/clock/renesas,r8a7778-cpg-clocks.txt b/Documentation/devicetree/bindings/clock/renesas,r8a7778-cpg-clocks.txt
index 2f3747fdcf1c5305..e4cdaf1cb3333012 100644
--- a/Documentation/devicetree/bindings/clock/renesas,r8a7778-cpg-clocks.txt
+++ b/Documentation/devicetree/bindings/clock/renesas,r8a7778-cpg-clocks.txt
@@ -1,7 +1,9 @@
* Renesas R8A7778 Clock Pulse Generator (CPG)
The CPG generates core clocks for the R8A7778. It includes two PLLs and
-several fixed ratio dividers
+several fixed ratio dividers.
+The CPG also provides a Clock Domain for SoC devices, in combination with the
+CPG Module Stop (MSTP) Clocks.
Required Properties:
@@ -10,10 +12,18 @@ Required Properties:
- #clock-cells: Must be 1
- clock-output-names: The names of the clocks. Supported clocks are
"plla", "pllb", "b", "out", "p", "s", and "s1".
+ - #power-domain-cells: Must be 0
+SoC devices that are part of the CPG/MSTP Clock Domain and can be power-managed
+through an MSTP clock should refer to the CPG device node in their
+"power-domains" property, as documented by the generic PM domain bindings in
+Documentation/devicetree/bindings/power/power_domain.txt.
-Example
--------
+
+Examples
+--------
+
+ - CPG device node:
cpg_clocks: cpg_clocks@ffc80000 {
compatible = "renesas,r8a7778-cpg-clocks";
@@ -22,4 +32,17 @@ Example
clocks = <&extal_clk>;
clock-output-names = "plla", "pllb", "b",
"out", "p", "s", "s1";
+ #power-domain-cells = <0>;
+ };
+
+
+ - CPG/MSTP Clock Domain member device node:
+
+ sdhi0: sd@ffe4c000 {
+ compatible = "renesas,sdhi-r8a7778";
+ reg = <0xffe4c000 0x100>;
+ interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp3_clks R8A7778_CLK_SDHI0>;
+ power-domains = <&cpg_clocks>;
+ status = "disabled";
};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index aa38a438af8990ef..5b1f9eca7c871aee 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -4,6 +4,7 @@ config ARCH_SHMOBILE
config PM_RCAR
bool
+ select PM_GENERIC_DOMAINS if PM
config PM_RMOBILE
bool
diff --git a/drivers/clk/shmobile/clk-r8a7778.c b/drivers/clk/shmobile/clk-r8a7778.c
index e97e28fcfc13d102..87c1d2f2fb57a46c 100644
--- a/drivers/clk/shmobile/clk-r8a7778.c
+++ b/drivers/clk/shmobile/clk-r8a7778.c
@@ -124,6 +124,8 @@ static void __init r8a7778_cpg_clocks_init(struct device_node *np)
}
of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data);
+
+ cpg_mstp_add_clk_domain(np);
}
CLK_OF_DECLARE(r8a7778_cpg_clks, "renesas,r8a7778-cpg-clocks",
--
1.9.1
next prev parent reply other threads:[~2015-08-04 12:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-04 12:28 [PATCH v4 00/16] ARM: shmobile: Add CPG/MSTP Clock Domain Geert Uytterhoeven
2015-08-04 12:28 ` [PATCH v4 01/16] clk: shmobile: Add CPG/MSTP Clock Domain support Geert Uytterhoeven
2015-08-04 12:28 ` Geert Uytterhoeven [this message]
2015-08-04 12:28 ` [PATCH v4 03/16] clk: shmobile: r8a7779: " Geert Uytterhoeven
2015-08-04 12:28 ` [PATCH v4 04/16] clk: shmobile: rcar-gen2: " Geert Uytterhoeven
2015-08-04 12:28 ` [PATCH v4 06/16] ARM: shmobile: r7s72100 dtsi: Add CPG/MSTP Clock Domain Geert Uytterhoeven
2015-08-04 12:28 ` [PATCH v4 07/16] ARM: shmobile: r8a7778 " Geert Uytterhoeven
2015-08-04 12:28 ` [PATCH v4 08/16] ARM: shmobile: r8a7779 " Geert Uytterhoeven
2015-08-04 12:28 ` [PATCH v4 09/16] ARM: shmobile: r8a7790 " Geert Uytterhoeven
2015-08-04 12:28 ` [PATCH v4 10/16] ARM: shmobile: r8a7791 " Geert Uytterhoeven
2015-08-04 12:28 ` [PATCH v4 11/16] ARM: shmobile: r8a7793 " Geert Uytterhoeven
2015-08-04 12:28 ` [PATCH v4 12/16] ARM: shmobile: r8a7794 " Geert Uytterhoeven
2015-08-04 12:28 ` [PATCH v4 13/16] drivers: sh: Disable legacy default PM Domain on emev2 Geert Uytterhoeven
[not found] ` <1438691297-29235-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2015-08-04 12:28 ` [PATCH v4 05/16] clk: shmobile: rz: Add CPG/MSTP Clock Domain support Geert Uytterhoeven
2015-08-04 12:28 ` [PATCH v4 14/16] drivers: sh: Disable PM runtime for multi-platform ARM with genpd Geert Uytterhoeven
2015-08-04 12:28 ` [PATCH v4 15/16] clk: shmobile: mstp: Consider "zb_clk" suitable for power management Geert Uytterhoeven
[not found] ` <1438691297-29235-16-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2015-08-04 13:20 ` Sergei Shtylyov
2015-09-17 8:45 ` Simon Horman
2015-09-17 8:53 ` Simon Horman
2015-09-17 22:24 ` Stephen Boyd
2015-09-18 0:12 ` Simon Horman
2015-08-04 12:28 ` [PATCH v4 16/16] ARM: shmobile: R-Mobile: Use CPG/MSTP Clock Domain attach/detach helpers Geert Uytterhoeven
2015-08-04 13:48 ` [PATCH v4 00/16] ARM: shmobile: Add CPG/MSTP Clock Domain Simon Horman
2015-08-05 0:55 ` Simon Horman
2015-08-05 6:58 ` Geert Uytterhoeven
[not found] ` <CAMuHMdUFjgVWBc0hdm_L0Z0Os1OT8H4NzwQyQTGZQt8Bu7-9PQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-06 0:50 ` Simon Horman
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=1438691297-29235-3-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@baylibre.com \
--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).