Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235244
b: refs/heads/master
c: 89a5fb8
h: refs/heads/master
v: v3
  • Loading branch information
Colin Cross committed Feb 21, 2011
1 parent 7a154fa commit 4a7b9be
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4729fd7a7dfe7847b4870801ad12222adaeb016c
refs/heads/master: 89a5fb84dabdf6daeae7d5301a6b1ae4754425dd
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-tegra/cpu-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
if (IS_ERR(cpu_clk))
return PTR_ERR(cpu_clk);

clk_enable(cpu_clk);

cpufreq_frequency_table_cpuinfo(policy, freq_table);
cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
policy->cur = tegra_getspeed(policy->cpu);
Expand Down
15 changes: 11 additions & 4 deletions trunk/arch/arm/mach-tegra/tegra2_clocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,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(c->u.cpu.main);

ret = clk_set_parent(c->parent, c->u.cpu.backup);
if (ret) {
pr_err("Failed to switch cpu to clock %s\n", c->u.cpu.backup->name);
return ret;
goto out;
}

if (rate == clk_get_rate(c->u.cpu.backup))
Expand All @@ -397,17 +403,18 @@ static int tegra2_cpu_clk_set_rate(struct clk *c, unsigned long rate)
ret = clk_set_rate(c->u.cpu.main, rate);
if (ret) {
pr_err("Failed to change cpu pll to %lu\n", rate);
return ret;
goto out;
}

ret = clk_set_parent(c->parent, c->u.cpu.main);
if (ret) {
pr_err("Failed to switch cpu to clock %s\n", c->u.cpu.main->name);
return ret;
goto out;
}

out:
return 0;
clk_disable(c->u.cpu.main);
return ret;
}

static struct clk_ops tegra_cpu_ops = {
Expand Down

0 comments on commit 4a7b9be

Please sign in to comment.