Lines Matching full:rate
20 static unsigned long ccu_mp_find_best(unsigned long parent, unsigned long rate, in ccu_mp_find_best() argument
33 if (tmp_rate > rate) in ccu_mp_find_best()
36 if ((rate - tmp_rate) < (rate - best_rate)) { in ccu_mp_find_best()
52 unsigned long rate, in ccu_mp_find_best_with_parent_adj() argument
67 * unsigned long in rate * m * p below in ccu_mp_find_best_with_parent_adj()
70 maxdiv = min(ULONG_MAX / rate, maxdiv); in ccu_mp_find_best_with_parent_adj()
79 if (rate * div == parent_rate_saved) { in ccu_mp_find_best_with_parent_adj()
82 * rate can be divided from parent clock without in ccu_mp_find_best_with_parent_adj()
83 * needing to change parent rate, so return the in ccu_mp_find_best_with_parent_adj()
87 return rate; in ccu_mp_find_best_with_parent_adj()
90 parent_rate = clk_hw_round_rate(hw, rate * div); in ccu_mp_find_best_with_parent_adj()
93 if (now <= rate && now > best_rate) { in ccu_mp_find_best_with_parent_adj()
97 if (now == rate) in ccu_mp_find_best_with_parent_adj()
98 return rate; in ccu_mp_find_best_with_parent_adj()
109 unsigned long rate, in ccu_mp_round_rate() argument
118 rate *= cmp->fixed_post_div; in ccu_mp_round_rate()
130 rate = ccu_mp_find_best(*parent_rate, rate, max_m, max_p, shift, in ccu_mp_round_rate()
133 rate = ccu_mp_find_best_with_parent_adj(hw, parent_rate, rate, in ccu_mp_round_rate()
138 rate /= cmp->fixed_post_div; in ccu_mp_round_rate()
140 return rate; in ccu_mp_round_rate()
168 unsigned long rate; in ccu_mp_recalc_rate() local
188 rate = (parent_rate / p) / m; in ccu_mp_recalc_rate()
190 rate = (parent_rate >> p) / m; in ccu_mp_recalc_rate()
193 rate /= cmp->fixed_post_div; in ccu_mp_recalc_rate()
195 return rate; in ccu_mp_recalc_rate()
207 static int ccu_mp_set_rate(struct clk_hw *hw, unsigned long rate, in ccu_mp_set_rate() argument
230 /* Adjust target rate according to post-dividers */ in ccu_mp_set_rate()
232 rate = rate * cmp->fixed_post_div; in ccu_mp_set_rate()
234 ccu_mp_find_best(parent_rate, rate, max_m, max_p, shift, &m, &p); in ccu_mp_set_rate()
291 * mode is active, the clock output rate is halved. This new class
302 unsigned long rate = ccu_mp_recalc_rate(hw, parent_rate); in ccu_mp_mmc_recalc_rate() local
307 return rate / 2; in ccu_mp_mmc_recalc_rate()
308 return rate; in ccu_mp_mmc_recalc_rate()
318 /* adjust the requested clock rate */ in ccu_mp_mmc_determine_rate()
320 req->rate *= 2; in ccu_mp_mmc_determine_rate()
327 /* re-adjust the requested clock rate back */ in ccu_mp_mmc_determine_rate()
329 req->rate /= 2; in ccu_mp_mmc_determine_rate()
337 static int ccu_mp_mmc_set_rate(struct clk_hw *hw, unsigned long rate, in ccu_mp_mmc_set_rate() argument
344 rate *= 2; in ccu_mp_mmc_set_rate()
346 return ccu_mp_set_rate(hw, rate, parent_rate); in ccu_mp_mmc_set_rate()