[U-Boot] [PATCH v2] Move ICS CLK chip frequenty calculation code into a common board library
Timur Tabi
timur.tabi at gmail.com
Mon May 24 16:52:35 CEST 2010
On Sat, May 22, 2010 at 5:36 PM, Kumar Gala <galak at kernel.crashing.org> wrote:
> +static unsigned long
> +ics307_clk_freq(unsigned char cw0, unsigned char cw1, unsigned char cw2)
You forgot to change these to u8
Also, you can declare this function as "const". You could just use
the version of this function that I posted, you just need to remove my
rounding code.
> + * Adding 1 to get a "nicely" rounded number, but this needs
> + * more tweaking to get a "properly" rounded number.
> + */
> +
> + freq = 1 + (input_freq * 2 * (vdw + 8) / ((rdw + 2) * od));
The "1 +" is wrong and should be removed. It doesn't do what the
comment says it does, and as you said earlier, rounding is wrong for
this function.
--
Timur Tabi
Linux kernel developer at Freescale
More information about the U-Boot
mailing list