/* * This clock notifier is called when the frequency of a PLL clock is * changed. In common PLL designs, changes to the dividers take effect * almost immediately, while changes to the multipliers (implemented * as dividers in the feedback loop) take a few cycles to work into * the feedback loop for the PLL to stabilize. * * Sometimes when the PLL clock rate is changed, the decrease in the * divider is too much for the decrease in the multiplier to catch up. * The PLL clock rate will spike, and in some cases, might lock up * completely. * * This notifier callback will gate and then ungate the clock, * effectively resetting it, so it proceeds to work. Care must be * taken to reparent consumers to other temporary clocks during the * rate change, and that this notifier callback must be the first * to be registered.
*/ staticint ccu_pll_notifier_cb(struct notifier_block *nb, unsignedlong event, void *data)
{ struct ccu_pll_nb *pll = to_ccu_pll_nb(nb); int ret = 0;
for (i = 0; i < desc->num_ccu_clks; i++) { struct ccu_common *cclk = desc->ccu_clks[i];
if (!cclk) continue;
cclk->base = reg;
cclk->lock = &ccu->lock;
}
for (i = 0; i < desc->hw_clks->num ; i++) { struct clk_hw *hw = desc->hw_clks->hws[i]; constchar *name;
if (!hw) continue;
name = hw->init->name; if (dev)
ret = clk_hw_register(dev, hw); else
ret = of_clk_hw_register(node, hw); if (ret) {
pr_err("Couldn't register clock %d - %s\n", i, name); goto err_clk_unreg;
}
}
for (i = 0; i < desc->num_ccu_clks; i++) { struct ccu_common *cclk = desc->ccu_clks[i];
if (!cclk) continue;
if (cclk->max_rate)
clk_hw_set_rate_range(&cclk->hw, cclk->min_rate,
cclk->max_rate); else
WARN(cclk->min_rate, "No max_rate, ignoring min_rate of clock %d - %s\n",
i, clk_hw_get_name(&cclk->hw));
}
ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get,
desc->hw_clks); if (ret) goto err_clk_unreg;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.