Amlogic clock updates for v5.14
* Use determine_rate() for the pll ops instead of round_rate() * Restrict gp0/1 and audio plls range on g12a/sm1 * Improve axg-audio controller error on deferral * Add NNA clocks on g12a -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9OFZrhjz9W1fG7cb5vwPHDfy2oUFAmDBGeIACgkQ5vwPHDfy 2oVCURAAoeOtE20qJbw3Npjnar5Je73aN5v4EVW2ky8FOhxQk4kZ58sucQvgF5Co 1d6tiFSm49LtyDsYEEa9ewXwKomc/NyUSM00REgcNMsxGRTaGq74/LO7KWbXlobX aIFDe66DLFL453e1wzSPauSHl8MK4NL+WBh4uB4FgG2dveY+B7I7iic7uWojXBwl WN6xAUBe8wQKuvv0wpkdnRcLhU0kw1dtA8uV5CnMlcrDft2I3zzOzzKNUAGNSSy3 kry3amveSF9TZp9AcT2oV5Fp6qMu3gHvCSJOvCbr7EUjl+pFgEaWm/OeiseqpA8c dhFUyIY66m5/3L06An3DZtjcEuWbsFhj9l5gDSd7qmw3ALof08e+JXRDr/tvj9zo j9rwpm7hFpxjZYbcBeJmlU2KGAb+m4WR8j12LFyXVOMRSjxTM3lETJxWP3KoHMId X8vY2K+BpIADfTw7g9Zt2o4WJago+aKyTU0RLZiqQHWWUK/i9ZhjOyKxVcfho7Uz kQduNWn+UkF3QuCQEKkqooRNo8z4Cki9LxtSx07QQiQYZXrTqGMVbgfcLSOjSi+W vZNK8Ka8ZwAty4+H1Hwd5CdiwDvAbRw0ZO7/vkLe/Z7TEL+QTWYOXNt0yo+wZMkl hqbdyxgmfonAT7iozjyzOA8vShyM8a6O0Wet1fsTWJbR4x29voQ= =AEVb -----END PGP SIGNATURE----- Merge tag 'clk-meson-v5.14-1' of https://github.com/BayLibre/clk-meson into clk-amlogic Pull Amlogic clk driver updates from Jerome Brunet: - Use determine_rate() for the pll ops instead of round_rate() - Restrict gp0/1 and audio plls range on g12a/sm1 - Improve axg-audio controller error on deferral - Add NNA clocks on g12a * tag 'clk-meson-v5.14-1' of https://github.com/BayLibre/clk-meson: clk: meson: g12a: Add missing NNA source clocks for g12b clk: meson: axg-audio: improve deferral handling clk: meson: g12a: fix gp0 and hifi ranges clk: meson: pll: switch to determine_rate for the PLL ops
This commit is contained in:
commit
686f225039
@ -1665,8 +1665,7 @@ static int devm_clk_get_enable(struct device *dev, char *id)
|
||||
clk = devm_clk_get(dev, id);
|
||||
if (IS_ERR(clk)) {
|
||||
ret = PTR_ERR(clk);
|
||||
if (ret != -EPROBE_DEFER)
|
||||
dev_err(dev, "failed to get %s", id);
|
||||
dev_err_probe(dev, ret, "failed to get %s", id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1811,7 +1810,7 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
|
||||
|
||||
ret = device_reset(dev);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to reset device\n");
|
||||
dev_err_probe(dev, ret, "failed to reset device\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -242,8 +242,8 @@ static int meson_clk_get_pll_settings(unsigned long rate,
|
||||
return best ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
static long meson_clk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long *parent_rate)
|
||||
static int meson_clk_pll_determine_rate(struct clk_hw *hw,
|
||||
struct clk_rate_request *req)
|
||||
{
|
||||
struct clk_regmap *clk = to_clk_regmap(hw);
|
||||
struct meson_clk_pll_data *pll = meson_clk_pll_data(clk);
|
||||
@ -251,22 +251,26 @@ static long meson_clk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long round;
|
||||
int ret;
|
||||
|
||||
ret = meson_clk_get_pll_settings(rate, *parent_rate, &m, &n, pll);
|
||||
ret = meson_clk_get_pll_settings(req->rate, req->best_parent_rate,
|
||||
&m, &n, pll);
|
||||
if (ret)
|
||||
return meson_clk_pll_recalc_rate(hw, *parent_rate);
|
||||
return ret;
|
||||
|
||||
round = __pll_params_to_rate(*parent_rate, m, n, 0, pll);
|
||||
round = __pll_params_to_rate(req->best_parent_rate, m, n, 0, pll);
|
||||
|
||||
if (!MESON_PARM_APPLICABLE(&pll->frac) || rate == round)
|
||||
return round;
|
||||
if (!MESON_PARM_APPLICABLE(&pll->frac) || req->rate == round) {
|
||||
req->rate = round;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* The rate provided by the setting is not an exact match, let's
|
||||
* try to improve the result using the fractional parameter
|
||||
*/
|
||||
frac = __pll_params_with_frac(rate, *parent_rate, m, n, pll);
|
||||
frac = __pll_params_with_frac(req->rate, req->best_parent_rate, m, n, pll);
|
||||
req->rate = __pll_params_to_rate(req->best_parent_rate, m, n, frac, pll);
|
||||
|
||||
return __pll_params_to_rate(*parent_rate, m, n, frac, pll);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int meson_clk_pll_wait_lock(struct clk_hw *hw)
|
||||
@ -419,7 +423,7 @@ static int meson_clk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
*/
|
||||
const struct clk_ops meson_clk_pcie_pll_ops = {
|
||||
.recalc_rate = meson_clk_pll_recalc_rate,
|
||||
.round_rate = meson_clk_pll_round_rate,
|
||||
.determine_rate = meson_clk_pll_determine_rate,
|
||||
.is_enabled = meson_clk_pll_is_enabled,
|
||||
.enable = meson_clk_pcie_pll_enable,
|
||||
.disable = meson_clk_pll_disable
|
||||
@ -429,7 +433,7 @@ EXPORT_SYMBOL_GPL(meson_clk_pcie_pll_ops);
|
||||
const struct clk_ops meson_clk_pll_ops = {
|
||||
.init = meson_clk_pll_init,
|
||||
.recalc_rate = meson_clk_pll_recalc_rate,
|
||||
.round_rate = meson_clk_pll_round_rate,
|
||||
.determine_rate = meson_clk_pll_determine_rate,
|
||||
.set_rate = meson_clk_pll_set_rate,
|
||||
.is_enabled = meson_clk_pll_is_enabled,
|
||||
.enable = meson_clk_pll_enable,
|
||||
|
@ -1603,7 +1603,7 @@ static struct clk_regmap g12b_cpub_clk_trace = {
|
||||
};
|
||||
|
||||
static const struct pll_mult_range g12a_gp0_pll_mult_range = {
|
||||
.min = 55,
|
||||
.min = 125,
|
||||
.max = 255,
|
||||
};
|
||||
|
||||
@ -4723,6 +4723,12 @@ static struct clk_hw_onecell_data g12b_hw_onecell_data = {
|
||||
[CLKID_SPICC1_SCLK_SEL] = &g12a_spicc1_sclk_sel.hw,
|
||||
[CLKID_SPICC1_SCLK_DIV] = &g12a_spicc1_sclk_div.hw,
|
||||
[CLKID_SPICC1_SCLK] = &g12a_spicc1_sclk.hw,
|
||||
[CLKID_NNA_AXI_CLK_SEL] = &sm1_nna_axi_clk_sel.hw,
|
||||
[CLKID_NNA_AXI_CLK_DIV] = &sm1_nna_axi_clk_div.hw,
|
||||
[CLKID_NNA_AXI_CLK] = &sm1_nna_axi_clk.hw,
|
||||
[CLKID_NNA_CORE_CLK_SEL] = &sm1_nna_core_clk_sel.hw,
|
||||
[CLKID_NNA_CORE_CLK_DIV] = &sm1_nna_core_clk_div.hw,
|
||||
[CLKID_NNA_CORE_CLK] = &sm1_nna_core_clk.hw,
|
||||
[CLKID_MIPI_DSI_PXCLK_SEL] = &g12a_mipi_dsi_pxclk_sel.hw,
|
||||
[CLKID_MIPI_DSI_PXCLK_DIV] = &g12a_mipi_dsi_pxclk_div.hw,
|
||||
[CLKID_MIPI_DSI_PXCLK] = &g12a_mipi_dsi_pxclk.hw,
|
||||
|
Loading…
Reference in New Issue
Block a user