Lines Matching refs:timer_freq
1186 static u32 check_clock(u32 timer_freq, u32 rate, u32 a, u32 b, u32 c, in check_clock() argument
1193 new_rate = timer_freq * (u64)(c + 1); in check_clock()
1205 static void find_best_clock(u32 timer_freq, u32 rate, u32 *best, u32 *reg) in find_best_clock() argument
1209 a = timer_freq / rate; in find_best_clock()
1212 check_clock(timer_freq, rate, 0x3FF, 1, 1, best, &diff, reg); in find_best_clock()
1217 rate = timer_freq; in find_best_clock()
1220 if (rate * a == timer_freq) { /* don't divide by 0 later */ in find_best_clock()
1221 check_clock(timer_freq, rate, a - 1, 1, 1, best, &diff, reg); in find_best_clock()
1227 do_div(c, timer_freq - rate * a); in find_best_clock()
1231 !check_clock(timer_freq, rate, a - 1, 1, 1, best, in find_best_clock()
1234 check_clock(timer_freq, rate, a, b, 0xFFF, best, in find_best_clock()
1238 if (!check_clock(timer_freq, rate, a, b, c, best, &diff, reg)) in find_best_clock()
1240 if (!check_clock(timer_freq, rate, a, b, c + 1, best, &diff, in find_best_clock()
1292 find_best_clock(port->plat->timer_freq, in hss_hdlc_ioctl()