]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
omap2 clock: return -EINVAL if no clock enable code; fix dpll_ck enable
authorPaul Walmsley <paul@pwsan.com>
Thu, 2 Aug 2007 18:10:17 +0000 (12:10 -0600)
committerTony Lindgren <tony@atomide.com>
Fri, 10 Aug 2007 09:36:07 +0000 (02:36 -0700)
If the clock framework can't figure out how to enable a clock, return
-EINVAL to indicate that the clock cannot be enabled.  Previously the
code returned 0, which indicated success.

Also fix the "clock.c: Enable for dpll_ck without enable code" boot
warning by marking dpll_ck as ALWAYS_ENABLED.  This is not technically
true, since the DPLL can be bypassed; but since we currently have no
software infrastructure to control it directly, ALWAYS_ENABLED is a
sufficient fiction for dpll_ck.

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 ede0dd5e9450b4098127ad12e801b7e463492423..c30388759070e2d18f923f1b9a64bebf3ffe8edd 100644 (file)
@@ -218,7 +218,7 @@ static int _omap2_clk_enable(struct clk * clk)
        if (unlikely(clk->enable_reg == 0)) {
                printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
                       clk->name);
-               return 0;
+               return -EINVAL;
        }
 
        if (clk->enable_reg == OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN)) {
@@ -259,8 +259,15 @@ static void _omap2_clk_disable(struct clk *clk)
                return;
        }
 
-       if (clk->enable_reg == 0)
+       if (clk->enable_reg == 0) {
+               /*
+                * 'Independent' here refers to a clock which is not
+                * controlled by its parent.
+                */
+               printk(KERN_ERR "clock: clk_disable called on independent "
+                      "clock %s which has no enable_reg\n", clk->name);
                return;
+       }
 
        if (clk->enable_reg == OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN)) {
                omap2_clk_fixed_disable(clk);
index 4df1d64cfa9d98739326593dbe141621dd0e4c7a..76ac124733ff8ee75d06cb69dc72756be5a96238 100644 (file)
@@ -630,7 +630,8 @@ static struct clk dpll_ck = {
        .name           = "dpll_ck",
        .parent         = &sys_ck,              /* Can be func_32k also */
        .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_PROPAGATES | RATE_CKCTL | CM_PLL_SEL1,
+                               RATE_PROPAGATES | RATE_CKCTL | CM_PLL_SEL1 |
+                               ALWAYS_ENABLED,
        .recalc         = &omap2_clksel_recalc,
 };