summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/spear-cpufreq.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@rjwysocki.net>2013-10-25 16:36:40 -0400
committerRafael J. Wysocki <rjw@rjwysocki.net>2013-10-25 16:36:40 -0400
commit6ddee424fea2d269c2f402278d93165c7b92dc58 (patch)
treec1b1d0d9058846a6da22def648dea61e16faacd0 /drivers/cpufreq/spear-cpufreq.c
parente4db1c7439b31993a4886b273bb9235a8eea82bf (diff)
parenta814613b9a32d9ab9578d9dab396265c826d37f0 (diff)
Merge back earlier 'pm-cpufreq' material.
Conflicts: drivers/cpufreq/omap-cpufreq.c
Diffstat (limited to 'drivers/cpufreq/spear-cpufreq.c')
-rw-r--r--drivers/cpufreq/spear-cpufreq.c39
1 files changed, 5 insertions, 34 deletions
diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c
index 3f418166ce02..8841366a2068 100644
--- a/drivers/cpufreq/spear-cpufreq.c
+++ b/drivers/cpufreq/spear-cpufreq.c
@@ -30,11 +30,6 @@ static struct {
30 u32 cnt; 30 u32 cnt;
31} spear_cpufreq; 31} spear_cpufreq;
32 32
33static int spear_cpufreq_verify(struct cpufreq_policy *policy)
34{
35 return cpufreq_frequency_table_verify(policy, spear_cpufreq.freq_tbl);
36}
37
38static unsigned int spear_cpufreq_get(unsigned int cpu) 33static unsigned int spear_cpufreq_get(unsigned int cpu)
39{ 34{
40 return clk_get_rate(spear_cpufreq.clk) / 1000; 35 return clk_get_rate(spear_cpufreq.clk) / 1000;
@@ -176,43 +171,19 @@ static int spear_cpufreq_target(struct cpufreq_policy *policy,
176 171
177static int spear_cpufreq_init(struct cpufreq_policy *policy) 172static int spear_cpufreq_init(struct cpufreq_policy *policy)
178{ 173{
179 int ret; 174 return cpufreq_generic_init(policy, spear_cpufreq.freq_tbl,
180 175 spear_cpufreq.transition_latency);
181 ret = cpufreq_frequency_table_cpuinfo(policy, spear_cpufreq.freq_tbl);
182 if (ret) {
183 pr_err("cpufreq_frequency_table_cpuinfo() failed");
184 return ret;
185 }
186
187 cpufreq_frequency_table_get_attr(spear_cpufreq.freq_tbl, policy->cpu);
188 policy->cpuinfo.transition_latency = spear_cpufreq.transition_latency;
189 policy->cur = spear_cpufreq_get(0);
190
191 cpumask_setall(policy->cpus);
192
193 return 0;
194}
195
196static int spear_cpufreq_exit(struct cpufreq_policy *policy)
197{
198 cpufreq_frequency_table_put_attr(policy->cpu);
199 return 0;
200} 176}
201 177
202static struct freq_attr *spear_cpufreq_attr[] = {
203 &cpufreq_freq_attr_scaling_available_freqs,
204 NULL,
205};
206
207static struct cpufreq_driver spear_cpufreq_driver = { 178static struct cpufreq_driver spear_cpufreq_driver = {
208 .name = "cpufreq-spear", 179 .name = "cpufreq-spear",
209 .flags = CPUFREQ_STICKY, 180 .flags = CPUFREQ_STICKY,
210 .verify = spear_cpufreq_verify, 181 .verify = cpufreq_generic_frequency_table_verify,
211 .target = spear_cpufreq_target, 182 .target = spear_cpufreq_target,
212 .get = spear_cpufreq_get, 183 .get = spear_cpufreq_get,
213 .init = spear_cpufreq_init, 184 .init = spear_cpufreq_init,
214 .exit = spear_cpufreq_exit, 185 .exit = cpufreq_generic_exit,
215 .attr = spear_cpufreq_attr, 186 .attr = cpufreq_generic_attr,
216}; 187};
217 188
218static int spear_cpufreq_driver_init(void) 189static int spear_cpufreq_driver_init(void)