aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Armstrong <narmstrong@baylibre.com>2019-03-07 09:14:53 -0500
committerNeil Armstrong <narmstrong@baylibre.com>2019-04-01 04:45:11 -0400
commit39b8500283b45252e2f9ad9d60992f2c0d3a1659 (patch)
tree1e2a890f2df2c981e708fc23d9268bb820e85d81
parent370294e2667fa1648eb05aab6c4657419634ff83 (diff)
clk: meson-pll: add reduced specific clk_ops for G12A PCIe PLL
The Meson G12A PCIE PLL is fined tuned to deliver a very precise 100MHz reference clock for the PCIe Analog PHY, and thus requires a strict register sequence to enable the PLL. To simplify, use the _init() op to enable the PLL and keep the other ops except set_rate since the rate is fixed. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://lkml.kernel.org/r/20190307141455.23879-2-narmstrong@baylibre.com
-rw-r--r--drivers/clk/meson/clk-pll.c26
-rw-r--r--drivers/clk/meson/clk-pll.h1
2 files changed, 27 insertions, 0 deletions
diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
index 41e16dd7272a..6a88dd75ccf0 100644
--- a/drivers/clk/meson/clk-pll.c
+++ b/drivers/clk/meson/clk-pll.c
@@ -303,6 +303,16 @@ static int meson_clk_pll_is_enabled(struct clk_hw *hw)
303 return 1; 303 return 1;
304} 304}
305 305
306static int meson_clk_pcie_pll_enable(struct clk_hw *hw)
307{
308 meson_clk_pll_init(hw);
309
310 if (meson_clk_pll_wait_lock(hw))
311 return -EIO;
312
313 return 0;
314}
315
306static int meson_clk_pll_enable(struct clk_hw *hw) 316static int meson_clk_pll_enable(struct clk_hw *hw)
307{ 317{
308 struct clk_regmap *clk = to_clk_regmap(hw); 318 struct clk_regmap *clk = to_clk_regmap(hw);
@@ -387,6 +397,22 @@ static int meson_clk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
387 return 0; 397 return 0;
388} 398}
389 399
400/*
401 * The Meson G12A PCIE PLL is fined tuned to deliver a very precise
402 * 100MHz reference clock for the PCIe Analog PHY, and thus requires
403 * a strict register sequence to enable the PLL.
404 * To simplify, re-use the _init() op to enable the PLL and keep
405 * the other ops except set_rate since the rate is fixed.
406 */
407const struct clk_ops meson_clk_pcie_pll_ops = {
408 .recalc_rate = meson_clk_pll_recalc_rate,
409 .round_rate = meson_clk_pll_round_rate,
410 .is_enabled = meson_clk_pll_is_enabled,
411 .enable = meson_clk_pcie_pll_enable,
412 .disable = meson_clk_pll_disable
413};
414EXPORT_SYMBOL_GPL(meson_clk_pcie_pll_ops);
415
390const struct clk_ops meson_clk_pll_ops = { 416const struct clk_ops meson_clk_pll_ops = {
391 .init = meson_clk_pll_init, 417 .init = meson_clk_pll_init,
392 .recalc_rate = meson_clk_pll_recalc_rate, 418 .recalc_rate = meson_clk_pll_recalc_rate,
diff --git a/drivers/clk/meson/clk-pll.h b/drivers/clk/meson/clk-pll.h
index 55af2e285b1b..367efd0f6410 100644
--- a/drivers/clk/meson/clk-pll.h
+++ b/drivers/clk/meson/clk-pll.h
@@ -45,5 +45,6 @@ struct meson_clk_pll_data {
45 45
46extern const struct clk_ops meson_clk_pll_ro_ops; 46extern const struct clk_ops meson_clk_pll_ro_ops;
47extern const struct clk_ops meson_clk_pll_ops; 47extern const struct clk_ops meson_clk_pll_ops;
48extern const struct clk_ops meson_clk_pcie_pll_ops;
48 49
49#endif /* __MESON_CLK_PLL_H */ 50#endif /* __MESON_CLK_PLL_H */