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

clk: shmobile: rcar-gen2: Add CPG/MSTP Clock Domain support

Add Clock Domain support to the R-Car Gen2 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
63e05d93 b31fc90c

+26 -2
+24 -2
Documentation/devicetree/bindings/clock/renesas,rcar-gen2-cpg-clocks.txt
··· 2 2 3 3 The CPG generates core clocks for the R-Car Gen2 SoCs. It includes three PLLs 4 4 and 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 ··· 22 20 - clock-output-names: The names of the clocks. Supported clocks are "main", 23 21 "pll0", "pll1", "pll3", "lb", "qspi", "sdh", "sd0", "sd1", "z", "rcan", and 24 22 "adsp" 23 + - #power-domain-cells: Must be 0 24 + 25 + SoC devices that are part of the CPG/MSTP Clock Domain and can be power-managed 26 + through an MSTP clock should refer to the CPG device node in their 27 + "power-domains" property, as documented by the generic PM domain bindings in 28 + Documentation/devicetree/bindings/power/power_domain.txt. 25 29 26 30 27 - Example 28 - ------- 31 + Examples 32 + -------- 33 + 34 + - CPG device node: 29 35 30 36 cpg_clocks: cpg_clocks@e6150000 { 31 37 compatible = "renesas,r8a7790-cpg-clocks", ··· 44 34 clock-output-names = "main", "pll0, "pll1", "pll3", 45 35 "lb", "qspi", "sdh", "sd0", "sd1", "z", 46 36 "rcan", "adsp"; 37 + #power-domain-cells = <0>; 38 + }; 39 + 40 + 41 + - CPG/MSTP Clock Domain member device node: 42 + 43 + thermal@e61f0000 { 44 + compatible = "renesas,thermal-r8a7790", "renesas,rcar-thermal"; 45 + reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>; 46 + interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>; 47 + clocks = <&mstp5_clks R8A7790_CLK_THERMAL>; 48 + power-domains = <&cpg_clocks>; 47 49 };
+2
drivers/clk/shmobile/clk-rcar-gen2.c
··· 415 415 } 416 416 417 417 of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data); 418 + 419 + cpg_mstp_add_clk_domain(np); 418 420 } 419 421 CLK_OF_DECLARE(rcar_gen2_cpg_clks, "renesas,rcar-gen2-cpg-clocks", 420 422 rcar_gen2_cpg_clocks_init);