/* do not look for a rate that is outside of our range */ if (gck->range.max && req->rate > gck->range.max)
req->rate = gck->range.max; if (gck->range.min && req->rate < gck->range.min)
req->rate = gck->range.min;
for (i = 0; i < clk_hw_get_num_parents(hw); i++) { if (gck->chg_pid == i) continue;
parent = clk_hw_get_parent_by_index(hw, i); if (!parent) continue;
/* * The audio_pll rate can be modified, unlike the five others clocks * that should never be altered. * The audio_pll can technically be used by multiple consumers. However, * with the rate locking, the first consumer to enable to clock will be * the one definitely setting the rate of the clock. * Since audio IPs are most likely to request the same rate, we enforce * that the only clks able to modify gck rate are those of audio IPs.
*/
if (gck->chg_pid < 0) goto end;
parent = clk_hw_get_parent_by_index(hw, gck->chg_pid); if (!parent) goto end;
for (div = 1; div < GENERATED_MAX_DIV + 2; div++) { struct clk_rate_request req_parent;
/* No modification of hardware as we have the flag CLK_SET_PARENT_GATE set */ staticint clk_generated_set_parent(struct clk_hw *hw, u8 index)
{ struct clk_generated *gck = to_clk_generated(hw);
if (index >= clk_hw_get_num_parents(hw)) return -EINVAL;
/* No modification of hardware as we have the flag CLK_SET_RATE_GATE set */ staticint clk_generated_set_rate(struct clk_hw *hw, unsignedlong rate, unsignedlong parent_rate)
{ struct clk_generated *gck = to_clk_generated(hw);
u32 div;
if (!rate) return -EINVAL;
if (gck->range.max && rate > gck->range.max) return -EINVAL;
div = DIV_ROUND_CLOSEST(parent_rate, rate); if (div > GENERATED_MAX_DIV + 1 || !div) return -EINVAL;
/** * clk_generated_startup - Initialize a given clock to its default parent and * divisor parameter. * * @gck: Generated clock to set the startup parameters for. * * Take parameters from the hardware and update local clock configuration * accordingly.
*/ staticvoid clk_generated_startup(struct clk_generated *gck)
{
u32 tmp; unsignedlong flags;
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.