summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/devices.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2014-11-28 23:24:12 +0100
committerArnd Bergmann <arnd@arndb.de>2014-11-28 23:24:12 +0100
commit1306b20daa38c1429dabacc9ec8b437cb585e427 (patch)
treed6de9796f1d1da3d0aeba22c2085aa00afc6fac9 /arch/arm/mach-omap2/devices.c
parent594b5d51c6fcb1af61be037e2e5ffd875495d866 (diff)
parent186401937927426f85a28bd798e82ca18e4e5549 (diff)
downloadlinux-1306b20daa38c1429dabacc9ec8b437cb585e427.tar.bz2
Merge tag 'omap-for-v3.19/gpmc-move-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/omap-gpmc
Pull "move omap gpmc to drivers finally" from Tony Lindgren: We can finally move the GPMC code to live in drivers/memory for further clean up work. Note that we still have dependencies to the legacy booting for omap3 board-*.c files for setting up the board specific memory timings. For that we need the timing related things still exposed in include/linux/omap-gpmc.h. This will all become private data to the GPMC driver once the legacy booting support can be dropped. * tag 'omap-for-v3.19/gpmc-move-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: memory: gpmc: Move omap gpmc code to live under drivers ARM: OMAP2+: Move GPMC initcall to devices.c ARM: OMAP2+: Prepare to move GPMC to drivers by platform data header Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r--arch/arm/mach-omap2/devices.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 324f02bf8a51..110256a56636 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -445,3 +445,29 @@ static int __init omap2_init_devices(void)
return 0;
}
omap_arch_initcall(omap2_init_devices);
+
+static int __init omap_gpmc_init(void)
+{
+ struct omap_hwmod *oh;
+ struct platform_device *pdev;
+ char *oh_name = "gpmc";
+
+ /*
+ * if the board boots up with a populated DT, do not
+ * manually add the device from this initcall
+ */
+ if (of_have_populated_dt())
+ return -ENODEV;
+
+ oh = omap_hwmod_lookup(oh_name);
+ if (!oh) {
+ pr_err("Could not look up %s\n", oh_name);
+ return -ENODEV;
+ }
+
+ pdev = omap_device_build("omap-gpmc", -1, oh, NULL, 0);
+ WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
+
+ return PTR_RET(pdev);
+}
+omap_postcore_initcall(omap_gpmc_init);