From 50d737e2b3269ea832586fec78fa104d5a5a8178 Mon Sep 17 00:00:00 2001 From: Teknoman117 <linux.robotdude@gmail.com> Date: Wed, 24 Jul 2013 03:01:29 -0700 Subject: [PATCH 3/4] Use cpu0-cpufreq in a device tree supported boot. This is a SoC generic driver, and can pull from the operating points listed in the device tree. Very nifty - originally found here: http://lkml.indiana.edu/hypermail/linux/kernel/1304.1/04077.html v2, Robert Nelson, limit cpufreq-cpu0 to only beagle, so cpufreq works on panda too... Signed-off-by: Teknoman117 <linux.robotdude@gmail.com> Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- arch/arm/mach-omap2/pm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index e742118..1dc9d50 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c @@ -266,7 +266,13 @@ static void __init omap4_init_voltages(void) static inline void omap_init_cpufreq(void) { - struct platform_device_info devinfo = { .name = "omap-cpufreq", }; + struct platform_device_info devinfo = { }; + + if (of_machine_is_compatible("ti,omap3-beagle-xm")) + devinfo.name = "cpufreq-cpu0"; + else + devinfo.name = "omap-cpufreq"; + platform_device_register_full(&devinfo); } @@ -299,11 +305,11 @@ int __init omap2_common_pm_late_init(void) /* Smartreflex device init */ omap_devinit_smartreflex(); - - /* cpufreq dummy device instantiation */ - omap_init_cpufreq(); } + /* cpufreq dummy device instantiation */ + omap_init_cpufreq(); + #ifdef CONFIG_SUSPEND suspend_set_ops(&omap_pm_ops); #endif -- 1.8.4.rc3