aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/cpufreq.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-02-07 14:05:13 +1100
committerPaul Mackerras <paulus@samba.org>2007-02-07 14:05:13 +1100
commit8423200553113cc031caa9b147f6150a8e26545c (patch)
tree752c93a200c9ba056c7469c96f7e27d02c99291d /arch/arm/mach-imx/cpufreq.c
parent[POWERPC] Make pSeries use the H_BULK_REMOVE hypervisor call (diff)
parentLinux 2.6.20 (diff)
downloadlinux-dev-8423200553113cc031caa9b147f6150a8e26545c.tar.xz
linux-dev-8423200553113cc031caa9b147f6150a8e26545c.zip
Merge branch 'linux-2.6'
Diffstat (limited to 'arch/arm/mach-imx/cpufreq.c')
-rw-r--r--arch/arm/mach-imx/cpufreq.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/cpufreq.c b/arch/arm/mach-imx/cpufreq.c
index ac5f99895660..4f66e90db74f 100644
--- a/arch/arm/mach-imx/cpufreq.c
+++ b/arch/arm/mach-imx/cpufreq.c
@@ -184,6 +184,17 @@ static int imx_set_target(struct cpufreq_policy *policy,
long sysclk;
unsigned int bclk_div = 1;
+ /*
+ * Some governors do not respects CPU and policy lower limits
+ * which leads to bad things (division by zero etc), ensure
+ * that such things do not happen.
+ */
+ if(target_freq < policy->cpuinfo.min_freq)
+ target_freq = policy->cpuinfo.min_freq;
+
+ if(target_freq < policy->min)
+ target_freq = policy->min;
+
freq = target_freq * 1000;
pr_debug(KERN_DEBUG "imx: requested frequency %ld Hz, mpctl0 at boot 0x%08x\n",
@@ -258,7 +269,8 @@ static int __init imx_cpufreq_driver_init(struct cpufreq_policy *policy)
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cpuinfo.min_freq = 8000;
policy->cpuinfo.max_freq = 200000;
- policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
+ /* Manual states, that PLL stabilizes in two CLK32 periods */
+ policy->cpuinfo.transition_latency = 4 * 1000000000LL / CLK32;
return 0;
}