From 18fc252e78d914a150e278682425303c132a688d Mon Sep 17 00:00:00 2001 From: Paul Walmsley Date: Thu, 2 Aug 2007 12:10:04 -0600 Subject: [PATCH] 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 --- arch/arm/mach-omap2/clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } /* -- 2.41.1