From: Paul Walmsley Date: Thu, 2 Aug 2007 18:10:06 +0000 (-0600) Subject: omap2 clock: vlynq_fck recalc should be clksel, not followparent X-Git-Tag: v2.6.23-omap1~263 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c1b2cf16b99e46867ff3aafffce691a6cf0ecd12;p=linux-2.6-omap-h63xx.git omap2 clock: vlynq_fck recalc should be clksel, not followparent vlynq_fck is a clksel clock, so its rate is equal to its parent's rate, divided by whichever divisor is selected. But its definition in clock.h specifies omap2_followparent_recalc() as its rate calculation code, which sets the clock's rate to that of its parent without accounting for any divisor. Fix to use omap2_clksel_recalc() instead. omap2_clksel_recalc() is also missing the appropriate special case to divide the vlynq_fck rate down; add this in. 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 94e31a98697..ff7a65ecf91 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -39,6 +39,10 @@ #undef DEBUG +/* CM_CLKSEL1_CORE.CLKSEL_VLYNQ options (2420) */ +#define CLKSEL_VLYNQ_96MHZ 0 +#define CLKSEL_VLYNQ_CORECLK_16 0x10 + /* SET_PERFORMANCE_LEVEL PARAMETERS */ #define PRCM_HALF_SPEED 1 #define PRCM_FULL_SPEED 2 @@ -358,6 +362,12 @@ static void omap2_clksel_recalc(struct clk * clk) return; } + if ((clk == &vlynq_fck) && cpu_is_omap2420() && + (clksel1_core & OMAP2420_CLKSEL_VLYNQ_MASK) == CLKSEL_VLYNQ_96MHZ) { + clk->rate = func_96m_ck.rate; + return; + } + if (!fixed) { div = omap2_clksel_get_divisor(clk); if (div == 0) diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index eda904a8a4a..dd6e1d9129d 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h @@ -1824,7 +1824,7 @@ static struct clk vlynq_fck = { .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), .enable_bit = OMAP2420_EN_VLYNQ_SHIFT, .src_offset = 15, - .recalc = &omap2_followparent_recalc, + .recalc = &omap2_clksel_recalc, }; static struct clk sdrc_ick = {