All of lore.kernel.org
 help / color / mirror / Atom feed
From: Afzal Mohammed <afzal@ti.com>
To: tony@atomide.com, paul@pwsan.com, jon-hunter@ti.com,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: Afzal Mohammed <afzal@ti.com>
Subject: [PATCH v9 2/3] ARM: OMAP2+: gpmc: Adapt to HWMOD
Date: Tue, 11 Sep 2012 15:26:59 +0530	[thread overview]
Message-ID: <16f0c80689d98fb713f1824ec4df6a12606847e4.1347355380.git.afzal@ti.com> (raw)
In-Reply-To: <cover.1347355380.git.afzal@ti.com>

Create API for platforms to adapt GPMC to HWMOD

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Reviewed-by: Jon Hunter <jon-hunter@ti.com>
---
 arch/arm/mach-omap2/gpmc.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 055ae8b..5462666 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -31,10 +31,13 @@
 #include <plat/cpu.h>
 #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
@@ -898,6 +901,25 @@ 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);
+	WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
+
+	return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
+}
+postcore_initcall(omap_gpmc_init);
+
 static irqreturn_t gpmc_handle_irq(int irq, void *dev)
 {
 	int i;
-- 
1.7.0.4


WARNING: multiple messages have this Message-ID (diff)
From: afzal@ti.com (Afzal Mohammed)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9 2/3] ARM: OMAP2+: gpmc: Adapt to HWMOD
Date: Tue, 11 Sep 2012 15:26:59 +0530	[thread overview]
Message-ID: <16f0c80689d98fb713f1824ec4df6a12606847e4.1347355380.git.afzal@ti.com> (raw)
In-Reply-To: <cover.1347355380.git.afzal@ti.com>

Create API for platforms to adapt GPMC to HWMOD

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Reviewed-by: Jon Hunter <jon-hunter@ti.com>
---
 arch/arm/mach-omap2/gpmc.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 055ae8b..5462666 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -31,10 +31,13 @@
 #include <plat/cpu.h>
 #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
@@ -898,6 +901,25 @@ 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);
+	WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
+
+	return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
+}
+postcore_initcall(omap_gpmc_init);
+
 static irqreturn_t gpmc_handle_irq(int irq, void *dev)
 {
 	int i;
-- 
1.7.0.4

  parent reply	other threads:[~2012-09-11  9:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11  9:56 [PATCH v9 0/3] GPMC driver conversion Afzal Mohammed
2012-09-11  9:56 ` Afzal Mohammed
2012-09-11  9:56 ` [PATCH v9 1/3] ARM: OMAP2/3: hwmod data: add gpmc Afzal Mohammed
2012-09-11  9:56   ` Afzal Mohammed
2012-09-12 22:15   ` Paul Walmsley
2012-09-12 22:15     ` Paul Walmsley
2012-09-17  8:14     ` Mohammed, Afzal
2012-09-17  8:14       ` Mohammed, Afzal
2012-09-11  9:56 ` Afzal Mohammed [this message]
2012-09-11  9:56   ` [PATCH v9 2/3] ARM: OMAP2+: gpmc: Adapt to HWMOD Afzal Mohammed
2012-09-11  9:57 ` [PATCH v9 3/3] ARM: OMAP2+: gpmc: minimal driver support Afzal Mohammed
2012-09-11  9:57   ` Afzal Mohammed
2012-09-12 16:34   ` Paul Walmsley
2012-09-12 16:34     ` Paul Walmsley
2012-09-17  8:06     ` Mohammed, Afzal
2012-09-17  8:06       ` Mohammed, Afzal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16f0c80689d98fb713f1824ec4df6a12606847e4.1347355380.git.afzal@ti.com \
    --to=afzal@ti.com \
    --cc=jon-hunter@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.