From 5843feb8907b8540017247c6b5b887e009080c25 Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Fri, 20 Oct 2023 19:01:43 +0800 Subject: [PATCH 1/2] clk: rockchip: clk-out: Add property for CLK_IGNORE_UNUSED This patch is used for compatible for old style mclk reference which do not use the "mclkout_x". Use property 'rockchip,clk-ignore-unused' instead the fixed one. Suggest to drop this patch for totally new SDK or SoCs in the future. Ref: 1255f11b25c3 ("clk: rockchip: clk-out: Add CLK_IGNORE_UNUSED flag") Signed-off-by: Sugar Zhang Change-Id: I72797d9fa3f8367c48808489e24f544c34acab39 --- drivers/clk/rockchip/clk-out.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/clk/rockchip/clk-out.c b/drivers/clk/rockchip/clk-out.c index 689832ed00d6..97177a4626b9 100644 --- a/drivers/clk/rockchip/clk-out.c +++ b/drivers/clk/rockchip/clk-out.c @@ -23,6 +23,7 @@ static int rockchip_clk_out_probe(struct platform_device *pdev) void __iomem *reg; u32 shift = 0; u8 clk_gate_flags = CLK_GATE_HIWORD_MASK; + unsigned long flags = CLK_SET_RATE_PARENT; int ret; ret = device_property_read_string(dev, "clock-output-names", &clk_name); @@ -36,6 +37,9 @@ static int rockchip_clk_out_probe(struct platform_device *pdev) if (device_property_read_bool(dev, "rockchip,bit-set-to-disable")) clk_gate_flags |= CLK_GATE_SET_TO_DISABLE; + if (device_property_read_bool(dev, "rockchip,clk-ignore-unused")) + flags |= CLK_IGNORE_UNUSED; + ret = of_clk_parent_fill(node, &parent_name, 1); if (ret != 1) return -EINVAL; @@ -50,7 +54,8 @@ static int rockchip_clk_out_probe(struct platform_device *pdev) pm_runtime_enable(dev); - hw = clk_hw_register_gate(dev, clk_name, parent_name, CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, + + hw = clk_hw_register_gate(dev, clk_name, parent_name, flags, reg, shift, clk_gate_flags, &clk_out_lock); if (IS_ERR(hw)) { ret = -EINVAL; From 618ce38798a8c230240bf9c5762aeabfcc6bed7c Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Fri, 20 Oct 2023 19:15:21 +0800 Subject: [PATCH 2/2] arm64: dts: rockchip: rk3588: Add CLK_IGNORE_UNUSED for MCLKOUTx This patch is used for compatible for old style mclk reference which do not use the "mclkout_x". Use property 'rockchip,clk-ignore-unused' instead the fixed one. Suggest to drop this patch for totally new SDK or SoCs in the future. Ref: 1255f11b25c3 ("clk: rockchip: clk-out: Add CLK_IGNORE_UNUSED flag") Signed-off-by: Sugar Zhang Change-Id: Ifa5c0be7f2aad6fc6848b49f4612a160b04d7254 --- arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index 2a608a6e4de0..1c24f35fb078 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi @@ -337,6 +337,7 @@ clock-output-names = "i2s0_mclkout_to_io"; rockchip,bit-shift = <0>; rockchip,bit-set-to-disable; + rockchip,clk-ignore-unused; /* for OLD SDK */ }; mclkout_i2s1: mclkout-i2s1@fd58c318 { @@ -347,6 +348,7 @@ clock-output-names = "i2s1_mclkout_to_io"; rockchip,bit-shift = <1>; rockchip,bit-set-to-disable; + rockchip,clk-ignore-unused; /* for OLD SDK */ }; mclkout_i2s1m1: mclkout-i2s1@fd58a000 { @@ -356,6 +358,7 @@ #clock-cells = <0>; clock-output-names = "i2s1m1_mclkout_to_io"; rockchip,bit-shift = <6>; + rockchip,clk-ignore-unused; /* for OLD SDK */ }; mclkout_i2s2: mclkout-i2s2@fd58c318 { @@ -366,6 +369,7 @@ clock-output-names = "i2s2_mclkout_to_io"; rockchip,bit-shift = <2>; rockchip,bit-set-to-disable; + rockchip,clk-ignore-unused; /* for OLD SDK */ }; mclkout_i2s3: mclkout-i2s3@fd58c318 { @@ -376,6 +380,7 @@ clock-output-names = "i2s3_mclkout_to_io"; rockchip,bit-shift = <7>; rockchip,bit-set-to-disable; + rockchip,clk-ignore-unused; /* for OLD SDK */ }; };