/* Note the largest clock divider value of 0xffff corresponds to: (0xffff + 1) * 1000 / 108/2 MHz = 1,213,629.629... ns which fits in 21 bits, so we'll use unsigned int for time arguments.  */
static u16 count_to_clock_divider(unsigned int d)
/* Note the largest clock divider value of 0xffff corresponds to: (0xffff + 1) * 1000 / 108/2 MHz = 1,213,629.629... ns which fits in 21 bits, so we'll use unsigned int for time arguments.  */
static u16 count_to_clock_divider(unsigned int d)
{
	if (d > RXCLK_RCD + 1)
		d = RXCLK_RCD;
	else if (d < 2)
		d = 1;
	else
		d--;
	return (u16) d;
}