summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/clock.c
diff options
context:
space:
mode:
authorPhilip Avinash <avinashphilip@ti.com>2013-03-25 15:07:48 +0530
committerSekhar Nori <nsekhar@ti.com>2013-04-01 16:54:47 +0530
commitc6007ffe842892484027a40b6ac18d29ac11e2ce (patch)
treed24db9aab259a37ae6de4203a420e77bffe45bdf /arch/arm/mach-davinci/clock.c
parent07961ac7c0ee8b546658717034fe692fd12eefa9 (diff)
downloadblackbird-op-linux-c6007ffe842892484027a40b6ac18d29ac11e2ce.tar.gz
blackbird-op-linux-c6007ffe842892484027a40b6ac18d29ac11e2ce.zip
ARM: davinci: clk framework support for enable/disable functionality
DaVinci clock implementation does not support clock enable/disable functionality on non-PSC clock nodes. On DA850 SoC, EHRPWM module requires support for enable/disable of TBCLK controlled using a system module register. This patch adds a method for enabling/disabling non-PSC clocks into DaVinci clock implementation. Signed-off-by: Philip Avinash <avinashphilip@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'arch/arm/mach-davinci/clock.c')
-rw-r--r--arch/arm/mach-davinci/clock.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index d458558ee84a..dc9a470ff9c5 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -35,19 +35,26 @@ static void __clk_enable(struct clk *clk)
{
if (clk->parent)
__clk_enable(clk->parent);
- if (clk->usecount++ == 0 && (clk->flags & CLK_PSC))
- davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
- true, clk->flags);
+ if (clk->usecount++ == 0) {
+ if (clk->flags & CLK_PSC)
+ davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
+ true, clk->flags);
+ else if (clk->clk_enable)
+ clk->clk_enable(clk);
+ }
}
static void __clk_disable(struct clk *clk)
{
if (WARN_ON(clk->usecount == 0))
return;
- if (--clk->usecount == 0 && !(clk->flags & CLK_PLL) &&
- (clk->flags & CLK_PSC))
- davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
- false, clk->flags);
+ if (--clk->usecount == 0) {
+ if (!(clk->flags & CLK_PLL) && (clk->flags & CLK_PSC))
+ davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
+ false, clk->flags);
+ else if (clk->clk_disable)
+ clk->clk_disable(clk);
+ }
if (clk->parent)
__clk_disable(clk->parent);
}
OpenPOWER on IntegriCloud