aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/clock.c
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2009-04-15 15:39:33 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-26 11:16:46 -0400
commitd81d188cafecbc9e01df51527ac4c84a5b19e033 (patch)
tree40b26ea71d32547e50913dbdc4a2adec5fc8e809 /arch/arm/mach-davinci/clock.c
parent66e0c3991c5a1735dd8add77ab8aff5005f57681 (diff)
davinci: Add support for multiple PSCs
The current code to support the DaVinci Power and Sleep Controller (PSC) assumes that there is only one controller. This assumption is no longer valid so expand the support to allow greater than one PSC. To accomplish this, put the base addresses for the PSCs in the SoC infrastructure so it can be referenced by the PSC code. This also requires adding an extra parameter to davinci_psc_config() to specify the PSC that is to be enabled/disabled. Signed-off-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/clock.c')
-rw-r--r--arch/arm/mach-davinci/clock.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index f0baaa15a57e..39bf321d70a2 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -42,7 +42,8 @@ static void __clk_enable(struct clk *clk)
42 if (clk->parent) 42 if (clk->parent)
43 __clk_enable(clk->parent); 43 __clk_enable(clk->parent);
44 if (clk->usecount++ == 0 && (clk->flags & CLK_PSC)) 44 if (clk->usecount++ == 0 && (clk->flags & CLK_PSC))
45 davinci_psc_config(psc_domain(clk), clk->lpsc, 1); 45 davinci_psc_config(psc_domain(clk), clk->psc_ctlr,
46 clk->lpsc, 1);
46} 47}
47 48
48static void __clk_disable(struct clk *clk) 49static void __clk_disable(struct clk *clk)
@@ -50,7 +51,8 @@ static void __clk_disable(struct clk *clk)
50 if (WARN_ON(clk->usecount == 0)) 51 if (WARN_ON(clk->usecount == 0))
51 return; 52 return;
52 if (--clk->usecount == 0 && !(clk->flags & CLK_PLL)) 53 if (--clk->usecount == 0 && !(clk->flags & CLK_PLL))
53 davinci_psc_config(psc_domain(clk), clk->lpsc, 0); 54 davinci_psc_config(psc_domain(clk), clk->psc_ctlr,
55 clk->lpsc, 0);
54 if (clk->parent) 56 if (clk->parent)
55 __clk_disable(clk->parent); 57 __clk_disable(clk->parent);
56} 58}
@@ -164,11 +166,11 @@ static int __init clk_disable_unused(void)
164 continue; 166 continue;
165 167
166 /* ignore if in Disabled or SwRstDisable states */ 168 /* ignore if in Disabled or SwRstDisable states */
167 if (!davinci_psc_is_clk_active(ck->lpsc)) 169 if (!davinci_psc_is_clk_active(ck->psc_ctlr, ck->lpsc))
168 continue; 170 continue;
169 171
170 pr_info("Clocks: disable unused %s\n", ck->name); 172 pr_info("Clocks: disable unused %s\n", ck->name);
171 davinci_psc_config(psc_domain(ck), ck->lpsc, 0); 173 davinci_psc_config(psc_domain(ck), ck->psc_ctlr, ck->lpsc, 0);
172 } 174 }
173 spin_unlock_irq(&clockfw_lock); 175 spin_unlock_irq(&clockfw_lock);
174 176