]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
omap2 clock: call clock-specific enable/disable functions if present
authorPaul Walmsley <paul@pwsan.com>
Mon, 27 Aug 2007 08:39:17 +0000 (02:39 -0600)
committerTony Lindgren <tony@atomide.com>
Fri, 31 Aug 2007 18:13:43 +0000 (11:13 -0700)
Call clock-specific enable/disable functions if .enable/.disable function
pointer fields are present in struct clk.  Similar to OMAP1 clock code.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/clock.c

index f5ff8cd3977ca661e4c55229d1db145550187dca..ad84869226a3fa85b1d969eb23205dbfad18e5e8 100644 (file)
@@ -277,6 +277,9 @@ static int _omap2_clk_enable(struct clk * clk)
                return 0;
        }
 
+       if (clk->enable)
+               return clk->enable(clk);
+
        if (unlikely(clk->enable_reg == 0)) {
                printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
                       clk->name);
@@ -316,6 +319,11 @@ static void _omap2_clk_disable(struct clk *clk)
        if (clk->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK))
                return;
 
+       if (clk->disable) {
+               clk->disable(clk);
+               return;
+       }
+
        if (unlikely(clk == &osc_ck)) {
                omap2_set_osc_ck(0);
                return;