aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/pxa2xx-cpufreq.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-10-03 10:58:20 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-15 18:50:27 -0400
commitbf36e48d737ebcb2282f51c08e9c7667e30ed3b6 (patch)
tree99b08a7669f4280a8b2926a826368dd7d8e61e6e /drivers/cpufreq/pxa2xx-cpufreq.c
parentc3bc3d67ff07c1986e8ededc14e3fbdd26528f17 (diff)
cpufreq: pxa: 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 PXA driver. Cc: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/pxa2xx-cpufreq.c')
-rw-r--r--drivers/cpufreq/pxa2xx-cpufreq.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c
index 236531a0753a..82905fe0041b 100644
--- a/drivers/cpufreq/pxa2xx-cpufreq.c
+++ b/drivers/cpufreq/pxa2xx-cpufreq.c
@@ -262,23 +262,6 @@ static u32 mdrefr_dri(unsigned int freq)
262 return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32; 262 return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32;
263} 263}
264 264
265/* find a valid frequency point */
266static int pxa_verify_policy(struct cpufreq_policy *policy)
267{
268 struct cpufreq_frequency_table *pxa_freqs_table;
269 pxa_freqs_t *pxa_freqs;
270 int ret;
271
272 find_freq_tables(&pxa_freqs_table, &pxa_freqs);
273 ret = cpufreq_frequency_table_verify(policy, pxa_freqs_table);
274
275 if (freq_debug)
276 pr_debug("Verified CPU policy: %dKhz min to %dKhz max\n",
277 policy->min, policy->max);
278
279 return ret;
280}
281
282static unsigned int pxa_cpufreq_get(unsigned int cpu) 265static unsigned int pxa_cpufreq_get(unsigned int cpu)
283{ 266{
284 return get_clk_frequency_khz(0); 267 return get_clk_frequency_khz(0);
@@ -465,17 +448,11 @@ static int pxa_cpufreq_init(struct cpufreq_policy *policy)
465 return 0; 448 return 0;
466} 449}
467 450
468static int pxa_cpufreq_exit(struct cpufreq_policy *policy)
469{
470 cpufreq_frequency_table_put_attr(policy->cpu);
471 return 0;
472}
473
474static struct cpufreq_driver pxa_cpufreq_driver = { 451static struct cpufreq_driver pxa_cpufreq_driver = {
475 .verify = pxa_verify_policy, 452 .verify = cpufreq_generic_frequency_table_verify,
476 .target = pxa_set_target, 453 .target = pxa_set_target,
477 .init = pxa_cpufreq_init, 454 .init = pxa_cpufreq_init,
478 .exit = pxa_cpufreq_exit, 455 .exit = cpufreq_generic_exit,
479 .get = pxa_cpufreq_get, 456 .get = pxa_cpufreq_get,
480 .name = "PXA2xx", 457 .name = "PXA2xx",
481}; 458};