cpufreq: expose a cpufreq_quick_get_max routine
This allows drivers and other code to get the max reported CPU frequency. Initial use is for scaling ring frequency with GPU frequency in the i915 driver. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
6ae77e6b6a
commit
3d73710880
2 changed files with 25 additions and 0 deletions
|
@ -1199,6 +1199,26 @@ unsigned int cpufreq_quick_get(unsigned int cpu)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(cpufreq_quick_get);
|
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)
|
static unsigned int __cpufreq_get(unsigned int cpu)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 */
|
/* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */
|
||||||
#ifdef CONFIG_CPU_FREQ
|
#ifdef CONFIG_CPU_FREQ
|
||||||
unsigned int cpufreq_quick_get(unsigned int cpu);
|
unsigned int cpufreq_quick_get(unsigned int cpu);
|
||||||
|
unsigned int cpufreq_quick_get_max(unsigned int cpu);
|
||||||
#else
|
#else
|
||||||
static inline unsigned int cpufreq_quick_get(unsigned int cpu)
|
static inline unsigned int cpufreq_quick_get(unsigned int cpu)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
static inline unsigned int cpufreq_quick_get_max(unsigned int cpu)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue