/* * adj_parent_rate might have been modified by our clock. * Unapply the pre-divider if there's one, and give * the actual frequency the parent needs to run at.
*/
best_parent_rate = ccu_mux_helper_unapply_prediv(common, cm, -1,
adj_parent_rate);
goto out;
}
for (i = 0; i < clk_hw_get_num_parents(hw); i++) { unsignedlong tmp_rate, parent_rate; struct clk_hw *parent;
parent = clk_hw_get_parent_by_index(hw, i); if (!parent) continue;
parent_rate = ccu_mux_helper_apply_prediv(common, cm, i,
clk_hw_get_rate(parent));
/* * parent_rate might have been modified by our clock. * Unapply the pre-divider if there's one, and give * the actual frequency the parent needs to run at.
*/
parent_rate = ccu_mux_helper_unapply_prediv(common, cm, i,
parent_rate); if (tmp_rate == req->rate) {
best_parent = parent;
best_parent_rate = parent_rate;
best_rate = tmp_rate; goto out;
}
/* The key field always reads as zero. */ if (common->features & CCU_FEATURE_KEY_FIELD)
reg |= CCU_MUX_KEY_VALUE; if (common->features & CCU_FEATURE_UPDATE_BIT)
reg |= CCU_SUNXI_UPDATE_BIT;
/* * This clock notifier is called when the frequency of the of the parent * PLL clock is to be changed. The idea is to switch the parent to a * stable clock, such as the main oscillator, while the PLL frequency * stabilizes.
*/ staticint ccu_mux_notifier_cb(struct notifier_block *nb, unsignedlong event, void *data)
{ struct ccu_mux_nb *mux = to_ccu_mux_nb(nb); int ret = 0;
if (event == PRE_RATE_CHANGE) {
mux->original_index = ccu_mux_helper_get_parent(mux->common,
mux->cm);
ret = ccu_mux_helper_set_parent(mux->common, mux->cm,
mux->bypass_index);
} elseif (event == POST_RATE_CHANGE) {
ret = ccu_mux_helper_set_parent(mux->common, mux->cm,
mux->original_index);
}
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.