Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+27
+26
drivers/clk/meson/clk-pll.c
··· 303 303 return 1; 304 304 } 305 305 306 + static 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 + 306 316 static int meson_clk_pll_enable(struct clk_hw *hw) 307 317 { 308 318 struct clk_regmap *clk = to_clk_regmap(hw); ··· 396 386 397 387 return 0; 398 388 } 389 + 390 + /* 391 + * The Meson G12A PCIE PLL is fined tuned to deliver a very precise 392 + * 100MHz reference clock for the PCIe Analog PHY, and thus requires 393 + * a strict register sequence to enable the PLL. 394 + * To simplify, re-use the _init() op to enable the PLL and keep 395 + * the other ops except set_rate since the rate is fixed. 396 + */ 397 + const struct clk_ops meson_clk_pcie_pll_ops = { 398 + .recalc_rate = meson_clk_pll_recalc_rate, 399 + .round_rate = meson_clk_pll_round_rate, 400 + .is_enabled = meson_clk_pll_is_enabled, 401 + .enable = meson_clk_pcie_pll_enable, 402 + .disable = meson_clk_pll_disable 403 + }; 404 + EXPORT_SYMBOL_GPL(meson_clk_pcie_pll_ops); 399 405 400 406 const struct clk_ops meson_clk_pll_ops = { 401 407 .init = meson_clk_pll_init,
+1
drivers/clk/meson/clk-pll.h
··· 45 45 46 46 extern const struct clk_ops meson_clk_pll_ro_ops; 47 47 extern const struct clk_ops meson_clk_pll_ops; 48 + extern const struct clk_ops meson_clk_pcie_pll_ops; 48 49 49 50 #endif /* __MESON_CLK_PLL_H */