gpio/omap: remove cpu_is_omapxxxx() checks from *_runtime_resume()
authorTarun Kanti DebBarma <tarun.kanti@ti.com>
Fri, 27 Apr 2012 14:13:37 +0000 (19:43 +0530)
committerKevin Hilman <khilman@ti.com>
Sat, 12 May 2012 00:08:40 +0000 (17:08 -0700)
Add register offsets for GPIO_IRQSTATUS_RAW_0, GPIO_IRQSTATUS_RAW_0
which are present on OMAP4+ processors. Now we can distinguish
conditions applicable to OMAP4,5 and those specific to OMAP24xx
and OMAP3xxx.

Cc: Kevin Hilman <khilman@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Cousson, Benoit <b-cousson@ti.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
arch/arm/mach-omap2/gpio.c
arch/arm/plat-omap/include/plat/gpio.h
drivers/gpio/gpio-omap.c

index 86f91a6ed4e4a8baf1e6317f5297fbea62148239..a144e22969a371fd8affed962ab439f828a06375 100644 (file)
@@ -101,6 +101,8 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
                pdata->regs->dataout = OMAP4_GPIO_DATAOUT;
                pdata->regs->set_dataout = OMAP4_GPIO_SETDATAOUT;
                pdata->regs->clr_dataout = OMAP4_GPIO_CLEARDATAOUT;
+               pdata->regs->irqstatus_raw0 = OMAP4_GPIO_IRQSTATUSRAW0;
+               pdata->regs->irqstatus_raw1 = OMAP4_GPIO_IRQSTATUSRAW1;
                pdata->regs->irqstatus = OMAP4_GPIO_IRQSTATUS0;
                pdata->regs->irqstatus2 = OMAP4_GPIO_IRQSTATUS1;
                pdata->regs->irqenable = OMAP4_GPIO_IRQSTATUSSET0;
index d903e7df3fb11edd85a7062d6615c7240bec327d..50fb7cc000ea73fb07f535e704dd406c3ed31e6e 100644 (file)
@@ -172,6 +172,8 @@ struct omap_gpio_reg_offs {
        u16 clr_dataout;
        u16 irqstatus;
        u16 irqstatus2;
+       u16 irqstatus_raw0;
+       u16 irqstatus_raw1;
        u16 irqenable;
        u16 irqenable2;
        u16 set_irqenable;
index c89c38869c0c8f381cf5f3c64c0c1e73de3b9dd0..2c70617e6b4547173706590927920a323f78a1fb 100644 (file)
@@ -1286,14 +1286,14 @@ static int omap_gpio_runtime_resume(struct device *dev)
                old0 = __raw_readl(bank->base + bank->regs->leveldetect0);
                old1 = __raw_readl(bank->base + bank->regs->leveldetect1);
 
-               if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+               if (!bank->regs->irqstatus_raw0) {
                        __raw_writel(old0 | gen, bank->base +
                                                bank->regs->leveldetect0);
                        __raw_writel(old1 | gen, bank->base +
                                                bank->regs->leveldetect1);
                }
 
-               if (cpu_is_omap44xx()) {
+               if (bank->regs->irqstatus_raw0) {
                        __raw_writel(old0 | l, bank->base +
                                                bank->regs->leveldetect0);
                        __raw_writel(old1 | l, bank->base +