From: Paul Walmsley Date: Thu, 2 Aug 2007 18:10:04 +0000 (-0600) Subject: omap2 clock: fix incorrect rate calculation for osc_ck, sys_ck X-Git-Tag: v2.6.23-omap1~265 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=18fc252e78d914a150e278682425303c132a688d;p=linux-2.6-omap-h63xx.git omap2 clock: fix incorrect rate calculation for osc_ck, sys_ck 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 Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 8afdde5675f..e23ddf5f2e6 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -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; } /*