Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: shmobile: r8a7778: Add CPG/MSTP Clock Domain support

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>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

authored by

Geert Uytterhoeven and committed by
Simon Horman
8bc964aa 752b5ed5

+29 -3
+26 -3
Documentation/devicetree/bindings/clock/renesas,r8a7778-cpg-clocks.txt
··· 1 1 * Renesas R8A7778 Clock Pulse Generator (CPG) 2 2 3 3 The CPG generates core clocks for the R8A7778. It includes two PLLs and 4 - several fixed ratio dividers 4 + several fixed ratio dividers. 5 + The CPG also provides a Clock Domain for SoC devices, in combination with the 6 + CPG Module Stop (MSTP) Clocks. 5 7 6 8 Required Properties: 7 9 ··· 12 10 - #clock-cells: Must be 1 13 11 - clock-output-names: The names of the clocks. Supported clocks are 14 12 "plla", "pllb", "b", "out", "p", "s", and "s1". 13 + - #power-domain-cells: Must be 0 14 + 15 + SoC devices that are part of the CPG/MSTP Clock Domain and can be power-managed 16 + through an MSTP clock should refer to the CPG device node in their 17 + "power-domains" property, as documented by the generic PM domain bindings in 18 + Documentation/devicetree/bindings/power/power_domain.txt. 15 19 16 20 17 - Example 18 - ------- 21 + Examples 22 + -------- 23 + 24 + - CPG device node: 19 25 20 26 cpg_clocks: cpg_clocks@ffc80000 { 21 27 compatible = "renesas,r8a7778-cpg-clocks"; ··· 32 22 clocks = <&extal_clk>; 33 23 clock-output-names = "plla", "pllb", "b", 34 24 "out", "p", "s", "s1"; 25 + #power-domain-cells = <0>; 26 + }; 27 + 28 + 29 + - CPG/MSTP Clock Domain member device node: 30 + 31 + sdhi0: sd@ffe4c000 { 32 + compatible = "renesas,sdhi-r8a7778"; 33 + reg = <0xffe4c000 0x100>; 34 + interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>; 35 + clocks = <&mstp3_clks R8A7778_CLK_SDHI0>; 36 + power-domains = <&cpg_clocks>; 37 + status = "disabled"; 35 38 };
+1
arch/arm/mach-shmobile/Kconfig
··· 4 4 5 5 config PM_RCAR 6 6 bool 7 + select PM_GENERIC_DOMAINS if PM 7 8 8 9 config PM_RMOBILE 9 10 bool
+2
drivers/clk/shmobile/clk-r8a7778.c
··· 124 124 } 125 125 126 126 of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data); 127 + 128 + cpg_mstp_add_clk_domain(np); 127 129 } 128 130 129 131 CLK_OF_DECLARE(r8a7778_cpg_clks, "renesas,r8a7778-cpg-clocks",