Re: [PATCH 1/4] clk: meson: mpll: add init callback and regs
From: Stephen Boyd
Date: Mon Mar 25 2019 - 13:10:25 EST
Quoting Jerome Brunet (2019-03-25 04:11:57)
> @@ -138,6 +129,27 @@ static int mpll_set_rate(struct clk_hw *hw,
> return 0;
> }
>
> +static void mpll_init(struct clk_hw *hw)
> +{
> + struct clk_regmap *clk = to_clk_regmap(hw);
> + struct meson_clk_mpll_data *mpll = meson_clk_mpll_data(clk);
> +
> + if (mpll->init_count)
> + regmap_multi_reg_write(clk->map, mpll->init_regs,
> + mpll->init_count);
> +
> + /* Enable the fractional part */
> + meson_parm_write(clk->map, &mpll->sdm_en, 1);
> +
> + /* Set additional fractional part enable if required */
> + if (MESON_PARM_APPLICABLE(&mpll->ssen))
> + meson_parm_write(clk->map, &mpll->ssen, 1);
> +
> + /* Set the magic misc bit if required */
> + if (MESON_PARM_APPLICABLE(&mpll->misc))
> + meson_parm_write(clk->map, &mpll->misc, 1);
> +}
> +
> const struct clk_ops meson_clk_mpll_ro_ops = {
> .recalc_rate = mpll_recalc_rate,
> .round_rate = mpll_round_rate,
> @@ -148,6 +160,7 @@ const struct clk_ops meson_clk_mpll_ops = {
> .recalc_rate = mpll_recalc_rate,
> .round_rate = mpll_round_rate,
> .set_rate = mpll_set_rate,
> + .init = mpll_init,
We actively discourage using init callbacks. Can you do this some other
way?
> };
> EXPORT_SYMBOL_GPL(meson_clk_mpll_ops);
>