Lines Matching refs: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
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()
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
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()
269 unsigned long rate = ccu_mp_recalc_rate(hw, parent_rate); in ccu_mp_mmc_recalc_rate() local
274 return rate / 2; in ccu_mp_mmc_recalc_rate()
275 return rate; in ccu_mp_mmc_recalc_rate()
287 req->rate *= 2; in ccu_mp_mmc_determine_rate()
296 req->rate /= 2; in ccu_mp_mmc_determine_rate()
304 static int ccu_mp_mmc_set_rate(struct clk_hw *hw, unsigned long rate, in ccu_mp_mmc_set_rate() argument
311 rate *= 2; in ccu_mp_mmc_set_rate()
313 return ccu_mp_set_rate(hw, rate, parent_rate); in ccu_mp_mmc_set_rate()