diff options
Diffstat (limited to 'drivers/cpufreq/omap-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/omap-cpufreq.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c index 9128c07bafba..0279d18a57f9 100644 --- a/drivers/cpufreq/omap-cpufreq.c +++ b/drivers/cpufreq/omap-cpufreq.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/opp.h> | 25 | #include <linux/opp.h> |
26 | #include <linux/cpu.h> | 26 | #include <linux/cpu.h> |
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | #include <linux/platform_device.h> | ||
28 | #include <linux/regulator/consumer.h> | 29 | #include <linux/regulator/consumer.h> |
29 | 30 | ||
30 | #include <asm/smp_plat.h> | 31 | #include <asm/smp_plat.h> |
@@ -88,16 +89,12 @@ static int omap_target(struct cpufreq_policy *policy, | |||
88 | } | 89 | } |
89 | 90 | ||
90 | freqs.old = omap_getspeed(policy->cpu); | 91 | freqs.old = omap_getspeed(policy->cpu); |
91 | freqs.cpu = policy->cpu; | ||
92 | 92 | ||
93 | if (freqs.old == freqs.new && policy->cur == freqs.new) | 93 | if (freqs.old == freqs.new && policy->cur == freqs.new) |
94 | return ret; | 94 | return ret; |
95 | 95 | ||
96 | /* notifiers */ | 96 | /* notifiers */ |
97 | for_each_cpu(i, policy->cpus) { | 97 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); |
98 | freqs.cpu = i; | ||
99 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); | ||
100 | } | ||
101 | 98 | ||
102 | freq = freqs.new * 1000; | 99 | freq = freqs.new * 1000; |
103 | ret = clk_round_rate(mpu_clk, freq); | 100 | ret = clk_round_rate(mpu_clk, freq); |
@@ -157,10 +154,7 @@ static int omap_target(struct cpufreq_policy *policy, | |||
157 | 154 | ||
158 | done: | 155 | done: |
159 | /* notifiers */ | 156 | /* notifiers */ |
160 | for_each_cpu(i, policy->cpus) { | 157 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); |
161 | freqs.cpu = i; | ||
162 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | ||
163 | } | ||
164 | 158 | ||
165 | return ret; | 159 | return ret; |
166 | } | 160 | } |
@@ -184,7 +178,7 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) | |||
184 | goto fail_ck; | 178 | goto fail_ck; |
185 | } | 179 | } |
186 | 180 | ||
187 | policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu); | 181 | policy->cur = omap_getspeed(policy->cpu); |
188 | 182 | ||
189 | if (!freq_table) | 183 | if (!freq_table) |
190 | result = opp_init_cpufreq_table(mpu_dev, &freq_table); | 184 | result = opp_init_cpufreq_table(mpu_dev, &freq_table); |
@@ -203,8 +197,6 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) | |||
203 | 197 | ||
204 | cpufreq_frequency_table_get_attr(freq_table, policy->cpu); | 198 | cpufreq_frequency_table_get_attr(freq_table, policy->cpu); |
205 | 199 | ||
206 | policy->min = policy->cpuinfo.min_freq; | ||
207 | policy->max = policy->cpuinfo.max_freq; | ||
208 | policy->cur = omap_getspeed(policy->cpu); | 200 | policy->cur = omap_getspeed(policy->cpu); |
209 | 201 | ||
210 | /* | 202 | /* |
@@ -252,7 +244,7 @@ static struct cpufreq_driver omap_driver = { | |||
252 | .attr = omap_cpufreq_attr, | 244 | .attr = omap_cpufreq_attr, |
253 | }; | 245 | }; |
254 | 246 | ||
255 | static int __init omap_cpufreq_init(void) | 247 | static int omap_cpufreq_probe(struct platform_device *pdev) |
256 | { | 248 | { |
257 | mpu_dev = get_cpu_device(0); | 249 | mpu_dev = get_cpu_device(0); |
258 | if (!mpu_dev) { | 250 | if (!mpu_dev) { |
@@ -280,12 +272,20 @@ static int __init omap_cpufreq_init(void) | |||
280 | return cpufreq_register_driver(&omap_driver); | 272 | return cpufreq_register_driver(&omap_driver); |
281 | } | 273 | } |
282 | 274 | ||
283 | static void __exit omap_cpufreq_exit(void) | 275 | static int omap_cpufreq_remove(struct platform_device *pdev) |
284 | { | 276 | { |
285 | cpufreq_unregister_driver(&omap_driver); | 277 | return cpufreq_unregister_driver(&omap_driver); |
286 | } | 278 | } |
287 | 279 | ||
280 | static struct platform_driver omap_cpufreq_platdrv = { | ||
281 | .driver = { | ||
282 | .name = "omap-cpufreq", | ||
283 | .owner = THIS_MODULE, | ||
284 | }, | ||
285 | .probe = omap_cpufreq_probe, | ||
286 | .remove = omap_cpufreq_remove, | ||
287 | }; | ||
288 | module_platform_driver(omap_cpufreq_platdrv); | ||
289 | |||
288 | MODULE_DESCRIPTION("cpufreq driver for OMAP SoCs"); | 290 | MODULE_DESCRIPTION("cpufreq driver for OMAP SoCs"); |
289 | MODULE_LICENSE("GPL"); | 291 | MODULE_LICENSE("GPL"); |
290 | module_init(omap_cpufreq_init); | ||
291 | module_exit(omap_cpufreq_exit); | ||