diff options
-rw-r--r-- | arch/arm/mach-omap2/pm.c | 9 | ||||
-rw-r--r-- | drivers/cpufreq/omap-cpufreq.c | 19 |
2 files changed, 23 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 673a4c1d1d76..8d15f9ae19ff 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -265,6 +265,12 @@ static void __init omap4_init_voltages(void) | |||
265 | omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", "iva"); | 265 | omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", "iva"); |
266 | } | 266 | } |
267 | 267 | ||
268 | static inline void omap_init_cpufreq(void) | ||
269 | { | ||
270 | struct platform_device_info devinfo = { .name = "omap-cpufreq", }; | ||
271 | platform_device_register_full(&devinfo); | ||
272 | } | ||
273 | |||
268 | static int __init omap2_common_pm_init(void) | 274 | static int __init omap2_common_pm_init(void) |
269 | { | 275 | { |
270 | if (!of_have_populated_dt()) | 276 | if (!of_have_populated_dt()) |
@@ -294,6 +300,9 @@ int __init omap2_common_pm_late_init(void) | |||
294 | 300 | ||
295 | /* Smartreflex device init */ | 301 | /* Smartreflex device init */ |
296 | omap_devinit_smartreflex(); | 302 | omap_devinit_smartreflex(); |
303 | |||
304 | /* cpufreq dummy device instantiation */ | ||
305 | omap_init_cpufreq(); | ||
297 | } | 306 | } |
298 | 307 | ||
299 | #ifdef CONFIG_SUSPEND | 308 | #ifdef CONFIG_SUSPEND |
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c index ad7549c13ed2..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> |
@@ -243,7 +244,7 @@ static struct cpufreq_driver omap_driver = { | |||
243 | .attr = omap_cpufreq_attr, | 244 | .attr = omap_cpufreq_attr, |
244 | }; | 245 | }; |
245 | 246 | ||
246 | static int __init omap_cpufreq_init(void) | 247 | static int omap_cpufreq_probe(struct platform_device *pdev) |
247 | { | 248 | { |
248 | mpu_dev = get_cpu_device(0); | 249 | mpu_dev = get_cpu_device(0); |
249 | if (!mpu_dev) { | 250 | if (!mpu_dev) { |
@@ -271,12 +272,20 @@ static int __init omap_cpufreq_init(void) | |||
271 | return cpufreq_register_driver(&omap_driver); | 272 | return cpufreq_register_driver(&omap_driver); |
272 | } | 273 | } |
273 | 274 | ||
274 | static void __exit omap_cpufreq_exit(void) | 275 | static int omap_cpufreq_remove(struct platform_device *pdev) |
275 | { | 276 | { |
276 | cpufreq_unregister_driver(&omap_driver); | 277 | return cpufreq_unregister_driver(&omap_driver); |
277 | } | 278 | } |
278 | 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 | |||
279 | MODULE_DESCRIPTION("cpufreq driver for OMAP SoCs"); | 290 | MODULE_DESCRIPTION("cpufreq driver for OMAP SoCs"); |
280 | MODULE_LICENSE("GPL"); | 291 | MODULE_LICENSE("GPL"); |
281 | module_init(omap_cpufreq_init); | ||
282 | module_exit(omap_cpufreq_exit); | ||