davinci: clock: Check CLK_PSC flag before disabling PSC
authorChaithrika U S <chaithrika@ti.com>
Tue, 15 Dec 2009 12:32:58 +0000 (18:02 +0530)
committerKevin Hilman <khilman@deeprootsystems.com>
Thu, 4 Feb 2010 21:29:53 +0000 (13:29 -0800)
Some modules do not have PSC to control their clocks.
The 'lpsc' field in the clk structure is 0 for such clocks.

In the clock disable function check for CLK PSC flag before
disabling the PSC. If this is not taken care of then it may
so happen that module controlled by LPSC 0 is erroneously disabled.

Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
arch/arm/mach-davinci/clock.c

index a19bab18318aed95536203dc6eadc7f6f0ec8699..123839332d50bfe42cc444230e9394a55d7a7687 100644 (file)
@@ -49,7 +49,8 @@ static void __clk_disable(struct clk *clk)
 {
        if (WARN_ON(clk->usecount == 0))
                return;
-       if (--clk->usecount == 0 && !(clk->flags & CLK_PLL))
+       if (--clk->usecount == 0 && !(clk->flags & CLK_PLL) &&
+           (clk->flags & CLK_PSC))
                davinci_psc_config(psc_domain(clk), clk->gpsc, clk->lpsc, 0);
        if (clk->parent)
                __clk_disable(clk->parent);