aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAfzal Mohammed <afzal@ti.com>2012-09-23 19:28:24 -0400
committerPaul Walmsley <paul@pwsan.com>2012-09-23 19:28:24 -0400
commit4be48fd53bb7620220be5677bd767cda6d9ece0f (patch)
treea2dcb3772e6e3fb6e21650751aedd3df28372b1e /arch
parent49484a60ff665ccac2e4f2314753a21daa0c2f9e (diff)
ARM: OMAP2+: gpmc: Adapt to HWMOD
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> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/gpmc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index fe75656f9900..396ce77caeff 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -31,10 +31,13 @@
31#include <plat/cpu.h> 31#include <plat/cpu.h>
32#include <plat/gpmc.h> 32#include <plat/gpmc.h>
33#include <plat/sdrc.h> 33#include <plat/sdrc.h>
34#include <plat/omap_device.h>
34 35
35#include "soc.h" 36#include "soc.h"
36#include "common.h" 37#include "common.h"
37 38
39#define DEVICE_NAME "omap-gpmc"
40
38/* GPMC register offsets */ 41/* GPMC register offsets */
39#define GPMC_REVISION 0x00 42#define GPMC_REVISION 0x00
40#define GPMC_SYSCONFIG 0x10 43#define GPMC_SYSCONFIG 0x10
@@ -898,6 +901,25 @@ static int __init gpmc_init(void)
898} 901}
899postcore_initcall(gpmc_init); 902postcore_initcall(gpmc_init);
900 903
904static int __init omap_gpmc_init(void)
905{
906 struct omap_hwmod *oh;
907 struct platform_device *pdev;
908 char *oh_name = "gpmc";
909
910 oh = omap_hwmod_lookup(oh_name);
911 if (!oh) {
912 pr_err("Could not look up %s\n", oh_name);
913 return -ENODEV;
914 }
915
916 pdev = omap_device_build(DEVICE_NAME, -1, oh, NULL, 0, NULL, 0, 0);
917 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
918
919 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
920}
921postcore_initcall(omap_gpmc_init);
922
901static irqreturn_t gpmc_handle_irq(int irq, void *dev) 923static irqreturn_t gpmc_handle_irq(int irq, void *dev)
902{ 924{
903 int i; 925 int i;