aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2015-08-04 08:28:04 -0400
committerSimon Horman <horms+renesas@verge.net.au>2015-08-11 21:31:27 -0400
commitb31fc90c14d9e584ac19983686cecab3e0764289 (patch)
treeb38d31c9d8e0c025229edf71008decd8dd6269f9
parent8bc964aa25e56b7445ffebffccd455f959370a16 (diff)
clk: shmobile: r8a7779: Add CPG/MSTP Clock Domain support
Add Clock Domain support to the R-Car H1 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. Also update the reg property in the DT binding doc example to match the actual dtsi, which uses #address-cells and #size-cells == 1, not 2. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Stephen Boyd <sboyd@codeaurora.org> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt30
-rw-r--r--drivers/clk/shmobile/clk-r8a7779.c2
2 files changed, 28 insertions, 4 deletions
diff --git a/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt b/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
index ed3c8cb12f4e..8c81547c29f5 100644
--- a/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
+++ b/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
@@ -1,7 +1,9 @@
1* Renesas R8A7779 Clock Pulse Generator (CPG) 1* Renesas R8A7779 Clock Pulse Generator (CPG)
2 2
3The CPG generates core clocks for the R8A7779. It includes one PLL and 3The CPG generates core clocks for the R8A7779. It includes one PLL and
4several fixed ratio dividers 4several fixed ratio dividers.
5The CPG also provides a Clock Domain for SoC devices, in combination with the
6CPG Module Stop (MSTP) Clocks.
5 7
6Required Properties: 8Required Properties:
7 9
@@ -12,16 +14,36 @@ Required Properties:
12 - #clock-cells: Must be 1 14 - #clock-cells: Must be 1
13 - clock-output-names: The names of the clocks. Supported clocks are "plla", 15 - clock-output-names: The names of the clocks. Supported clocks are "plla",
14 "z", "zs", "s", "s1", "p", "b", "out". 16 "z", "zs", "s", "s1", "p", "b", "out".
17 - #power-domain-cells: Must be 0
15 18
19SoC devices that are part of the CPG/MSTP Clock Domain and can be power-managed
20through an MSTP clock should refer to the CPG device node in their
21"power-domains" property, as documented by the generic PM domain bindings in
22Documentation/devicetree/bindings/power/power_domain.txt.
16 23
17Example 24
18------- 25Examples
26--------
27
28 - CPG device node:
19 29
20 cpg_clocks: cpg_clocks@ffc80000 { 30 cpg_clocks: cpg_clocks@ffc80000 {
21 compatible = "renesas,r8a7779-cpg-clocks"; 31 compatible = "renesas,r8a7779-cpg-clocks";
22 reg = <0 0xffc80000 0 0x30>; 32 reg = <0xffc80000 0x30>;
23 clocks = <&extal_clk>; 33 clocks = <&extal_clk>;
24 #clock-cells = <1>; 34 #clock-cells = <1>;
25 clock-output-names = "plla", "z", "zs", "s", "s1", "p", 35 clock-output-names = "plla", "z", "zs", "s", "s1", "p",
26 "b", "out"; 36 "b", "out";
37 #power-domain-cells = <0>;
38 };
39
40
41 - CPG/MSTP Clock Domain member device node:
42
43 sata: sata@fc600000 {
44 compatible = "renesas,sata-r8a7779", "renesas,rcar-sata";
45 reg = <0xfc600000 0x2000>;
46 interrupts = <0 100 IRQ_TYPE_LEVEL_HIGH>;
47 clocks = <&mstp1_clks R8A7779_CLK_SATA>;
48 power-domains = <&cpg_clocks>;
27 }; 49 };
diff --git a/drivers/clk/shmobile/clk-r8a7779.c b/drivers/clk/shmobile/clk-r8a7779.c
index 652ecacb6daf..e42a63a2ad25 100644
--- a/drivers/clk/shmobile/clk-r8a7779.c
+++ b/drivers/clk/shmobile/clk-r8a7779.c
@@ -168,6 +168,8 @@ static void __init r8a7779_cpg_clocks_init(struct device_node *np)
168 } 168 }
169 169
170 of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data); 170 of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data);
171
172 cpg_mstp_add_clk_domain(np);
171} 173}
172CLK_OF_DECLARE(r8a7779_cpg_clks, "renesas,r8a7779-cpg-clocks", 174CLK_OF_DECLARE(r8a7779_cpg_clks, "renesas,r8a7779-cpg-clocks",
173 r8a7779_cpg_clocks_init); 175 r8a7779_cpg_clocks_init);