From 0d583d296c6cec6fa11c72fd9228205e710564b7 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Tue, 28 Jun 2011 10:59:12 -0700 Subject: [PATCH] --- yaml --- r: 260172 b: refs/heads/master c: 3d73710880afa3d61cf57b5d4eb192e812eb7e4f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/cpufreq/cpufreq.c | 20 ++++++++++++++++++++ trunk/include/linux/cpufreq.h | 5 +++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 9f3a45cb7334..1ced627a90e9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6ae77e6b6ae20c280df8ca78e9c9d9a8ccfe7a98 +refs/heads/master: 3d73710880afa3d61cf57b5d4eb192e812eb7e4f diff --git a/trunk/drivers/cpufreq/cpufreq.c b/trunk/drivers/cpufreq/cpufreq.c index 0a5bea9e3585..987a165ede26 100644 --- a/trunk/drivers/cpufreq/cpufreq.c +++ b/trunk/drivers/cpufreq/cpufreq.c @@ -1199,6 +1199,26 @@ unsigned int cpufreq_quick_get(unsigned int cpu) } EXPORT_SYMBOL(cpufreq_quick_get); +/** + * cpufreq_quick_get_max - get the max reported CPU frequency for this CPU + * @cpu: CPU number + * + * Just return the max possible frequency for a given CPU. + */ +unsigned int cpufreq_quick_get_max(unsigned int cpu) +{ + struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); + unsigned int ret_freq = 0; + + if (policy) { + ret_freq = policy->max; + cpufreq_cpu_put(policy); + } + + return ret_freq; +} +EXPORT_SYMBOL(cpufreq_quick_get_max); + static unsigned int __cpufreq_get(unsigned int cpu) { diff --git a/trunk/include/linux/cpufreq.h b/trunk/include/linux/cpufreq.h index 11be48e0d168..6216115c7789 100644 --- a/trunk/include/linux/cpufreq.h +++ b/trunk/include/linux/cpufreq.h @@ -324,11 +324,16 @@ static inline unsigned int cpufreq_get(unsigned int cpu) /* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ #ifdef CONFIG_CPU_FREQ unsigned int cpufreq_quick_get(unsigned int cpu); +unsigned int cpufreq_quick_get_max(unsigned int cpu); #else static inline unsigned int cpufreq_quick_get(unsigned int cpu) { return 0; } +static inline unsigned int cpufreq_quick_get_max(unsigned int cpu) +{ + return 0; +} #endif