Lines Matching full:rate

10  * (FRAC). FRAC can output between 620 and 700MHz and only multiply the rate of
11 * its own parent. PMC and PAD can then divide the FRAC rate to best match the
12 * asked rate.
16 * rate - rate is adjustable.
17 * clk->rate = parent->rate * ((nd + 1) + (fracr / 2^22))
22 * rate - rate is adjustable.
23 * clk->rate = parent->rate / (qdpmc + 1)
28 * rate - rate is adjustable.
29 * clk->rate = parent->rate / (qdaudio * div))
216 static int clk_audio_pll_frac_compute_frac(unsigned long rate, in clk_audio_pll_frac_compute_frac() argument
223 if (!rate) in clk_audio_pll_frac_compute_frac()
226 tmp = rate; in clk_audio_pll_frac_compute_frac()
250 pr_debug("A PLL: %s, rate = %lu (parent_rate = %lu)\n", __func__, in clk_audio_pll_frac_determine_rate()
251 req->rate, req->best_parent_rate); in clk_audio_pll_frac_determine_rate()
253 req->rate = clamp(req->rate, AUDIO_PLL_FOUT_MIN, AUDIO_PLL_FOUT_MAX); in clk_audio_pll_frac_determine_rate()
258 ret = clk_audio_pll_frac_compute_frac(req->rate, req->best_parent_rate, in clk_audio_pll_frac_determine_rate()
263 req->rate = clk_audio_pll_fout(req->best_parent_rate, nd, fracr); in clk_audio_pll_frac_determine_rate()
268 __func__, req->rate, nd, fracr); in clk_audio_pll_frac_determine_rate()
273 static long clk_audio_pll_pad_round_rate(struct clk_hw *hw, unsigned long rate, in clk_audio_pll_pad_round_rate() argument
285 pr_debug("A PLL/PAD: %s, rate = %lu (parent_rate = %lu)\n", __func__, in clk_audio_pll_pad_round_rate()
286 rate, *parent_rate); in clk_audio_pll_pad_round_rate()
289 * Rate divisor is actually made of two different divisors, multiplied in clk_audio_pll_pad_round_rate()
290 * between themselves before dividing the rate. in clk_audio_pll_pad_round_rate()
292 * In order to avoid testing twice the rate divisor (e.g. divisor 12 can in clk_audio_pll_pad_round_rate()
294 * for a rate divisor when div is 2 and tmp_qd is a multiple of 3. in clk_audio_pll_pad_round_rate()
296 * would miss some rate divisor that aren't reachable with div being 2 in clk_audio_pll_pad_round_rate()
297 * (e.g. rate divisor 90 is made with div = 3 and tmp_qd = 30, thus in clk_audio_pll_pad_round_rate()
299 * rate divisor which isn't possible since tmp_qd has to be <= 31). in clk_audio_pll_pad_round_rate()
307 rate * tmp_qd * div); in clk_audio_pll_pad_round_rate()
309 tmp_diff = abs(rate - tmp_rate); in clk_audio_pll_pad_round_rate()
324 static long clk_audio_pll_pmc_round_rate(struct clk_hw *hw, unsigned long rate, in clk_audio_pll_pmc_round_rate() argument
335 pr_debug("A PLL/PMC: %s, rate = %lu (parent_rate = %lu)\n", __func__, in clk_audio_pll_pmc_round_rate()
336 rate, *parent_rate); in clk_audio_pll_pmc_round_rate()
338 if (!rate) in clk_audio_pll_pmc_round_rate()
342 div = max(best_parent_rate / rate, 1UL); in clk_audio_pll_pmc_round_rate()
344 best_parent_rate = clk_round_rate(pclk->clk, rate * div); in clk_audio_pll_pmc_round_rate()
346 tmp_diff = abs(rate - tmp_rate); in clk_audio_pll_pmc_round_rate()
364 static int clk_audio_pll_frac_set_rate(struct clk_hw *hw, unsigned long rate, in clk_audio_pll_frac_set_rate() argument
371 pr_debug("A PLL: %s, rate = %lu (parent_rate = %lu)\n", __func__, rate, in clk_audio_pll_frac_set_rate()
374 if (rate < AUDIO_PLL_FOUT_MIN || rate > AUDIO_PLL_FOUT_MAX) in clk_audio_pll_frac_set_rate()
377 ret = clk_audio_pll_frac_compute_frac(rate, parent_rate, &nd, &fracr); in clk_audio_pll_frac_set_rate()
387 static int clk_audio_pll_pad_set_rate(struct clk_hw *hw, unsigned long rate, in clk_audio_pll_pad_set_rate() argument
393 pr_debug("A PLL/PAD: %s, rate = %lu (parent_rate = %lu)\n", __func__, in clk_audio_pll_pad_set_rate()
394 rate, parent_rate); in clk_audio_pll_pad_set_rate()
396 if (!rate) in clk_audio_pll_pad_set_rate()
399 tmp_div = parent_rate / rate; in clk_audio_pll_pad_set_rate()
411 static int clk_audio_pll_pmc_set_rate(struct clk_hw *hw, unsigned long rate, in clk_audio_pll_pmc_set_rate() argument
416 if (!rate) in clk_audio_pll_pmc_set_rate()
419 pr_debug("A PLL/PMC: %s, rate = %lu (parent_rate = %lu)\n", __func__, in clk_audio_pll_pmc_set_rate()
420 rate, parent_rate); in clk_audio_pll_pmc_set_rate()
422 apmc_ck->qdpmc = parent_rate / rate - 1; in clk_audio_pll_pmc_set_rate()