/* * The AO Domain embeds a dual/divider to generate a more precise * 32,768KHz clock for low-power suspend mode and CEC. * ______ ______ * | | | | * | Div1 |-| Cnt1 | * /|______| |______|\ * -| ______ ______ X--> Out * \| | | |/ * | Div2 |-| Cnt2 | * |______| |______| * * The dividing can be switched to single or dual, with a counter * for each divider to set when the switching is done.
*/
staticconststruct meson_clk_dualdiv_param *
__dualdiv_get_setting(unsignedlong rate, unsignedlong parent_rate, struct meson_clk_dualdiv_data *dualdiv)
{ conststruct meson_clk_dualdiv_param *table = dualdiv->table; unsignedlong best = 0, now = 0; unsignedint i, best_i = 0;
if (!table) return NULL;
for (i = 0; table[i].n1; i++) {
now = __dualdiv_param_to_rate(parent_rate, &table[i]);
/* If we get an exact match, don't bother any further */ if (now == rate) { return &table[i];
} elseif (abs(now - rate) < abs(best - rate)) {
best = now;
best_i = i;
}
}
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.