summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra3_clocks.c
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-02-19 11:28:10 +0530
committerSimone Willett <swillett@nvidia.com>2012-02-21 10:32:59 -0800
commit15e65f291f12c084c18956263ee61f005caf8a9e (patch)
tree091fd73ab3c630bb379525c4606757813dfd69a0 /arch/arm/mach-tegra/tegra3_clocks.c
parent8c2d09c318f905bd8c1cf451501e20c903fcaaef (diff)
ARM: tegra: clock: Support for clock source control without enable bit
Some of controller like i2c requires a different clock source which is not enabled/disabled by the clock bit in CAR register set. Handling such cases by looking for PERIPH_NO_ENB flag when calling clock enable/disable functions. Change-Id: Id0d1df7946d1c83d769116ae7a91546bd59d4478 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/84709 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra3_clocks.c')
-rw-r--r--arch/arm/mach-tegra/tegra3_clocks.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/tegra3_clocks.c b/arch/arm/mach-tegra/tegra3_clocks.c
index 85c907bbad0d..97e7aa2bb976 100644
--- a/arch/arm/mach-tegra/tegra3_clocks.c
+++ b/arch/arm/mach-tegra/tegra3_clocks.c
@@ -2100,6 +2100,10 @@ static void tegra3_periph_clk_init(struct clk *c)
}
c->state = ON;
+
+ if (c->flags & PERIPH_NO_ENB)
+ return;
+
if (!(clk_readl(PERIPH_CLK_TO_ENB_REG(c)) & PERIPH_CLK_TO_BIT(c)))
c->state = OFF;
if (!(c->flags & PERIPH_NO_RESET))
@@ -2112,6 +2116,9 @@ static int tegra3_periph_clk_enable(struct clk *c)
unsigned long flags;
pr_debug("%s on clock %s\n", __func__, c->name);
+ if (c->flags & PERIPH_NO_ENB)
+ return 0;
+
spin_lock_irqsave(&periph_refcount_lock, flags);
tegra_periph_clk_enable_refcount[c->u.periph.clk_num]++;
@@ -2136,6 +2143,9 @@ static void tegra3_periph_clk_disable(struct clk *c)
unsigned long val, flags;
pr_debug("%s on clock %s\n", __func__, c->name);
+ if (c->flags & PERIPH_NO_ENB)
+ return;
+
spin_lock_irqsave(&periph_refcount_lock, flags);
if (c->refcnt)
@@ -2160,6 +2170,9 @@ static void tegra3_periph_clk_reset(struct clk *c, bool assert)
pr_debug("%s %s on clock %s\n", __func__,
assert ? "assert" : "deassert", c->name);
+ if (c->flags & PERIPH_NO_ENB)
+ return;
+
if (!(c->flags & PERIPH_NO_RESET)) {
if (assert) {
/* If peripheral is in the APB bus then read the APB