aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2013-04-09 19:22:01 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-04-10 07:41:00 -0400
commit49ded525d4486dc97fc965858bf3ddf245463670 (patch)
tree9c3a586f60a8cc6782ccdd23d4337fcb516caff2 /arch
parent64649dcdf6c42d990cb44cceb0112ebd606ef435 (diff)
cpufreq: OMAP: instantiate omap-cpufreq as a platform_driver
As multi-platform build is being adopted by more and more ARM platforms, initcall function should be used very carefully. For example, when CONFIG_ARM_OMAP2PLUS_CPUFREQ is built in the kernel, omap_cpufreq_init() will be called on all the platforms to initialize omap-cpufreq driver. Further, on OMAP, we now use Soc generic cpufreq-cpu0 driver using device tree entries. To allow cpufreq-cpu0 and omap-cpufreq drivers to co-exist for OMAP in a single image, we need to ensure the following: 1. With device tree boot, we use cpufreq-cpu0 2. With non device tree boot, we use omap-cpufreq In the case of (1), we will have cpu OPPs and regulator registered as part of the device tree nodes, to ensure that omap-cpufreq and cpufreq-cpu0 don't conflict in managing the frequency of the same CPU, we should not permit omap-cpufreq to be probed. In the case of (2), we will not have the cpufreq-cpu0 device, hence only omap-cpufreq will be active. To eliminate this undesired these effects, we change omap-cpufreq driver to have it instantiated as a platform_driver and register "omap-cpufreq" device only when booted without device tree nodes on OMAP platforms. This allows the following: a) Will only run on platforms that create the platform_device "omap-cpufreq". b) Since the platform_device is registered only when device tree nodes are *not* populated, omap-cpufreq driver does not conflict with the usage of cpufreq-cpu0 driver which is used on OMAP platforms when device tree nodes are present. Inspired by commit 5553f9e26f6f49a93ba732fd222eac6973a4cf35 (cpufreq: instantiate cpufreq-cpu0 as a platform_driver) [robherring2@gmail.com: reported conflict of omap-cpufreq vs other driver in an non-device tree supported boot] Reported-by: Rob Herring <robherring2@gmail.com> Signed-off-by: Nishanth Menon <nm@ti.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/pm.c9
1 files changed, 9 insertions, 0 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
268static inline void omap_init_cpufreq(void)
269{
270 struct platform_device_info devinfo = { .name = "omap-cpufreq", };
271 platform_device_register_full(&devinfo);
272}
273
268static int __init omap2_common_pm_init(void) 274static 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