Lines Matching full:rate

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