]> git.karo-electronics.de Git - linux-beck.git/commitdiff
gpio/omap: use pinctrl offset instead of macro
authorCharulatha V <charu@ti.com>
Wed, 25 May 2011 05:53:50 +0000 (11:23 +0530)
committerTarun Kanti DebBarma <tarun.kanti@ti.com>
Mon, 6 Feb 2012 08:43:43 +0000 (14:13 +0530)
Use regs->pinctrl field instead of using the macro OMAP1510_GPIO_PIN_CONTROL

Signed-off-by: Charulatha V <charu@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
arch/arm/mach-omap1/gpio15xx.c
arch/arm/plat-omap/include/plat/gpio.h
drivers/gpio/gpio-omap.c

index 2adfece30ce6e1fca6d233c318359459de47c1c7..950e467361d085b5163c8e898b990ecda20a7031 100644 (file)
@@ -85,6 +85,7 @@ static struct omap_gpio_reg_offs omap15xx_gpio_regs = {
        .irqenable      = OMAP1510_GPIO_INT_MASK,
        .irqenable_inv  = true,
        .irqctrl        = OMAP1510_GPIO_INT_CONTROL,
+       .pinctrl        = OMAP1510_GPIO_PIN_CONTROL,
 };
 
 static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = {
index 9e403e54f6f94d57b17e1b79567a550ce7028794..8be165108aad928958f596414ee12d24a380ac9f 100644 (file)
@@ -198,6 +198,7 @@ struct omap_gpio_reg_offs {
        u16 irqctrl;
        u16 edgectrl1;
        u16 edgectrl2;
+       u16 pinctrl;
 
        bool irqenable_inv;
 };
index a948351ad6c4dc57c5e084e3a954c1d406552a55..485b6b207ef9fdffde22a74b0d343d571c28fc2f 100644 (file)
@@ -490,15 +490,13 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset)
         */
        _set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
 
-#ifdef CONFIG_ARCH_OMAP15XX
-       if (bank->method == METHOD_GPIO_1510) {
-               void __iomem *reg;
+       if (bank->regs->pinctrl) {
+               void __iomem *reg = bank->base + bank->regs->pinctrl;
 
                /* Claim the pin for MPU */
-               reg = bank->base + OMAP1510_GPIO_PIN_CONTROL;
                __raw_writel(__raw_readl(reg) | (1 << offset), reg);
        }
-#endif
+
        if (bank->regs->ctrl && !bank->mod_usage) {
                void __iomem *reg = bank->base + bank->regs->ctrl;
                u32 ctrl;