Lines Matching refs:rate

24 	u64 rate = parent;  in ccu_nkmp_calc_rate()  local
26 rate *= n * k; in ccu_nkmp_calc_rate()
27 do_div(rate, m * p); in ccu_nkmp_calc_rate()
29 return rate; in ccu_nkmp_calc_rate()
32 static void ccu_nkmp_find_best(unsigned long parent, unsigned long rate, in ccu_nkmp_find_best() argument
49 if (tmp_rate > rate) in ccu_nkmp_find_best()
52 if ((rate - tmp_rate) < (rate - best_rate)) { in ccu_nkmp_find_best()
95 unsigned long n, m, k, p, rate; in ccu_nkmp_recalc_rate() local
121 rate = ccu_nkmp_calc_rate(parent_rate, n, k, m, 1 << p); in ccu_nkmp_recalc_rate()
123 rate /= nkmp->fixed_post_div; in ccu_nkmp_recalc_rate()
125 return rate; in ccu_nkmp_recalc_rate()
128 static long ccu_nkmp_round_rate(struct clk_hw *hw, unsigned long rate, in ccu_nkmp_round_rate() argument
135 rate *= nkmp->fixed_post_div; in ccu_nkmp_round_rate()
137 if (nkmp->max_rate && rate > nkmp->max_rate) { in ccu_nkmp_round_rate()
138 rate = nkmp->max_rate; in ccu_nkmp_round_rate()
140 rate /= nkmp->fixed_post_div; in ccu_nkmp_round_rate()
141 return rate; in ccu_nkmp_round_rate()
153 ccu_nkmp_find_best(*parent_rate, rate, &_nkmp); in ccu_nkmp_round_rate()
155 rate = ccu_nkmp_calc_rate(*parent_rate, _nkmp.n, _nkmp.k, in ccu_nkmp_round_rate()
158 rate = rate / nkmp->fixed_post_div; in ccu_nkmp_round_rate()
160 return rate; in ccu_nkmp_round_rate()
163 static int ccu_nkmp_set_rate(struct clk_hw *hw, unsigned long rate, in ccu_nkmp_set_rate() argument
173 rate = rate * nkmp->fixed_post_div; in ccu_nkmp_set_rate()
184 ccu_nkmp_find_best(parent_rate, rate, &_nkmp); in ccu_nkmp_set_rate()