Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360019
b: refs/heads/master
c: 42913c7
h: refs/heads/master
i:
  360017: b6daceb
  360015: e632661
v: v3
  • Loading branch information
Julia Lawall authored and Ralf Baechle committed Feb 15, 2013
1 parent 1a51c45 commit a8e8f1d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 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: 0f3a05cb43e731b8cf861dee30e7e4bddd6c5ccc
refs/heads/master: 42913c7992e9aca4deded016a05f6654e9b0807b
15 changes: 12 additions & 3 deletions trunk/arch/mips/kernel/cpufreq/loongson2_cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ static int loongson2_cpufreq_target(struct cpufreq_policy *policy,
static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
{
int i;
unsigned long rate;
int ret;

if (!cpu_online(policy->cpu))
return -ENODEV;
Expand All @@ -117,15 +119,22 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
return PTR_ERR(cpuclk);
}

cpuclk->rate = cpu_clock_freq / 1000;
if (!cpuclk->rate)
rate = cpu_clock_freq / 1000;
if (!rate) {
clk_put(cpuclk);
return -EINVAL;
}
ret = clk_set_rate(cpuclk, rate);
if (ret) {
clk_put(cpuclk);
return ret;
}

/* clock table init */
for (i = 2;
(loongson2_clockmod_table[i].frequency != CPUFREQ_TABLE_END);
i++)
loongson2_clockmod_table[i].frequency = (cpuclk->rate * i) / 8;
loongson2_clockmod_table[i].frequency = (rate * i) / 8;

policy->cur = loongson2_cpufreq_get(policy->cpu);

Expand Down

0 comments on commit a8e8f1d

Please sign in to comment.