Lines Matching refs:rate

170 	long long rate;  in ti_fapll_recalc_rate()  local
175 rate = parent_rate; in ti_fapll_recalc_rate()
181 do_div(rate, fapll_p); in ti_fapll_recalc_rate()
184 rate *= fapll_n; in ti_fapll_recalc_rate()
186 return rate; in ti_fapll_recalc_rate()
199 static int ti_fapll_set_div_mult(unsigned long rate, in ti_fapll_set_div_mult() argument
209 if (rate < parent_rate) { in ti_fapll_set_div_mult()
214 *mult_n = rate / parent_rate; in ti_fapll_set_div_mult()
222 static long ti_fapll_round_rate(struct clk_hw *hw, unsigned long rate, in ti_fapll_round_rate() argument
228 if (!rate) in ti_fapll_round_rate()
231 error = ti_fapll_set_div_mult(rate, *parent_rate, in ti_fapll_round_rate()
236 rate = *parent_rate / pre_div_p; in ti_fapll_round_rate()
237 rate *= mult_n; in ti_fapll_round_rate()
239 return rate; in ti_fapll_round_rate()
242 static int ti_fapll_set_rate(struct clk_hw *hw, unsigned long rate, in ti_fapll_set_rate() argument
249 if (!rate) in ti_fapll_set_rate()
252 error = ti_fapll_set_div_mult(rate, parent_rate, in ti_fapll_set_rate()
316 long long rate; in ti_fapll_synth_recalc_rate() local
330 rate = parent_rate; in ti_fapll_synth_recalc_rate()
344 rate *= 10000000; in ti_fapll_synth_recalc_rate()
345 do_div(rate, synth_div_freq); in ti_fapll_synth_recalc_rate()
346 rate *= SYNTH_PHASE_K; in ti_fapll_synth_recalc_rate()
352 return DIV_ROUND_UP_ULL(rate, synth_div_m); in ti_fapll_synth_recalc_rate()
370 unsigned long rate, in ti_fapll_synth_set_frac_rate() argument
375 post_div_m = DIV_ROUND_UP_ULL((u64)parent_rate * SYNTH_PHASE_K, rate); in ti_fapll_synth_set_frac_rate()
386 rate * post_div_m); in ti_fapll_synth_set_frac_rate()
407 static long ti_fapll_synth_round_rate(struct clk_hw *hw, unsigned long rate, in ti_fapll_synth_round_rate() argument
414 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_round_rate()
423 synth_post_div_m = DIV_ROUND_UP(frac_rate, rate); in ti_fapll_synth_round_rate()
429 if (rate > r) in ti_fapll_synth_round_rate()
433 if (rate < r) in ti_fapll_synth_round_rate()
436 r = rate; in ti_fapll_synth_round_rate()
441 static int ti_fapll_synth_set_rate(struct clk_hw *hw, unsigned long rate, in ti_fapll_synth_set_rate() argument
449 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_set_rate()
454 if (frac_rate < rate) { in ti_fapll_synth_set_rate()
458 post_div_m = DIV_ROUND_UP(frac_rate, rate); in ti_fapll_synth_set_rate()
466 if ((post_rate != rate) && synth->freq) in ti_fapll_synth_set_rate()
468 rate, in ti_fapll_synth_set_rate()