Lines Matching full:rate

13 static unsigned long ccu_mp_find_best(unsigned long parent, unsigned long rate,  in ccu_mp_find_best()  argument
25 if (tmp_rate > rate) in ccu_mp_find_best()
28 if ((rate - tmp_rate) < (rate - best_rate)) { in ccu_mp_find_best()
44 unsigned long rate, in ccu_mp_find_best_with_parent_adj() argument
58 * unsigned long in rate * m * p below in ccu_mp_find_best_with_parent_adj()
61 maxdiv = min(ULONG_MAX / rate, maxdiv); in ccu_mp_find_best_with_parent_adj()
70 if (rate * div == parent_rate_saved) { in ccu_mp_find_best_with_parent_adj()
73 * rate can be divided from parent clock without in ccu_mp_find_best_with_parent_adj()
74 * needing to change parent rate, so return the in ccu_mp_find_best_with_parent_adj()
78 return rate; in ccu_mp_find_best_with_parent_adj()
81 parent_rate = clk_hw_round_rate(hw, rate * div); in ccu_mp_find_best_with_parent_adj()
84 if (now <= rate && now > best_rate) { in ccu_mp_find_best_with_parent_adj()
88 if (now == rate) in ccu_mp_find_best_with_parent_adj()
89 return rate; in ccu_mp_find_best_with_parent_adj()
100 unsigned long rate, in ccu_mp_round_rate() argument
108 rate *= cmp->fixed_post_div; in ccu_mp_round_rate()
114 rate = ccu_mp_find_best(*parent_rate, rate, max_m, max_p, &m, &p); in ccu_mp_round_rate()
116 rate = ccu_mp_find_best_with_parent_adj(hw, parent_rate, rate, in ccu_mp_round_rate()
121 rate /= cmp->fixed_post_div; in ccu_mp_round_rate()
123 return rate; in ccu_mp_round_rate()
151 unsigned long rate; in ccu_mp_recalc_rate() local
170 rate = (parent_rate >> p) / m; in ccu_mp_recalc_rate()
172 rate /= cmp->fixed_post_div; in ccu_mp_recalc_rate()
174 return rate; in ccu_mp_recalc_rate()
186 static int ccu_mp_set_rate(struct clk_hw *hw, unsigned long rate, in ccu_mp_set_rate() argument
202 /* Adjust target rate according to post-dividers */ in ccu_mp_set_rate()
204 rate = rate * cmp->fixed_post_div; in ccu_mp_set_rate()
206 ccu_mp_find_best(parent_rate, rate, max_m, max_p, &m, &p); in ccu_mp_set_rate()
260 * mode is active, the clock output rate is halved. This new class
271 unsigned long rate = ccu_mp_recalc_rate(hw, parent_rate); in ccu_mp_mmc_recalc_rate() local
276 return rate / 2; in ccu_mp_mmc_recalc_rate()
277 return rate; in ccu_mp_mmc_recalc_rate()
287 /* adjust the requested clock rate */ in ccu_mp_mmc_determine_rate()
289 req->rate *= 2; in ccu_mp_mmc_determine_rate()
296 /* re-adjust the requested clock rate back */ in ccu_mp_mmc_determine_rate()
298 req->rate /= 2; in ccu_mp_mmc_determine_rate()
306 static int ccu_mp_mmc_set_rate(struct clk_hw *hw, unsigned long rate, in ccu_mp_mmc_set_rate() argument
313 rate *= 2; in ccu_mp_mmc_set_rate()
315 return ccu_mp_set_rate(hw, rate, parent_rate); in ccu_mp_mmc_set_rate()