Lines Matching refs:timer_freq
1231 static u32 check_clock(u32 timer_freq, u32 rate, u32 a, u32 b, u32 c, in check_clock() argument
1238 new_rate = timer_freq * (u64)(c + 1); in check_clock()
1250 static void find_best_clock(u32 timer_freq, u32 rate, u32 *best, u32 *reg) in find_best_clock() argument
1254 a = timer_freq / rate; in find_best_clock()
1257 check_clock(timer_freq, rate, 0x3FF, 1, 1, best, &diff, reg); in find_best_clock()
1262 rate = timer_freq; in find_best_clock()
1265 if (rate * a == timer_freq) { /* don't divide by 0 later */ in find_best_clock()
1266 check_clock(timer_freq, rate, a - 1, 1, 1, best, &diff, reg); in find_best_clock()
1273 do_div(c, timer_freq - rate * a); in find_best_clock()
1277 !check_clock(timer_freq, rate, a - 1, 1, 1, best, in find_best_clock()
1280 check_clock(timer_freq, rate, a, b, 0xFFF, best, in find_best_clock()
1284 if (!check_clock(timer_freq, rate, a, b, c, best, &diff, reg)) in find_best_clock()
1286 if (!check_clock(timer_freq, rate, a, b, c + 1, best, &diff, in find_best_clock()