]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
omap2 clock: fix incorrect rate calculation for osc_ck, sys_ck
authorPaul Walmsley <paul@pwsan.com>
Thu, 2 Aug 2007 18:10:04 +0000 (12:10 -0600)
committerTony Lindgren <tony@atomide.com>
Fri, 10 Aug 2007 09:34:45 +0000 (02:34 -0700)
omap2_get_crystal_rate() calculates osc_ck and sys_ck rates
incorrectly.  osc_ck runs at the same rate as the external clock
source.  Also, sys_ck's rate derives from osc_ck's rate, divided (not
multiplied) by PRCM_CLKSRC_CTRL:SYSCLKDIV.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/clock.c

index 8afdde5675f7ba8f2c7d94830480f325faaf6f61..e23ddf5f2e6368daf9593ac705ce10086de2f996 100644 (file)
@@ -1126,8 +1126,8 @@ static void __init omap2_get_crystal_rate(struct clk *osc, struct clk *sys)
        div &= OMAP_SYSCLKDIV_MASK;
        div >>= sys->rate_offset;
 
-       osc->rate = sclk * div;
-       sys->rate = sclk;
+       osc->rate = sclk;
+       sys->rate = osc->rate / div;
 }
 
 /*