* [PATCH 1/2] clk: visconti: Do not define number of clocks in bindings
2025-11-14 6:53 [PATCH 0/2] clk: visconti: Remove definition of number of clocks from bindings Yuji Ishikawa
@ 2025-11-14 6:53 ` Yuji Ishikawa
2025-11-21 2:53 ` Stephen Boyd
2025-11-14 6:53 ` [PATCH 2/2] dt-bindings: clock: tmpv770x: Remove definition of number of clocks Yuji Ishikawa
1 sibling, 1 reply; 6+ messages in thread
From: Yuji Ishikawa @ 2025-11-14 6:53 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Nobuhiro Iwamatsu, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Philipp Zabel
Cc: linux-clk, linux-arm-kernel, linux-kernel, devicetree,
Yuji Ishikawa
Remove use of TMPV770X_NR_CLK.
Instead, define number of clocks inside the driver directory.
The same for TMPV770X_NR_RESET and TMPV770X_NR_PLL.
Signed-off-by: Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
---
drivers/clk/visconti/clkc-tmpv770x.c | 8 ++++++--
drivers/clk/visconti/pll-tmpv770x.c | 5 ++++-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/visconti/clkc-tmpv770x.c b/drivers/clk/visconti/clkc-tmpv770x.c
index 6c753b2cb..94a736da6 100644
--- a/drivers/clk/visconti/clkc-tmpv770x.c
+++ b/drivers/clk/visconti/clkc-tmpv770x.c
@@ -17,6 +17,10 @@
#include "clkc.h"
#include "reset.h"
+/* Must be equal to the last clock/reset ID increased by one */
+#define CLKS_NR (TMPV770X_CLK_BUSLCK + 1)
+#define RESETS_NR (TMPV770X_RESET_SBUSCLK + 1)
+
static DEFINE_SPINLOCK(tmpv770x_clk_lock);
static DEFINE_SPINLOCK(tmpv770x_rst_lock);
@@ -234,12 +238,12 @@ static int visconti_clk_probe(struct platform_device *pdev)
if (IS_ERR(regmap))
return PTR_ERR(regmap);
- ctx = visconti_init_clk(dev, regmap, TMPV770X_NR_CLK);
+ ctx = visconti_init_clk(dev, regmap, CLKS_NR);
if (IS_ERR(ctx))
return PTR_ERR(ctx);
ret = visconti_register_reset_controller(dev, regmap, clk_reset_data,
- TMPV770X_NR_RESET,
+ RESETS_NR,
&visconti_reset_ops,
&tmpv770x_rst_lock);
if (ret) {
diff --git a/drivers/clk/visconti/pll-tmpv770x.c b/drivers/clk/visconti/pll-tmpv770x.c
index 8360ccf88..a2208c5fc 100644
--- a/drivers/clk/visconti/pll-tmpv770x.c
+++ b/drivers/clk/visconti/pll-tmpv770x.c
@@ -16,6 +16,9 @@
#include "pll.h"
+/* Must be equal to the last pll ID increased by one */
+#define PLLS_NR (TMPV770X_PLL_PIIMGERPLL + 1)
+
static DEFINE_SPINLOCK(tmpv770x_pll_lock);
static const struct visconti_pll_rate_table pipll0_rates[] __initconst = {
@@ -66,7 +69,7 @@ static void __init tmpv770x_setup_plls(struct device_node *np)
if (!reg_base)
return;
- ctx = visconti_init_pll(np, reg_base, TMPV770X_NR_PLL);
+ ctx = visconti_init_pll(np, reg_base, PLLS_NR);
if (IS_ERR(ctx)) {
iounmap(reg_base);
return;
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/2] dt-bindings: clock: tmpv770x: Remove definition of number of clocks
2025-11-14 6:53 [PATCH 0/2] clk: visconti: Remove definition of number of clocks from bindings Yuji Ishikawa
2025-11-14 6:53 ` [PATCH 1/2] clk: visconti: Do not define number of clocks in bindings Yuji Ishikawa
@ 2025-11-14 6:53 ` Yuji Ishikawa
2025-11-14 17:55 ` Conor Dooley
2025-11-21 2:53 ` Stephen Boyd
1 sibling, 2 replies; 6+ messages in thread
From: Yuji Ishikawa @ 2025-11-14 6:53 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Nobuhiro Iwamatsu, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Philipp Zabel
Cc: linux-clk, linux-arm-kernel, linux-kernel, devicetree,
Yuji Ishikawa
Remove the definitions of number of clocks from bindings because they
prevent adding new clocks. Since the previous patch removed all refereces
within the driver, they can now be deleted.
The same for resets and plls.
Signed-off-by: Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
---
include/dt-bindings/clock/toshiba,tmpv770x.h | 3 ---
include/dt-bindings/reset/toshiba,tmpv770x.h | 1 -
2 files changed, 4 deletions(-)
diff --git a/include/dt-bindings/clock/toshiba,tmpv770x.h b/include/dt-bindings/clock/toshiba,tmpv770x.h
index 5fce71300..89189c4f6 100644
--- a/include/dt-bindings/clock/toshiba,tmpv770x.h
+++ b/include/dt-bindings/clock/toshiba,tmpv770x.h
@@ -11,7 +11,6 @@
#define TMPV770X_PLL_PIDDRCPLL 4
#define TMPV770X_PLL_PIVOIFPLL 5
#define TMPV770X_PLL_PIIMGERPLL 6
-#define TMPV770X_NR_PLL 7
/* Clocks */
#define TMPV770X_CLK_PIPLL1_DIV1 0
@@ -141,7 +140,6 @@
#define TMPV770X_CLK_PIREFCLK 124
#define TMPV770X_CLK_SBUS 125
#define TMPV770X_CLK_BUSLCK 126
-#define TMPV770X_NR_CLK 127
/* Reset */
#define TMPV770X_RESET_PIETHER_2P5M 0
@@ -176,6 +174,5 @@
#define TMPV770X_RESET_PIPCMIF 29
#define TMPV770X_RESET_PICKMON 30
#define TMPV770X_RESET_SBUSCLK 31
-#define TMPV770X_NR_RESET 32
#endif /*_DT_BINDINGS_CLOCK_TOSHIBA_TMPV770X_H_ */
diff --git a/include/dt-bindings/reset/toshiba,tmpv770x.h b/include/dt-bindings/reset/toshiba,tmpv770x.h
index c1007acb1..bedfe253f 100644
--- a/include/dt-bindings/reset/toshiba,tmpv770x.h
+++ b/include/dt-bindings/reset/toshiba,tmpv770x.h
@@ -36,6 +36,5 @@
#define TMPV770X_RESET_PIPCMIF 29
#define TMPV770X_RESET_PICKMON 30
#define TMPV770X_RESET_SBUSCLK 31
-#define TMPV770X_NR_RESET 32
#endif /*_DT_BINDINGS_RESET_TOSHIBA_TMPV770X_H_ */
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread