diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-27 10:50:54 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-27 10:50:54 +0100 |
commit | 4944dd62de21230af039eda7cd218e9a09021d11 (patch) | |
tree | bac70f7bab8506c7e1b0408bacbdb0b1d77262e9 /arch/avr32/mach-at32ap/cpufreq.c | |
parent | ftrace: warning in kernel/trace/ftrace.c (diff) | |
parent | Linux 2.6.28-rc2 (diff) | |
download | linux-4944dd62de21230af039eda7cd218e9a09021d11.tar.xz linux-4944dd62de21230af039eda7cd218e9a09021d11.zip |
Merge commit 'v2.6.28-rc2' into tracing/urgent
Diffstat (limited to 'arch/avr32/mach-at32ap/cpufreq.c')
-rw-r--r-- | arch/avr32/mach-at32ap/cpufreq.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/avr32/mach-at32ap/cpufreq.c b/arch/avr32/mach-at32ap/cpufreq.c index d84efe4984ab..024c586e936c 100644 --- a/arch/avr32/mach-at32ap/cpufreq.c +++ b/arch/avr32/mach-at32ap/cpufreq.c @@ -40,6 +40,9 @@ static unsigned int at32_get_speed(unsigned int cpu) return (unsigned int)((clk_get_rate(cpuclk) + 500) / 1000); } +static unsigned int ref_freq; +static unsigned long loops_per_jiffy_ref; + static int at32_set_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) @@ -61,8 +64,19 @@ static int at32_set_target(struct cpufreq_policy *policy, freqs.cpu = 0; freqs.flags = 0; + if (!ref_freq) { + ref_freq = freqs.old; + loops_per_jiffy_ref = boot_cpu_data.loops_per_jiffy; + } + cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); + if (freqs.old < freqs.new) + boot_cpu_data.loops_per_jiffy = cpufreq_scale( + loops_per_jiffy_ref, ref_freq, freqs.new); clk_set_rate(cpuclk, freq); + if (freqs.new < freqs.old) + boot_cpu_data.loops_per_jiffy = cpufreq_scale( + loops_per_jiffy_ref, ref_freq, freqs.new); cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); pr_debug("cpufreq: set frequency %lu Hz\n", freq); |