Lines Matching full:clocks
402 u64 clocks; in mpc52xx_gpt_do_start() local
414 /* Determine the number of clocks in the requested period. 64 bit in mpc52xx_gpt_do_start()
418 clocks = period * (u64)gpt->ipb_freq; in mpc52xx_gpt_do_start()
419 do_div(clocks, 1000000000); /* Scale it down to ns range */ in mpc52xx_gpt_do_start()
422 if (clocks > 0xffffffff) in mpc52xx_gpt_do_start()
425 /* Calculate the prescaler and count values from the clocks value. in mpc52xx_gpt_do_start()
426 * 'clocks' is the number of clock ticks in the period. The timer in mpc52xx_gpt_do_start()
428 * calculated by integer dividing the clocks by 0x10000 (shifting in mpc52xx_gpt_do_start()
429 * down 16 bits) to obtain the smallest possible divisor for clocks in mpc52xx_gpt_do_start()
437 prescale = (clocks >> 16) + 1; in mpc52xx_gpt_do_start()
438 do_div(clocks, prescale); in mpc52xx_gpt_do_start()
439 if (clocks > 0xffff) { in mpc52xx_gpt_do_start()
440 pr_err("calculation error; prescale:%x clocks:%llx\n", in mpc52xx_gpt_do_start()
441 prescale, clocks); in mpc52xx_gpt_do_start()
453 out_be32(&gpt->regs->count, prescale << 16 | clocks); in mpc52xx_gpt_do_start()