summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra2_clocks.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2010-10-20 17:47:59 -0700
committerColin Cross <ccross@android.com>2010-10-25 13:11:47 -0700
commitb06eacd21e941de6a2d4027b53580baacabcea74 (patch)
tree9610cadf641c88814e7981d7e2cde868f6b17cd1 /arch/arm/mach-tegra/tegra2_clocks.c
parent20d2474a1ed41c8f6c19c81418875cb5ca0d2eca (diff)
[ARM] tegra: cpufreq: Take an extra reference to pllx
During cpu frequency changes, take an extra reference to pllx so that it doesn't turn off and on while the cpu is on pllp. Change-Id: I574d399a67aab21f99473296a29aa1eedc0eedb9 Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra2_clocks.c')
-rw-r--r--arch/arm/mach-tegra/tegra2_clocks.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c
index 125881e9fe22..0c3dfc9f0eb2 100644
--- a/arch/arm/mach-tegra/tegra2_clocks.c
+++ b/arch/arm/mach-tegra/tegra2_clocks.c
@@ -378,10 +378,16 @@ static void tegra2_cpu_clk_disable(struct clk *c)
static int tegra2_cpu_clk_set_rate(struct clk *c, unsigned long rate)
{
int ret;
+ /*
+ * Take an extra reference to the main pll so it doesn't turn
+ * off when we move the cpu off of it
+ */
+ clk_enable_locked(c->main);
+
ret = clk_set_parent_locked(c->parent, c->backup);
if (ret) {
pr_err("Failed to switch cpu to clock %s\n", c->backup->name);
- return ret;
+ goto out;
}
if (rate == c->backup->rate)
@@ -390,17 +396,18 @@ static int tegra2_cpu_clk_set_rate(struct clk *c, unsigned long rate)
ret = clk_set_rate_locked(c->main, rate);
if (ret) {
pr_err("Failed to change cpu pll to %lu\n", rate);
- return ret;
+ goto out;
}
ret = clk_set_parent_locked(c->parent, c->main);
if (ret) {
pr_err("Failed to switch cpu to clock %s\n", c->main->name);
- return ret;
+ goto out;
}
out:
- return 0;
+ clk_disable_locked(c->main);
+ return ret;
}
static struct clk_ops tegra_cpu_ops = {