/* Wait for PLL to lock. */ if (hd->status_reg) /* * Busy wait. Should never timeout, we add a timeout to * prevent any sort of stall.
*/
regmap_read_poll_timeout(regmap, hd->status_reg, val,
!(val & BIT(hd->lock_bit)), 0,
100 * USEC_PER_MSEC); else
udelay(60);
/* * For optimization reasons, assumes no downstream clocks are actively using * it.
*/ staticint clk_hfpll_set_rate(struct clk_hw *hw, unsignedlong rate, unsignedlong parent_rate)
{ struct clk_hfpll *h = to_clk_hfpll(hw); struct hfpll_data const *hd = h->d; struct regmap *regmap = h->clkr.regmap; unsignedlong flags;
u32 l_val, val; bool enabled;
l_val = rate / parent_rate;
spin_lock_irqsave(&h->lock, flags);
enabled = __clk_is_enabled(hw->clk); if (enabled)
__clk_hfpll_disable(h);
/* Pick the right VCO. */ if (hd->user_reg && hd->user_vco_mask) {
regmap_read(regmap, hd->user_reg, &val); if (rate <= hd->low_vco_max_rate)
val &= ~hd->user_vco_mask; else
val |= hd->user_vco_mask;
regmap_write(regmap, hd->user_reg, val);
}
if (hd->status_reg) {
regmap_read(regmap, hd->status_reg, &status); if (!(status & BIT(hd->lock_bit))) {
WARN(1, "HFPLL %s is ON, but not locked!\n",
__clk_get_name(hw->clk));
clk_hfpll_disable(hw);
__clk_hfpll_init_once(hw);
}
}
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.