diff options
| author | Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp> | 2025-11-14 15:53:57 +0900 |
|---|---|---|
| committer | Stephen Boyd <sboyd@kernel.org> | 2025-11-20 18:53:03 -0800 |
| commit | 67e41dbc268a521a61acca25b6cbc70592488b19 (patch) | |
| tree | b3a2ecf2f84baaca3884147a0620a939a4086722 | |
| parent | 3a8660878839faadb4f1a6dd72c3179c1df56787 (diff) | |
clk: visconti: Do not define number of clocks in bindings
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>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
| -rw-r--r-- | drivers/clk/visconti/clkc-tmpv770x.c | 8 | ||||
| -rw-r--r-- | 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 6c753b2cb558..94a736da6fea 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 8360ccf88867..a2208c5fc12e 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; |
