Lines Matching refs:rate

171 	u64 rate;  in ti_fapll_recalc_rate()  local
176 rate = parent_rate; in ti_fapll_recalc_rate()
182 do_div(rate, fapll_p); in ti_fapll_recalc_rate()
185 rate *= fapll_n; in ti_fapll_recalc_rate()
187 return rate; in ti_fapll_recalc_rate()
200 static int ti_fapll_set_div_mult(unsigned long rate, in ti_fapll_set_div_mult() argument
210 if (rate < parent_rate) { in ti_fapll_set_div_mult()
215 *mult_n = rate / parent_rate; in ti_fapll_set_div_mult()
223 static long ti_fapll_round_rate(struct clk_hw *hw, unsigned long rate, in ti_fapll_round_rate() argument
229 if (!rate) in ti_fapll_round_rate()
232 error = ti_fapll_set_div_mult(rate, *parent_rate, in ti_fapll_round_rate()
237 rate = *parent_rate / pre_div_p; in ti_fapll_round_rate()
238 rate *= mult_n; in ti_fapll_round_rate()
240 return rate; in ti_fapll_round_rate()
243 static int ti_fapll_set_rate(struct clk_hw *hw, unsigned long rate, in ti_fapll_set_rate() argument
250 if (!rate) in ti_fapll_set_rate()
253 error = ti_fapll_set_div_mult(rate, parent_rate, in ti_fapll_set_rate()
317 u64 rate; in ti_fapll_synth_recalc_rate() local
331 rate = parent_rate; in ti_fapll_synth_recalc_rate()
345 rate *= 10000000; in ti_fapll_synth_recalc_rate()
346 do_div(rate, synth_div_freq); in ti_fapll_synth_recalc_rate()
347 rate *= SYNTH_PHASE_K; in ti_fapll_synth_recalc_rate()
353 return DIV_ROUND_UP_ULL(rate, synth_div_m); in ti_fapll_synth_recalc_rate()
371 unsigned long rate, in ti_fapll_synth_set_frac_rate() argument
376 post_div_m = DIV_ROUND_UP_ULL((u64)parent_rate * SYNTH_PHASE_K, rate); in ti_fapll_synth_set_frac_rate()
387 rate * post_div_m); in ti_fapll_synth_set_frac_rate()
408 static long ti_fapll_synth_round_rate(struct clk_hw *hw, unsigned long rate, in ti_fapll_synth_round_rate() argument
415 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_round_rate()
424 synth_post_div_m = DIV_ROUND_UP(frac_rate, rate); in ti_fapll_synth_round_rate()
430 if (rate > r) in ti_fapll_synth_round_rate()
434 if (rate < r) in ti_fapll_synth_round_rate()
437 r = rate; in ti_fapll_synth_round_rate()
442 static int ti_fapll_synth_set_rate(struct clk_hw *hw, unsigned long rate, in ti_fapll_synth_set_rate() argument
450 if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) in ti_fapll_synth_set_rate()
455 if (frac_rate < rate) { in ti_fapll_synth_set_rate()
459 post_div_m = DIV_ROUND_UP(frac_rate, rate); in ti_fapll_synth_set_rate()
467 if ((post_rate != rate) && synth->freq) in ti_fapll_synth_set_rate()
469 rate, in ti_fapll_synth_set_rate()