Thread (5 messages) 5 messages, 1 author, 2012-09-05

[PATCH v7 2/3] ARM: OMAP2+: gpmc: Adapt to HWMOD

flat view
STALE5156d SUPERSEDED

From: Afzal Mohammed <hidden>
Date: 2012-09-05 08:50:02
Also in: linux-omap
Subsystem: arm port, omap general purpose memory controller support, omap power management support, omap2+ support, the rest · Maintainers: Russell King, Roger Quadros, Tony Lindgren, Kevin Hilman, Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Linus Torvalds

Revision v7 of 10 in this series.

Revisions (10)
  1. v5 [diff vs current]
  2. v5 [diff vs current]
  3. v5 [diff vs current]
  4. v5 [diff vs current]
  5. v6 [diff vs current]
  6. v7 current
  7. v8 [diff vs current]
  8. v8 [diff vs current]
  9. v9 [diff vs current]
  10. v8 [diff vs current]
Create API for platforms to adapt GPMC to HWMOD

Signed-off-by: Afzal Mohammed <redacted>
---
 arch/arm/mach-omap2/gpmc.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index dbc1ebc..c45f185 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -29,11 +29,14 @@
 
 #include <plat/gpmc.h>
 #include <plat/sdrc.h>
+#include <plat/omap_device.h>
 
 #include "soc.h"
 
 #include "common.h"
 
+#define	DEVICE_NAME		"omap-gpmc"
+
 /* GPMC register offsets */
 #define GPMC_REVISION		0x00
 #define GPMC_SYSCONFIG		0x10
@@ -897,6 +900,29 @@ static int __init gpmc_init(void)
 }
 postcore_initcall(gpmc_init);
 
+static int __init omap_gpmc_init(void)
+{
+	struct omap_hwmod *oh;
+	struct platform_device *pdev;
+	char *oh_name = "gpmc";
+
+	oh = omap_hwmod_lookup(oh_name);
+	if (!oh) {
+		pr_err("Could not look up %s\n", oh_name);
+		return -ENODEV;
+	}
+
+	pdev = omap_device_build(DEVICE_NAME, -1, oh, NULL, 0, NULL, 0, 0);
+	if (IS_ERR(pdev)) {
+		WARN(1, "Can't build omap_device for %s:%s.\n",
+						DEVICE_NAME, oh->name);
+		return PTR_ERR(pdev);
+	}
+
+	return 0;
+}
+postcore_initcall(omap_gpmc_init);
+
 static irqreturn_t gpmc_handle_irq(int irq, void *dev)
 {
 	int i;
-- 
1.7.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help