From: Paul Walmsley Date: Thu, 3 May 2007 23:23:27 +0000 (+0000) Subject: omap2: use symbolic constant to mark parent-controlled clocks in clock.[ch] X-Git-Tag: v2.6.21-omap1~15 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=125e9be661e18399133e9124af724e0d286a7143;p=linux-2.6-omap-h63xx.git omap2: use symbolic constant to mark parent-controlled clocks in clock.[ch] The current OMAP2 clock management code uses a magic number, 0xff, to indicate that the clock's parent will handle enabling and disabling the clock. Move the magic number into a symbolic constant for readability. 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 f19e2387e20..d60d1717f1f 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -97,7 +97,7 @@ static void omap2_clk_fixed_enable(struct clk *clk) { u32 cval, i=0; - if (clk->enable_bit == 0xff) /* Parent will do it */ + if (clk->enable_bit == PARENT_CONTROLS_CLOCK) /* Parent will do it */ return; cval = CM_CLKEN_PLL; @@ -205,8 +205,8 @@ static void omap2_clk_fixed_disable(struct clk *clk) { u32 cval; - if(clk->enable_bit == 0xff) /* let parent off do it */ - return; + if (clk->enable_bit == PARENT_CONTROLS_CLOCK) + return; /* let parent off do it */ cval = CM_CLKEN_PLL; cval &= ~(0x3 << clk->enable_bit); diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index 969fc8c5dda..ba26e16fd57 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h @@ -29,6 +29,8 @@ static void omap2_sys_clk_recalc(struct clk * clk); static u32 omap2_clksel_to_divisor(u32 div_sel, u32 field_val); static u32 omap2_clksel_get_divisor(struct clk *clk); +/* REVISIT: should use a clock flag for this, not a magic number */ +#define PARENT_CONTROLS_CLOCK 0xff #define RATE_IN_242X (1 << 0) #define RATE_IN_243X (1 << 1) @@ -664,7 +666,7 @@ static struct clk func_54m_ck = { RATE_FIXED | CM_PLL_SEL1 | RATE_PROPAGATES, .src_offset = 5, .enable_reg = (void __iomem *)&CM_CLKEN_PLL, - .enable_bit = 0xff, + .enable_bit = PARENT_CONTROLS_CLOCK, .recalc = &omap2_propagate_rate, }; @@ -691,7 +693,7 @@ static struct clk func_96m_ck = { .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | RATE_FIXED | RATE_PROPAGATES, .enable_reg = (void __iomem *)&CM_CLKEN_PLL, - .enable_bit = 0xff, + .enable_bit = PARENT_CONTROLS_CLOCK, .recalc = &omap2_propagate_rate, }; @@ -703,7 +705,7 @@ static struct clk func_48m_ck = { RATE_FIXED | CM_PLL_SEL1 | RATE_PROPAGATES, .src_offset = 3, .enable_reg = (void __iomem *)&CM_CLKEN_PLL, - .enable_bit = 0xff, + .enable_bit = PARENT_CONTROLS_CLOCK, .recalc = &omap2_propagate_rate, }; @@ -715,7 +717,7 @@ static struct clk func_12m_ck = { RATE_FIXED | RATE_PROPAGATES, .recalc = &omap2_propagate_rate, .enable_reg = (void __iomem *)&CM_CLKEN_PLL, - .enable_bit = 0xff, + .enable_bit = PARENT_CONTROLS_CLOCK, }; /* Secure timer, only available in secure mode */