Lines Matching refs:rate

131 static long vt8500_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
137 if (rate == 0)
140 divisor = *prate / rate;
142 /* If prate / rate would be decimal, incr the divisor */
143 if (rate * divisor < *prate)
157 static int vt8500_dclk_set_rate(struct clk_hw *hw, unsigned long rate,
164 if (rate == 0)
167 divisor = parent_rate / rate;
350 static int vt8500_find_pll_bits(unsigned long rate, unsigned long parent_rate,
356 if ((rate < parent_rate * 4) || (rate > parent_rate * 62)) {
357 pr_err("%s: requested rate out of range\n", __func__);
362 if (rate <= parent_rate * 31)
368 *multiplier = rate / (parent_rate / *prediv);
371 if (tclk != rate)
372 pr_warn("%s: requested rate %lu, found rate %lu\n", __func__,
373 rate, tclk);
389 static int wm8650_find_pll_bits(unsigned long rate,
395 if (!parent_rate || (rate < 37500000) || (rate > 600000000))
398 *divisor2 = rate <= 75000000 ? 3 : rate <= 150000000 ? 2 :
399 rate <= 300000000 ? 1 : 0;
402 * will be as close as possible to the requested rate.
406 O1 = rate * *divisor1 * (1 << (*divisor2));
420 pr_warn("%s: rate error is %lu\n", __func__, min_err);
452 static int wm8750_find_pll_bits(unsigned long rate, unsigned long parent_rate,
466 if (tclk > rate)
469 rate_err = rate - tclk;
487 pr_warn("%s: impossible rate %lu\n", __func__, rate);
492 pr_warn("%s: requested rate %lu, found rate %lu\n", __func__, rate,
493 rate - best_err);
500 static int wm8850_find_pll_bits(unsigned long rate, unsigned long parent_rate,
515 if (tclk > rate)
518 rate_err = rate - tclk;
535 pr_warn("%s: impossible rate %lu\n", __func__, rate);
540 pr_warn("%s: requested rate %lu, found rate %lu\n", __func__, rate,
541 rate - best_err);
546 static int vtwm_pll_set_rate(struct clk_hw *hw, unsigned long rate,
559 ret = vt8500_find_pll_bits(rate, parent_rate, &mul, &div1);
564 ret = wm8650_find_pll_bits(rate, parent_rate, &mul, &div1, &div2);
569 ret = wm8750_find_pll_bits(rate, parent_rate, &filter, &mul, &div1, &div2);
574 ret = wm8850_find_pll_bits(rate, parent_rate, &mul, &div1, &div2);
597 static long vtwm_pll_round_rate(struct clk_hw *hw, unsigned long rate,
607 ret = vt8500_find_pll_bits(rate, *prate, &mul, &div1);
612 ret = wm8650_find_pll_bits(rate, *prate, &mul, &div1, &div2);
617 ret = wm8750_find_pll_bits(rate, *prate, &filter, &mul, &div1, &div2);
622 ret = wm8850_find_pll_bits(rate, *prate, &mul, &div1, &div2);