]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: OMAP2+: gpmc-nand: Modify Interrupt handling
authorAfzal Mohammed <afzal@ti.com>
Thu, 30 Aug 2012 19:53:24 +0000 (12:53 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 30 Aug 2012 19:53:24 +0000 (12:53 -0700)
Now GPMC provides its client with interrupts that can be handled
using the standard interrupt API. Modify GPMC NAND setup to work
with it.

Also disable write protect in GPMC code, so that NAND driver can
be ignorant of GPMC configuration.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/gpmc-nand.c

index c0320d2eb40f770f0c0095048441d80d5aa7c457..045596a3e899c54c0381d72bc8b4d16986658bce 100644 (file)
 #include <plat/board.h>
 #include <plat/gpmc.h>
 
-static struct resource gpmc_nand_resource = {
-       .flags          = IORESOURCE_MEM,
+static struct resource gpmc_nand_resource[] = {
+       {
+               .flags          = IORESOURCE_MEM,
+       },
+       {
+               .flags          = IORESOURCE_IRQ,
+       },
+       {
+               .flags          = IORESOURCE_IRQ,
+       },
 };
 
 static struct platform_device gpmc_nand_device = {
        .name           = "omap2-nand",
        .id             = 0,
-       .num_resources  = 1,
-       .resource       = &gpmc_nand_resource,
+       .num_resources  = ARRAY_SIZE(gpmc_nand_resource),
+       .resource       = gpmc_nand_resource,
 };
 
 static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data)
@@ -75,6 +83,7 @@ static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data
                gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0);
        gpmc_cs_configure(gpmc_nand_data->cs,
                        GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
+       gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_WP, 0);
        err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t);
        if (err)
                return err;
@@ -90,14 +99,19 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data)
        gpmc_nand_device.dev.platform_data = gpmc_nand_data;
 
        err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE,
-                               (unsigned long *)&gpmc_nand_resource.start);
+                               (unsigned long *)&gpmc_nand_resource[0].start);
        if (err < 0) {
                dev_err(dev, "Cannot request GPMC CS\n");
                return err;
        }
 
-       gpmc_nand_resource.end = gpmc_nand_resource.start + NAND_IO_SIZE - 1;
+       gpmc_nand_resource[0].end = gpmc_nand_resource[0].start +
+                                                       NAND_IO_SIZE - 1;
 
+       gpmc_nand_resource[1].start =
+                               gpmc_get_client_irq(GPMC_IRQ_FIFOEVENTENABLE);
+       gpmc_nand_resource[2].start =
+                               gpmc_get_client_irq(GPMC_IRQ_COUNT_EVENT);
         /* Set timings in GPMC */
        err = omap2_nand_gpmc_retime(gpmc_nand_data);
        if (err < 0) {