diff options
author | Kishon Vijay Abraham I <kishon@ti.com> | 2012-05-30 10:14:58 -0500 |
---|---|---|
committer | Guillaume Aubertin <g-aubertin@ti.com> | 2012-06-26 12:20:57 +0200 |
commit | 78e3a4bf496dde407330dd77bf20cf79c2ba2401 (patch) | |
tree | e507d6447e21998a92095884d01faeac93b2be63 | |
parent | e303d2f6c0680f8ec9356235b347473ee176f309 (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) { |