* [PATCH 0/2] Drop RK3568's variant of the CLK_NR_CLKS constant
@ 2025-11-03 23:40 Heiko Stuebner
2025-11-03 23:40 ` [PATCH 1/2] clk: rockchip: rk3568: Drop CLK_NR_CLKS usage Heiko Stuebner
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Heiko Stuebner @ 2025-11-03 23:40 UTC (permalink / raw)
To: heiko
Cc: mturquette, sboyd, robh, krzk+dt, conor+dt, linux-clk,
linux-arm-kernel, linux-rockchip, linux-kernel, michael.riesch
This drops the use of the CLK_NR_CLKS constant from the rk3568 clock
driver and after that, drops the constant from the binding that should
not have been part of it in the first place.
Heiko Stuebner (2):
clk: rockchip: rk3568: Drop CLK_NR_CLKS usage
dt-bindings: clock: rk3568: Drop CLK_NR_CLKS define
drivers/clk/rockchip/clk-rk3568.c | 5 ++++-
include/dt-bindings/clock/rk3568-cru.h | 2 --
2 files changed, 4 insertions(+), 3 deletions(-)
--
2.47.2
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/2] clk: rockchip: rk3568: Drop CLK_NR_CLKS usage 2025-11-03 23:40 [PATCH 0/2] Drop RK3568's variant of the CLK_NR_CLKS constant Heiko Stuebner @ 2025-11-03 23:40 ` Heiko Stuebner 2025-11-05 1:32 ` Sebastian Reichel 2025-11-03 23:40 ` [PATCH 2/2] dt-bindings: clock: rk3568: Drop CLK_NR_CLKS define Heiko Stuebner 2025-11-05 23:26 ` [PATCH 0/2] Drop RK3568's variant of the CLK_NR_CLKS constant Heiko Stuebner 2 siblings, 1 reply; 6+ messages in thread From: Heiko Stuebner @ 2025-11-03 23:40 UTC (permalink / raw) To: heiko Cc: mturquette, sboyd, robh, krzk+dt, conor+dt, linux-clk, linux-arm-kernel, linux-rockchip, linux-kernel, michael.riesch In 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. Signed-off-by: Heiko Stuebner <heiko@sntech.de> --- drivers/clk/rockchip/clk-rk3568.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clk/rockchip/clk-rk3568.c b/drivers/clk/rockchip/clk-rk3568.c index 97d279399ae8..74eabf9b2ae2 100644 --- a/drivers/clk/rockchip/clk-rk3568.c +++ b/drivers/clk/rockchip/clk-rk3568.c @@ -1652,6 +1652,7 @@ CLK_OF_DECLARE(rk3568_cru_pmu, "rockchip,rk3568-pmucru", rk3568_pmu_clk_init); static void __init rk3568_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); @@ -1660,7 +1661,9 @@ static void __init rk3568_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(rk3568_clk_branches, + ARRAY_SIZE(rk3568_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.47.2 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] clk: rockchip: rk3568: Drop CLK_NR_CLKS usage 2025-11-03 23:40 ` [PATCH 1/2] clk: rockchip: rk3568: Drop CLK_NR_CLKS usage Heiko Stuebner @ 2025-11-05 1:32 ` Sebastian Reichel 0 siblings, 0 replies; 6+ messages in thread From: Sebastian Reichel @ 2025-11-05 1:32 UTC (permalink / raw) To: Heiko Stuebner Cc: mturquette, sboyd, robh, krzk+dt, conor+dt, linux-clk, linux-arm-kernel, linux-rockchip, linux-kernel, michael.riesch [-- Attachment #1: Type: text/plain, Size: 1482 bytes --] Hi, On Tue, Nov 04, 2025 at 12:40:31AM +0100, Heiko Stuebner wrote: > In 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. > > Signed-off-by: Heiko Stuebner <heiko@sntech.de> > --- Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> -- Sebastian > drivers/clk/rockchip/clk-rk3568.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/rockchip/clk-rk3568.c b/drivers/clk/rockchip/clk-rk3568.c > index 97d279399ae8..74eabf9b2ae2 100644 > --- a/drivers/clk/rockchip/clk-rk3568.c > +++ b/drivers/clk/rockchip/clk-rk3568.c > @@ -1652,6 +1652,7 @@ CLK_OF_DECLARE(rk3568_cru_pmu, "rockchip,rk3568-pmucru", rk3568_pmu_clk_init); > static void __init rk3568_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); > @@ -1660,7 +1661,9 @@ static void __init rk3568_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(rk3568_clk_branches, > + ARRAY_SIZE(rk3568_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.47.2 > > [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] dt-bindings: clock: rk3568: Drop CLK_NR_CLKS define 2025-11-03 23:40 [PATCH 0/2] Drop RK3568's variant of the CLK_NR_CLKS constant Heiko Stuebner 2025-11-03 23:40 ` [PATCH 1/2] clk: rockchip: rk3568: Drop CLK_NR_CLKS usage Heiko Stuebner @ 2025-11-03 23:40 ` Heiko Stuebner 2025-11-04 17:25 ` Conor Dooley 2025-11-05 23:26 ` [PATCH 0/2] Drop RK3568's variant of the CLK_NR_CLKS constant Heiko Stuebner 2 siblings, 1 reply; 6+ messages in thread From: Heiko Stuebner @ 2025-11-03 23:40 UTC (permalink / raw) To: heiko Cc: mturquette, sboyd, robh, krzk+dt, conor+dt, linux-clk, linux-arm-kernel, linux-rockchip, linux-kernel, michael.riesch CLK_NR_CLKS has always only be used on the driver side to calculate array sizes should never have been part of the clock-binding. Let's drop it, since the kernel code no longer uses it either and nothing else has ever used it. Signed-off-by: Heiko Stuebner <heiko@sntech.de> --- include/dt-bindings/clock/rk3568-cru.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/dt-bindings/clock/rk3568-cru.h b/include/dt-bindings/clock/rk3568-cru.h index 5263085c5b23..f01f0e9ce8f1 100644 --- a/include/dt-bindings/clock/rk3568-cru.h +++ b/include/dt-bindings/clock/rk3568-cru.h @@ -483,8 +483,6 @@ #define PCLK_CORE_PVTM 450 -#define CLK_NR_CLKS (PCLK_CORE_PVTM + 1) - /* pmu soft-reset indices */ /* pmucru_softrst_con0 */ #define SRST_P_PDPMU_NIU 0 -- 2.47.2 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] dt-bindings: clock: rk3568: Drop CLK_NR_CLKS define 2025-11-03 23:40 ` [PATCH 2/2] dt-bindings: clock: rk3568: Drop CLK_NR_CLKS define Heiko Stuebner @ 2025-11-04 17:25 ` Conor Dooley 0 siblings, 0 replies; 6+ messages in thread From: Conor Dooley @ 2025-11-04 17:25 UTC (permalink / raw) To: Heiko Stuebner Cc: mturquette, sboyd, robh, krzk+dt, conor+dt, linux-clk, linux-arm-kernel, linux-rockchip, linux-kernel, michael.riesch [-- Attachment #1: Type: text/plain, Size: 75 bytes --] Acked-by: Conor Dooley <conor.dooley@microchip.com> pw-bot: not-applicable [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] Drop RK3568's variant of the CLK_NR_CLKS constant 2025-11-03 23:40 [PATCH 0/2] Drop RK3568's variant of the CLK_NR_CLKS constant Heiko Stuebner 2025-11-03 23:40 ` [PATCH 1/2] clk: rockchip: rk3568: Drop CLK_NR_CLKS usage Heiko Stuebner 2025-11-03 23:40 ` [PATCH 2/2] dt-bindings: clock: rk3568: Drop CLK_NR_CLKS define Heiko Stuebner @ 2025-11-05 23:26 ` Heiko Stuebner 2 siblings, 0 replies; 6+ messages in thread From: Heiko Stuebner @ 2025-11-05 23:26 UTC (permalink / raw) To: Heiko Stuebner Cc: mturquette, sboyd, robh, krzk+dt, conor+dt, linux-clk, linux-arm-kernel, linux-rockchip, linux-kernel, michael.riesch On Tue, 04 Nov 2025 00:40:30 +0100, Heiko Stuebner wrote: > This drops the use of the CLK_NR_CLKS constant from the rk3568 clock > driver and after that, drops the constant from the binding that should > not have been part of it in the first place. > > Heiko Stuebner (2): > clk: rockchip: rk3568: Drop CLK_NR_CLKS usage > dt-bindings: clock: rk3568: Drop CLK_NR_CLKS define > > [...] Applied, thanks! [1/2] clk: rockchip: rk3568: Drop CLK_NR_CLKS usage commit: 2a42e3210d4331dddfb04b020050bd774cf99659 [2/2] dt-bindings: clock: rk3568: Drop CLK_NR_CLKS define commit: ca38f0f65eefd79889b409c89c6932d7e2fe0993 Best regards, -- Heiko Stuebner <heiko@sntech.de> ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-11-05 23:26 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-11-03 23:40 [PATCH 0/2] Drop RK3568's variant of the CLK_NR_CLKS constant Heiko Stuebner 2025-11-03 23:40 ` [PATCH 1/2] clk: rockchip: rk3568: Drop CLK_NR_CLKS usage Heiko Stuebner 2025-11-05 1:32 ` Sebastian Reichel 2025-11-03 23:40 ` [PATCH 2/2] dt-bindings: clock: rk3568: Drop CLK_NR_CLKS define Heiko Stuebner 2025-11-04 17:25 ` Conor Dooley 2025-11-05 23:26 ` [PATCH 0/2] Drop RK3568's variant of the CLK_NR_CLKS constant Heiko Stuebner
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox