Lines Matching full:rate
13 static void 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()
42 unsigned long rate, in ccu_mp_find_best_with_parent_adj() argument
56 * unsigned long in rate * m * p below in ccu_mp_find_best_with_parent_adj()
59 maxdiv = min(ULONG_MAX / rate, maxdiv); in ccu_mp_find_best_with_parent_adj()
68 if (rate * div == parent_rate_saved) { in ccu_mp_find_best_with_parent_adj()
71 * rate can be divided from parent clock without in ccu_mp_find_best_with_parent_adj()
72 * needing to change parent rate, so return the in ccu_mp_find_best_with_parent_adj()
76 return rate; in ccu_mp_find_best_with_parent_adj()
79 parent_rate = clk_hw_round_rate(hw, rate * div); in ccu_mp_find_best_with_parent_adj()
82 if (now <= rate && now > best_rate) { in ccu_mp_find_best_with_parent_adj()
86 if (now == rate) in ccu_mp_find_best_with_parent_adj()
87 return rate; in ccu_mp_find_best_with_parent_adj()
98 unsigned long rate, in ccu_mp_round_rate() argument
106 rate *= cmp->fixed_post_div; in ccu_mp_round_rate()
112 ccu_mp_find_best(*parent_rate, rate, max_m, max_p, &m, &p); in ccu_mp_round_rate()
113 rate = *parent_rate / p / m; in ccu_mp_round_rate()
115 rate = ccu_mp_find_best_with_parent_adj(hw, parent_rate, rate, in ccu_mp_round_rate()
120 rate /= cmp->fixed_post_div; in ccu_mp_round_rate()
122 return rate; in ccu_mp_round_rate()
150 unsigned long rate; in ccu_mp_recalc_rate() local
169 rate = (parent_rate >> p) / m; in ccu_mp_recalc_rate()
171 rate /= cmp->fixed_post_div; in ccu_mp_recalc_rate()
173 return rate; in ccu_mp_recalc_rate()
185 static int ccu_mp_set_rate(struct clk_hw *hw, unsigned long rate, in ccu_mp_set_rate() argument
201 /* Adjust target rate according to post-dividers */ in ccu_mp_set_rate()
203 rate = rate * cmp->fixed_post_div; in ccu_mp_set_rate()
205 ccu_mp_find_best(parent_rate, rate, max_m, max_p, &m, &p); in ccu_mp_set_rate()
259 * mode is active, the clock output rate is halved. This new class
270 unsigned long rate = ccu_mp_recalc_rate(hw, parent_rate); in ccu_mp_mmc_recalc_rate() local
275 return rate / 2; in ccu_mp_mmc_recalc_rate()
276 return rate; in ccu_mp_mmc_recalc_rate()
286 /* adjust the requested clock rate */ in ccu_mp_mmc_determine_rate()
288 req->rate *= 2; in ccu_mp_mmc_determine_rate()
295 /* re-adjust the requested clock rate back */ in ccu_mp_mmc_determine_rate()
297 req->rate /= 2; in ccu_mp_mmc_determine_rate()
305 static int ccu_mp_mmc_set_rate(struct clk_hw *hw, unsigned long rate, in ccu_mp_mmc_set_rate() argument
312 rate *= 2; in ccu_mp_mmc_set_rate()
314 return ccu_mp_set_rate(hw, rate, parent_rate); in ccu_mp_mmc_set_rate()