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>
#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);
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) {
#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 = {
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;