aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChaithrika U S <chaithrika@ti.com>2009-12-15 07:32:58 -0500
committerKevin Hilman <khilman@deeprootsystems.com>2010-02-04 16:29:53 -0500
commit679f9218cac9e7d63ae3868c0c71b45b1ba5f766 (patch)
treeba2d016f61656f2c0421eb3e8b1e83e955b50dea
parentad021ae8862209864dc8ebd3b7d3a55ce84b9ea2 (diff)
davinci: clock: Check CLK_PSC flag before disabling PSC
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>
-rw-r--r--arch/arm/mach-davinci/clock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index a19bab18318a..123839332d50 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -49,7 +49,8 @@ static void __clk_disable(struct clk *clk)
49{ 49{
50 if (WARN_ON(clk->usecount == 0)) 50 if (WARN_ON(clk->usecount == 0))
51 return; 51 return;
52 if (--clk->usecount == 0 && !(clk->flags & CLK_PLL)) 52 if (--clk->usecount == 0 && !(clk->flags & CLK_PLL) &&
53 (clk->flags & CLK_PSC))
53 davinci_psc_config(psc_domain(clk), clk->gpsc, clk->lpsc, 0); 54 davinci_psc_config(psc_domain(clk), clk->gpsc, clk->lpsc, 0);
54 if (clk->parent) 55 if (clk->parent)
55 __clk_disable(clk->parent); 56 __clk_disable(clk->parent);