Lines Matching full:rate
14 * (FRAC). FRAC can output between 620 and 700MHz and only multiply the rate of
15 * its own parent. PMC and PAD can then divide the FRAC rate to best match the
16 * asked rate.
20 * rate - rate is adjustable.
21 * clk->rate = parent->rate * ((nd + 1) + (fracr / 2^22))
26 * rate - rate is adjustable.
27 * clk->rate = parent->rate / (qdpmc + 1)
32 * rate - rate is adjustable.
33 * clk->rate = parent->rate / (qdaudio * div))
219 static int clk_audio_pll_frac_compute_frac(unsigned long rate, in clk_audio_pll_frac_compute_frac() argument
226 if (!rate) in clk_audio_pll_frac_compute_frac()
229 tmp = rate; in clk_audio_pll_frac_compute_frac()
253 pr_debug("A PLL: %s, rate = %lu (parent_rate = %lu)\n", __func__, in clk_audio_pll_frac_determine_rate()
254 req->rate, req->best_parent_rate); in clk_audio_pll_frac_determine_rate()
256 req->rate = clamp(req->rate, AUDIO_PLL_FOUT_MIN, AUDIO_PLL_FOUT_MAX); in clk_audio_pll_frac_determine_rate()
261 ret = clk_audio_pll_frac_compute_frac(req->rate, req->best_parent_rate, in clk_audio_pll_frac_determine_rate()
266 req->rate = clk_audio_pll_fout(req->best_parent_rate, nd, fracr); in clk_audio_pll_frac_determine_rate()
271 __func__, req->rate, nd, fracr); in clk_audio_pll_frac_determine_rate()
276 static long clk_audio_pll_pad_round_rate(struct clk_hw *hw, unsigned long rate, in clk_audio_pll_pad_round_rate() argument
288 pr_debug("A PLL/PAD: %s, rate = %lu (parent_rate = %lu)\n", __func__, in clk_audio_pll_pad_round_rate()
289 rate, *parent_rate); in clk_audio_pll_pad_round_rate()
292 * Rate divisor is actually made of two different divisors, multiplied in clk_audio_pll_pad_round_rate()
293 * between themselves before dividing the rate. in clk_audio_pll_pad_round_rate()
295 * In order to avoid testing twice the rate divisor (e.g. divisor 12 can in clk_audio_pll_pad_round_rate()
297 * for a rate divisor when div is 2 and tmp_qd is a multiple of 3. in clk_audio_pll_pad_round_rate()
299 * would miss some rate divisor that aren't reachable with div being 2 in clk_audio_pll_pad_round_rate()
300 * (e.g. rate divisor 90 is made with div = 3 and tmp_qd = 30, thus in clk_audio_pll_pad_round_rate()
302 * rate divisor which isn't possible since tmp_qd has to be <= 31). in clk_audio_pll_pad_round_rate()
310 rate * tmp_qd * div); in clk_audio_pll_pad_round_rate()
312 tmp_diff = abs(rate - tmp_rate); in clk_audio_pll_pad_round_rate()
327 static long clk_audio_pll_pmc_round_rate(struct clk_hw *hw, unsigned long rate, in clk_audio_pll_pmc_round_rate() argument
338 pr_debug("A PLL/PMC: %s, rate = %lu (parent_rate = %lu)\n", __func__, in clk_audio_pll_pmc_round_rate()
339 rate, *parent_rate); in clk_audio_pll_pmc_round_rate()
342 best_parent_rate = clk_round_rate(pclk->clk, rate * div); in clk_audio_pll_pmc_round_rate()
344 tmp_diff = abs(rate - tmp_rate); in clk_audio_pll_pmc_round_rate()
360 static int clk_audio_pll_frac_set_rate(struct clk_hw *hw, unsigned long rate, in clk_audio_pll_frac_set_rate() argument
367 pr_debug("A PLL: %s, rate = %lu (parent_rate = %lu)\n", __func__, rate, in clk_audio_pll_frac_set_rate()
370 if (rate < AUDIO_PLL_FOUT_MIN || rate > AUDIO_PLL_FOUT_MAX) in clk_audio_pll_frac_set_rate()
373 ret = clk_audio_pll_frac_compute_frac(rate, parent_rate, &nd, &fracr); in clk_audio_pll_frac_set_rate()
383 static int clk_audio_pll_pad_set_rate(struct clk_hw *hw, unsigned long rate, in clk_audio_pll_pad_set_rate() argument
389 pr_debug("A PLL/PAD: %s, rate = %lu (parent_rate = %lu)\n", __func__, in clk_audio_pll_pad_set_rate()
390 rate, parent_rate); in clk_audio_pll_pad_set_rate()
392 if (!rate) in clk_audio_pll_pad_set_rate()
395 tmp_div = parent_rate / rate; in clk_audio_pll_pad_set_rate()
407 static int clk_audio_pll_pmc_set_rate(struct clk_hw *hw, unsigned long rate, in clk_audio_pll_pmc_set_rate() argument
412 if (!rate) in clk_audio_pll_pmc_set_rate()
415 pr_debug("A PLL/PMC: %s, rate = %lu (parent_rate = %lu)\n", __func__, in clk_audio_pll_pmc_set_rate()
416 rate, parent_rate); in clk_audio_pll_pmc_set_rate()
418 apmc_ck->qdpmc = parent_rate / rate - 1; in clk_audio_pll_pmc_set_rate()