clk: rockchip: Drop CLK_NR_CLKS CLKPMU_NR_CLKS usage
Subsystems (3)
cover clk: rockchip: Drop CLK_NR_CLKS CLKPMU_NR_CLKS usage
In order to get rid of CLK_NR_CLKS and CLKPMU_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id.
Johan Jonker (9):
clk: rockchip: px30: Drop CLK_NR_CLKS CLKPMU_NR_CLKS usage
clk: rockchip: rk3036: Drop CLK_NR_CLKS usage
clk: rockchip: rk3228: Drop CLK_NR_CLKS usage
clk: rockchip: rk3288: Drop CLK_NR_CLKS usage
clk: rockchip: rk3308: Drop CLK_NR_CLKS usage
clk: rockchip: rk3328: Drop CLK_NR_CLKS usage
clk: rockchip: rk3368: Drop CLK_NR_CLKS usage
clk: rockchip: rk3399: Drop CLK_NR_CLKS CLKPMU_NR_CLKS usage
dt-bindings: clock: rockchip: remove CLK_NR_CLKS and CLKPMU_NR_CLKS
drivers/clk/rockchip/clk-px30.c | 10 ++++++++-- drivers/clk/rockchip/clk-rk3036.c | 5 ++++- drivers/clk/rockchip/clk-rk3228.c | 5 ++++- drivers/clk/rockchip/clk-rk3288.c | 5 ++++- drivers/clk/rockchip/clk-rk3308.c | 5 ++++- drivers/clk/rockchip/clk-rk3328.c | 5 ++++- drivers/clk/rockchip/clk-rk3368.c | 5 ++++- drivers/clk/rockchip/clk-rk3399.c | 10 ++++++++-- include/dt-bindings/clock/px30-cru.h | 4 ---- include/dt-bindings/clock/rk3036-cru.h | 2 -- include/dt-bindings/clock/rk3228-cru.h | 2 -- include/dt-bindings/clock/rk3288-cru.h | 2 -- include/dt-bindings/clock/rk3308-cru.h | 2 -- include/dt-bindings/clock/rk3328-cru.h | 2 -- include/dt-bindings/clock/rk3368-cru.h | 2 -- include/dt-bindings/clock/rk3399-cru.h | 4 ---- 16 files changed, 40 insertions(+), 30 deletions(-)
--
2.39.2
PATCH 1/9 clk: rockchip: px30: Drop CLK_NR_CLKS CLKPMU_NR_CLKS usage
In order to get rid of CLK_NR_CLKS and CLKPMU_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id.
--- drivers/clk/rockchip/clk-px30.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/clk/rockchip/clk-px30.c +8 -2
@@ -1002,6 +1002,7 @@ static const char *const px30_cru_critical_clocks[] __initconst = {static void __init px30_clk_init (struct device_node *np) {struct rockchip_clk_provider *ctx; +unsigned long clk_nr_clks;void __iomem *reg_base; reg_base =of_iomap (np,0 );
@@ -1010,7 +1011,9 @@ static void __init px30_clk_init(struct device_node *np)return ; } - ctx =rockchip_clk_init (np, reg_base,CLK_NR_CLKS ); + clk_nr_clks =rockchip_clk_find_max_clk_id (px30_clk_branches, +ARRAY_SIZE (px30_clk_branches)) +1 ; + ctx =rockchip_clk_init (np, reg_base, clk_nr_clks);if (IS_ERR (ctx)) {pr_err ("%s: rockchip clk init failed\n" , __func__);iounmap (reg_base);
@@ -1043,6 +1046,7 @@ CLK_OF_DECLARE(px30_cru, "rockchip,px30-cru", px30_clk_init);static void __init px30_pmu_clk_init (struct device_node *np) {struct rockchip_clk_provider *ctx; +unsigned long clkpmu_nr_clks;void __iomem *reg_base; reg_base =of_iomap (np,0 );
@@ -1051,7 +1055,9 @@ static void __init px30_pmu_clk_init(struct device_node *np)return ; } - ctx =rockchip_clk_init (np, reg_base,CLKPMU_NR_CLKS ); + clkpmu_nr_clks =rockchip_clk_find_max_clk_id (px30_clk_pmu_branches, +ARRAY_SIZE (px30_clk_pmu_branches)) +1 ; + ctx =rockchip_clk_init (np, reg_base, clkpmu_nr_clks);if (IS_ERR (ctx)) {pr_err ("%s: rockchip pmu clk init failed\n" , __func__);return ;
--
2.39.2
PATCH 2/9 clk: rockchip: rk3036: Drop CLK_NR_CLKS usage
In reply to Johan JonkerIn order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id.
--- drivers/clk/rockchip/clk-rk3036.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3036.c +4 -1
@@ -436,6 +436,7 @@ static const char *const rk3036_critical_clocks[] __initconst = {static void __init rk3036_clk_init (struct device_node *np) {struct rockchip_clk_provider *ctx; +unsigned long clk_nr_clks;void __iomem *reg_base;struct clk *clk;
@@ -452,7 +453,9 @@ static void __init rk3036_clk_init(struct device_node *np)writel_relaxed (HIWORD_UPDATE (0x2 ,0x3 ,10 ), reg_base +RK2928_CLKSEL_CON (13 )); - ctx =rockchip_clk_init (np, reg_base,CLK_NR_CLKS ); + clk_nr_clks =rockchip_clk_find_max_clk_id (rk3036_clk_branches, +ARRAY_SIZE (rk3036_clk_branches)) +1 ; + ctx =rockchip_clk_init (np, reg_base, clk_nr_clks);if (IS_ERR (ctx)) {pr_err ("%s: rockchip clk init failed\n" , __func__);iounmap (reg_base);
--
2.39.2
PATCH 3/9 clk: rockchip: rk3228: Drop CLK_NR_CLKS usage
In reply to Johan JonkerIn order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id.
--- drivers/clk/rockchip/clk-rk3228.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3228.c +4 -1
@@ -683,6 +683,7 @@ static const char *const rk3228_critical_clocks[] __initconst = {static void __init rk3228_clk_init (struct device_node *np) {struct rockchip_clk_provider *ctx; +unsigned long clk_nr_clks;void __iomem *reg_base; reg_base =of_iomap (np,0 );
@@ -691,7 +692,9 @@ static void __init rk3228_clk_init(struct device_node *np)return ; } - ctx =rockchip_clk_init (np, reg_base,CLK_NR_CLKS ); + clk_nr_clks =rockchip_clk_find_max_clk_id (rk3228_clk_branches, +ARRAY_SIZE (rk3228_clk_branches)) +1 ; + ctx =rockchip_clk_init (np, reg_base, clk_nr_clks);if (IS_ERR (ctx)) {pr_err ("%s: rockchip clk init failed\n" , __func__);iounmap (reg_base);
--
2.39.2
PATCH 4/9 clk: rockchip: rk3288: Drop CLK_NR_CLKS usage
In reply to Johan JonkerIn order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id.
--- drivers/clk/rockchip/clk-rk3288.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3288.c +4 -1
@@ -932,6 +932,7 @@ static void __init rk3288_common_init(struct device_node *np, enum rk3288_variant soc) {struct rockchip_clk_provider *ctx; +unsigned long clk_nr_clks; rk3288_cru_base =of_iomap (np,0 );if (!rk3288_cru_base) {
@@ -939,7 +940,9 @@ static void __init rk3288_common_init(struct device_node *np,return ; } - ctx =rockchip_clk_init (np, rk3288_cru_base,CLK_NR_CLKS ); + clk_nr_clks =rockchip_clk_find_max_clk_id (rk3288_clk_branches, +ARRAY_SIZE (rk3288_clk_branches)) +1 ; + ctx =rockchip_clk_init (np, rk3288_cru_base, clk_nr_clks);if (IS_ERR (ctx)) {pr_err ("%s: rockchip clk init failed\n" , __func__);iounmap (rk3288_cru_base);
--
2.39.2
PATCH 5/9 clk: rockchip: rk3308: Drop CLK_NR_CLKS usage
In reply to Johan JonkerIn order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id.
--- drivers/clk/rockchip/clk-rk3308.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3308.c +4 -1
@@ -917,6 +917,7 @@ static const char *const rk3308_critical_clocks[] __initconst = {static void __init rk3308_clk_init (struct device_node *np) {struct rockchip_clk_provider *ctx; +unsigned long clk_nr_clks;void __iomem *reg_base; reg_base =of_iomap (np,0 );
@@ -925,7 +926,9 @@ static void __init rk3308_clk_init(struct device_node *np)return ; } - ctx =rockchip_clk_init (np, reg_base,CLK_NR_CLKS ); + clk_nr_clks =rockchip_clk_find_max_clk_id (rk3308_clk_branches, +ARRAY_SIZE (rk3308_clk_branches)) +1 ; + ctx =rockchip_clk_init (np, reg_base, clk_nr_clks);if (IS_ERR (ctx)) {pr_err ("%s: rockchip clk init failed\n" , __func__);iounmap (reg_base);
--
2.39.2
PATCH 6/9 clk: rockchip: rk3328: Drop CLK_NR_CLKS usage
In reply to Johan JonkerIn order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id.
--- drivers/clk/rockchip/clk-rk3328.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3328.c +4 -1
@@ -881,6 +881,7 @@ static const char *const rk3328_critical_clocks[] __initconst = {static void __init rk3328_clk_init (struct device_node *np) {struct rockchip_clk_provider *ctx; +unsigned long clk_nr_clks;void __iomem *reg_base; reg_base =of_iomap (np,0 );
@@ -889,7 +890,9 @@ static void __init rk3328_clk_init(struct device_node *np)return ; } - ctx =rockchip_clk_init (np, reg_base,CLK_NR_CLKS ); + clk_nr_clks =rockchip_clk_find_max_clk_id (rk3328_clk_branches, +ARRAY_SIZE (rk3328_clk_branches)) +1 ; + ctx =rockchip_clk_init (np, reg_base, clk_nr_clks);if (IS_ERR (ctx)) {pr_err ("%s: rockchip clk init failed\n" , __func__);iounmap (reg_base);
--
2.39.2
PATCH 7/9 clk: rockchip: rk3368: Drop CLK_NR_CLKS usage
In reply to Johan JonkerIn order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id.
--- drivers/clk/rockchip/clk-rk3368.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3368.c +4 -1
@@ -866,6 +866,7 @@ static const char *const rk3368_critical_clocks[] __initconst = {static void __init rk3368_clk_init (struct device_node *np) {struct rockchip_clk_provider *ctx; +unsigned long clk_nr_clks;void __iomem *reg_base; reg_base =of_iomap (np,0 );
@@ -874,7 +875,9 @@ static void __init rk3368_clk_init(struct device_node *np)return ; } - ctx =rockchip_clk_init (np, reg_base,CLK_NR_CLKS ); + clk_nr_clks =rockchip_clk_find_max_clk_id (rk3368_clk_branches, +ARRAY_SIZE (rk3368_clk_branches)) +1 ; + ctx =rockchip_clk_init (np, reg_base, clk_nr_clks);if (IS_ERR (ctx)) {pr_err ("%s: rockchip clk init failed\n" , __func__);iounmap (reg_base);
--
2.39.2
PATCH 8/9 clk: rockchip: rk3399: Drop CLK_NR_CLKS CLKPMU_NR_CLKS usage
In reply to Johan JonkerIn order to get rid of CLK_NR_CLKS and CLKPMU_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id.
--- drivers/clk/rockchip/clk-rk3399.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/clk/rockchip/clk-rk3399.c +8 -2
@@ -1531,6 +1531,7 @@ static const char *const rk3399_pmucru_critical_clocks[] __initconst = {static void __init rk3399_clk_init (struct device_node *np) {struct rockchip_clk_provider *ctx; +unsigned long clk_nr_clks;void __iomem *reg_base; reg_base =of_iomap (np,0 );
@@ -1539,7 +1540,9 @@ static void __init rk3399_clk_init(struct device_node *np)return ; } - ctx =rockchip_clk_init (np, reg_base,CLK_NR_CLKS ); + clk_nr_clks =rockchip_clk_find_max_clk_id (rk3399_clk_branches, +ARRAY_SIZE (rk3399_clk_branches)) +1 ; + ctx =rockchip_clk_init (np, reg_base, clk_nr_clks);if (IS_ERR (ctx)) {pr_err ("%s: rockchip clk init failed\n" , __func__);iounmap (reg_base);
@@ -1577,6 +1580,7 @@ CLK_OF_DECLARE(rk3399_cru, "rockchip,rk3399-cru", rk3399_clk_init);static void __init rk3399_pmu_clk_init (struct device_node *np) {struct rockchip_clk_provider *ctx; +unsigned long clkpmu_nr_clks;void __iomem *reg_base; reg_base =of_iomap (np,0 );
@@ -1585,7 +1589,9 @@ static void __init rk3399_pmu_clk_init(struct device_node *np)return ; } - ctx =rockchip_clk_init (np, reg_base,CLKPMU_NR_CLKS ); + clkpmu_nr_clks =rockchip_clk_find_max_clk_id (rk3399_clk_pmu_branches, +ARRAY_SIZE (rk3399_clk_pmu_branches)) +1 ; + ctx =rockchip_clk_init (np, reg_base, clkpmu_nr_clks);if (IS_ERR (ctx)) {pr_err ("%s: rockchip pmu clk init failed\n" , __func__);iounmap (reg_base);
--
2.39.2
PATCH 9/9 dt-bindings: clock: rockchip: remove CLK_NR_CLKS and CLKPMU_NR_CLKS
In reply to Johan JonkerCLK_NR_CLKS and CLKPMU_NR_CLKS should not be part of the binding. Remove since the kernel code no longer uses it.
--- include/dt-bindings/clock/px30-cru.h | 4 ---- include/dt-bindings/clock/rk3036-cru.h | 2 -- include/dt-bindings/clock/rk3228-cru.h | 2 -- include/dt-bindings/clock/rk3288-cru.h | 2 -- include/dt-bindings/clock/rk3308-cru.h | 2 -- include/dt-bindings/clock/rk3328-cru.h | 2 -- include/dt-bindings/clock/rk3368-cru.h | 2 -- include/dt-bindings/clock/rk3399-cru.h | 4 ---- 8 files changed, 20 deletions(-)
include/dt-bindings/clock/px30-cru.h +0 -4
@@ -175,8 +175,6 @@#define PCLK_CIF 352#define PCLK_OTP_PHY 353 -#define CLK_NR_CLKS (PCLK_OTP_PHY + 1) -/* pmu-clocks indices */ #define PLL_GPLL 1
@@ -195,8 +193,6 @@#define PCLK_GPIO0_PMU 20#define PCLK_UART0_PMU 21 -#define CLKPMU_NR_CLKS (PCLK_UART0_PMU + 1) -/* soft-reset indices */ #define SRST_CORE0_PO 0#define SRST_CORE1_PO 1
include/dt-bindings/clock/rk3036-cru.h +0 -2
@@ -94,8 +94,6 @@#define HCLK_CPU 477#define HCLK_PERI 478 -#define CLK_NR_CLKS (HCLK_PERI + 1) -/* soft-reset indices */ #define SRST_CORE0 0#define SRST_CORE1 1
include/dt-bindings/clock/rk3228-cru.h +0 -2
@@ -146,8 +146,6 @@#define HCLK_S_CRYPTO 477#define HCLK_PERI 478 -#define CLK_NR_CLKS (HCLK_PERI + 1) -/* soft-reset indices */ #define SRST_CORE0_PO 0#define SRST_CORE1_PO 1
include/dt-bindings/clock/rk3288-cru.h +0 -2
@@ -195,8 +195,6 @@#define HCLK_CPU 477#define HCLK_PERI 478 -#define CLK_NR_CLKS (HCLK_PERI + 1) -/* soft-reset indices */ #define SRST_CORE0 0#define SRST_CORE1 1
include/dt-bindings/clock/rk3308-cru.h +0 -2
@@ -212,8 +212,6 @@#define PCLK_CAN 233#define PCLK_OWIRE 234 -#define CLK_NR_CLKS (PCLK_OWIRE + 1) -/* soft-reset indices */ /* cru_softrst_con0 */
include/dt-bindings/clock/rk3328-cru.h +0 -2
@@ -201,8 +201,6 @@#define HCLK_RGA 340#define HCLK_HDCP 341 -#define CLK_NR_CLKS (HCLK_HDCP + 1) -/* soft-reset indices */ #define SRST_CORE0_PO 0#define SRST_CORE1_PO 1
include/dt-bindings/clock/rk3368-cru.h +0 -2
@@ -182,8 +182,6 @@#define HCLK_BUS 477#define HCLK_PERI 478 -#define CLK_NR_CLKS (HCLK_PERI + 1) -/* soft-reset indices */ #define SRST_CORE_B0 0#define SRST_CORE_B1 1
include/dt-bindings/clock/rk3399-cru.h +0 -4
@@ -335,8 +335,6 @@#define HCLK_SDIO_NOC 495#define HCLK_SDIOAUDIO_NOC 496 -#define CLK_NR_CLKS (HCLK_SDIOAUDIO_NOC + 1) -/* pmu-clocks indices */ #define PLL_PPLL 1
@@ -378,8 +376,6 @@#define PCLK_INTR_ARB_PMU 49#define HCLK_NOC_PMU 50 -#define CLKPMU_NR_CLKS (HCLK_NOC_PMU + 1) -/* soft-reset indices */ /* cru_softrst_con0 */
--
2.39.2
Re: [PATCH v1 9/9] dt-bindings: clock: rockchip: remove CLK_NR_CLKS and CLKPMU_NR_CLKS
Quoted 4 lines · Johan Jonker
CLK_NR_CLKSandCLKPMU_NR_CLKSshould not be part of the binding. Remove since the kernel code no longer uses it.Signed-off-by Johan Jonker <[email protected]>
Quoted 16 lines · Johan Jonker
In order to get rid of
CLK_NR_CLKSandCLKPMU_NR_CLKSand be able to drop it from the bindings, userockchip_clk_find_max_clk_idhelper to find the highest clock id.Johan Jonker (9):
clk: rockchip: px30: DropCLK_NR_CLKSCLKPMU_NR_CLKSusage
clk: rockchip: rk3036: DropCLK_NR_CLKSusage
clk: rockchip: rk3228: DropCLK_NR_CLKSusage
clk: rockchip: rk3288: DropCLK_NR_CLKSusage
clk: rockchip: rk3308: DropCLK_NR_CLKSusage
clk: rockchip: rk3328: DropCLK_NR_CLKSusage
clk: rockchip: rk3368: DropCLK_NR_CLKSusage
clk: rockchip: rk3399: DropCLK_NR_CLKSCLKPMU_NR_CLKSusage
dt-bindings: clock: rockchip: removeCLK_NR_CLKSandCLKPMU_NR_CLKS
Quoted 1 line
[...]
Applied, thanks!
[1/9] clk: rockchip: px30: Drop CLK_NR_CLKS CLKPMU_NR_CLKS usage
commit: 2496910c84a4bd1aa2c10fe57cf4ae1cbcab17f4
[2/9] clk: rockchip: rk3036: Drop CLK_NR_CLKS usage
commit: ec4f4261c315d9bc30bb1bb8c3bb17cbaebe7741
[3/9] clk: rockchip: rk3228: Drop CLK_NR_CLKS usage
commit: 819b2e19a9f7dc9e84a00e2f6da2b2f15a01cee6
[4/9] clk: rockchip: rk3288: Drop CLK_NR_CLKS usage
commit: 545b1313c5a24eed0e4d34554c715b46686251ff
[5/9] clk: rockchip: rk3308: Drop CLK_NR_CLKS usage
commit: 31fe14956883bc09846ce239993e215330218a6f
[6/9] clk: rockchip: rk3328: Drop CLK_NR_CLKS usage
commit: 0758fe99bc969294c2391de145b67c1223c7b104
[7/9] clk: rockchip: rk3368: Drop CLK_NR_CLKS usage
commit: 41563197e7f2a0b449476bbbe931cb2806e84966
[8/9] clk: rockchip: rk3399: Drop CLK_NR_CLKS CLKPMU_NR_CLKS usage
commit: 1a229868852ffe1d59f6bdad1e473d9d5f9e14bb
[9/9] dt-bindings: clock: rockchip: remove CLK_NR_CLKS and CLKPMU_NR_CLKS
commit: fb234516c5a0728d7dbd718667c33c1523b55fe8Best regards,
Signature · 1 line
Heiko Stuebner <[email protected]>