Commit 2633a46c authored by Viresh Kumar's avatar Viresh Kumar Committed by Rafael J. Wysocki

cpufreq: pmac: Use generic cpufreq routines

Most of the CPUFreq drivers do similar things in .exit() and .verify() routines
and .attr. So its better if we have generic routines for them which can be used
by cpufreq drivers then.

This patch uses these generic routines in the pmac driver.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 57174310
...@@ -86,11 +86,6 @@ static struct cpufreq_frequency_table pmac_cpu_freqs[] = { ...@@ -86,11 +86,6 @@ static struct cpufreq_frequency_table pmac_cpu_freqs[] = {
{0, CPUFREQ_TABLE_END}, {0, CPUFREQ_TABLE_END},
}; };
static struct freq_attr* pmac_cpu_freqs_attr[] = {
&cpufreq_freq_attr_scaling_available_freqs,
NULL,
};
static inline void local_delay(unsigned long ms) static inline void local_delay(unsigned long ms)
{ {
if (no_schedule) if (no_schedule)
...@@ -378,11 +373,6 @@ static unsigned int pmac_cpufreq_get_speed(unsigned int cpu) ...@@ -378,11 +373,6 @@ static unsigned int pmac_cpufreq_get_speed(unsigned int cpu)
return cur_freq; return cur_freq;
} }
static int pmac_cpufreq_verify(struct cpufreq_policy *policy)
{
return cpufreq_frequency_table_verify(policy, pmac_cpu_freqs);
}
static int pmac_cpufreq_target( struct cpufreq_policy *policy, static int pmac_cpufreq_target( struct cpufreq_policy *policy,
unsigned int target_freq, unsigned int target_freq,
unsigned int relation) unsigned int relation)
...@@ -468,14 +458,14 @@ static int pmac_cpufreq_resume(struct cpufreq_policy *policy) ...@@ -468,14 +458,14 @@ static int pmac_cpufreq_resume(struct cpufreq_policy *policy)
} }
static struct cpufreq_driver pmac_cpufreq_driver = { static struct cpufreq_driver pmac_cpufreq_driver = {
.verify = pmac_cpufreq_verify, .verify = cpufreq_generic_frequency_table_verify,
.target = pmac_cpufreq_target, .target = pmac_cpufreq_target,
.get = pmac_cpufreq_get_speed, .get = pmac_cpufreq_get_speed,
.init = pmac_cpufreq_cpu_init, .init = pmac_cpufreq_cpu_init,
.suspend = pmac_cpufreq_suspend, .suspend = pmac_cpufreq_suspend,
.resume = pmac_cpufreq_resume, .resume = pmac_cpufreq_resume,
.flags = CPUFREQ_PM_NO_WARN, .flags = CPUFREQ_PM_NO_WARN,
.attr = pmac_cpu_freqs_attr, .attr = cpufreq_generic_attr,
.name = "powermac", .name = "powermac",
}; };
......
...@@ -70,11 +70,6 @@ static struct cpufreq_frequency_table g5_cpu_freqs[] = { ...@@ -70,11 +70,6 @@ static struct cpufreq_frequency_table g5_cpu_freqs[] = {
{0, CPUFREQ_TABLE_END}, {0, CPUFREQ_TABLE_END},
}; };
static struct freq_attr* g5_cpu_freqs_attr[] = {
&cpufreq_freq_attr_scaling_available_freqs,
NULL,
};
/* Power mode data is an array of the 32 bits PCR values to use for /* Power mode data is an array of the 32 bits PCR values to use for
* the various frequencies, retrieved from the device-tree * the various frequencies, retrieved from the device-tree
*/ */
...@@ -317,11 +312,6 @@ static int g5_pfunc_query_freq(void) ...@@ -317,11 +312,6 @@ static int g5_pfunc_query_freq(void)
* Common interface to the cpufreq core * Common interface to the cpufreq core
*/ */
static int g5_cpufreq_verify(struct cpufreq_policy *policy)
{
return cpufreq_frequency_table_verify(policy, g5_cpu_freqs);
}
static int g5_cpufreq_target(struct cpufreq_policy *policy, static int g5_cpufreq_target(struct cpufreq_policy *policy,
unsigned int target_freq, unsigned int relation) unsigned int target_freq, unsigned int relation)
{ {
...@@ -372,10 +362,10 @@ static struct cpufreq_driver g5_cpufreq_driver = { ...@@ -372,10 +362,10 @@ static struct cpufreq_driver g5_cpufreq_driver = {
.name = "powermac", .name = "powermac",
.flags = CPUFREQ_CONST_LOOPS, .flags = CPUFREQ_CONST_LOOPS,
.init = g5_cpufreq_cpu_init, .init = g5_cpufreq_cpu_init,
.verify = g5_cpufreq_verify, .verify = cpufreq_generic_frequency_table_verify,
.target = g5_cpufreq_target, .target = g5_cpufreq_target,
.get = g5_cpufreq_get_speed, .get = g5_cpufreq_get_speed,
.attr = g5_cpu_freqs_attr, .attr = cpufreq_generic_attr,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment