diff options
author | Jerome Brunet <jbrunet@baylibre.com> | 2018-02-12 15:58:42 +0100 |
---|---|---|
committer | Neil Armstrong <narmstrong@baylibre.com> | 2018-03-13 10:04:03 +0100 |
commit | 722825dcd54b2e427c1aee54a7992eb4ab04a49d (patch) | |
tree | 5abe9c46643a0681d86e24f214816a8ffb911fa3 /drivers/clk/meson/clkc.h | |
parent | 88a4e1283681e0f07048b2bd867cc81fbbae57cc (diff) | |
download | op-kernel-dev-722825dcd54b2e427c1aee54a7992eb4ab04a49d.zip op-kernel-dev-722825dcd54b2e427c1aee54a7992eb4ab04a49d.tar.gz |
clk: meson: migrate plls clocks to clk_regmap
Rework meson pll driver to use clk_regmap and move meson8b, gxbb and
axg's clock using meson_clk_pll to clk_regmap.
This rework is not just about clk_regmap, there a serious clean-up of
the driver code:
* Add lock and reset field: Previously inferred from the n field.
* Simplify the reset logic: Code seemed to apply reset differently but
in fact it was always the same -> assert reset, apply params,
de-assert reset. The 2 lock checking loops have been kept for now, as
they seem to be necessary.
* Do the sequence of init register pokes only at .init() instead of in
.set_rate(). Redoing the init on every set_rate() is not necessary
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Diffstat (limited to 'drivers/clk/meson/clkc.h')
-rw-r--r-- | drivers/clk/meson/clkc.h | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/drivers/clk/meson/clkc.h b/drivers/clk/meson/clkc.h index a4a526c..f0d70ea 100644 --- a/drivers/clk/meson/clkc.h +++ b/drivers/clk/meson/clkc.h @@ -82,41 +82,21 @@ struct pll_rate_table { .frac = (_frac), \ } \ -struct pll_params_table { - unsigned int reg_off; - unsigned int value; -}; - -#define PLL_PARAM(_reg, _val) \ - { \ - .reg_off = (_reg), \ - .value = (_val), \ - } - -struct pll_setup_params { - struct pll_params_table *params_table; - unsigned int params_count; - /* Workaround for GP0, do not reset before configuring */ - bool no_init_reset; - /* Workaround for GP0, unreset right before checking for lock */ - bool clear_reset_for_lock; - /* Workaround for GXL GP0, reset in the lock checking loop */ - bool reset_lock_loop; -}; +#define CLK_MESON_PLL_LOCK_LOOP_RST BIT(0) -struct meson_clk_pll { - struct clk_hw hw; - void __iomem *base; +struct meson_clk_pll_data { struct parm m; struct parm n; struct parm frac; struct parm od; struct parm od2; struct parm od3; - const struct pll_setup_params params; - const struct pll_rate_table *rate_table; - unsigned int rate_count; - spinlock_t *lock; + struct parm l; + struct parm rst; + const struct reg_sequence *init_regs; + unsigned int init_count; + const struct pll_rate_table *table; + u8 flags; }; #define to_meson_clk_pll(_hw) container_of(_hw, struct meson_clk_pll, hw) |