]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
omap2: use symbolic constant to mark parent-controlled clocks in clock.[ch]
authorPaul Walmsley <paul@pwsan.com>
Thu, 3 May 2007 23:23:27 +0000 (23:23 +0000)
committerTony Lindgren <tony@atomide.com>
Thu, 3 May 2007 23:24:22 +0000 (23:24 +0000)
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 <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/clock.c
arch/arm/mach-omap2/clock.h

index f19e2387e20171446d63a4db7c0e2b0a69a6d949..d60d1717f1ff504cc92910b7c3b856fc0f94ec66 100644 (file)
@@ -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);
index 969fc8c5ddab8f850865fd4344e4eb7e145983bc..ba26e16fd5765e9b663c1f2b0cb747806c7cb4d4 100644 (file)
@@ -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 */