diff options
author | Kishon Vijay Abraham I <kishon@ti.com> | 2012-05-30 10:14:58 -0500 |
---|---|---|
committer | Xavier Boudet <x-boudet@ti.com> | 2012-07-10 17:26:52 +0200 |
commit | fcdb5f45f9519c4f68e6228c074d47a9c5cc8e89 (patch) | |
tree | 6eb0a0dba9952d2cded39728e6a51bbf72e1da28 | |
parent | bd0ab5fd014d35565f4c9c1cd555db4304071484 (diff) |
arm: omap: device: create a device for system control module
Extracts the device data from hwmod database and create a platform device
using omap device build.
The device build is done during postcore_initcall.
Change-Id: I153d9dd5f4139d43e408d8ed1b0c641868821623
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Radhesh Fadnis <radhesh.fadnis@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index ff64eee1fb56..acd29319cc2e 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -71,6 +71,31 @@ OMAP_MCBSP_PLATFORM_DEVICE(3); OMAP_MCBSP_PLATFORM_DEVICE(4); OMAP_MCBSP_PLATFORM_DEVICE(5); +static int __init omap_init_control(void) +{ + struct omap_hwmod *oh; + struct platform_device *pdev; + const char *oh_name, *name; + + oh_name = "ctrl_module_core"; + name = "omap-control-core"; + + oh = omap_hwmod_lookup(oh_name); + if (!oh) { + pr_err("Could not lookup hwmod for %s\n", oh_name); + return PTR_ERR(oh); + } + + pdev = omap_device_build(name, -1, oh, NULL, 0, NULL, 0, true); + if (IS_ERR(pdev)) { + pr_err("Could not build omap_device for %s %s\n", + name, oh_name); + return PTR_ERR(pdev); + } + + return 0; +} +postcore_initcall(omap_init_control); static int __init omap3_l3_init(void) { |