diff options
author | Charulatha V <charu@ti.com> | 2011-05-25 15:03:46 +0530 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2011-07-14 11:53:43 -0700 |
commit | 355d05c3540eec8ae34bc8926a896e5a2b762f13 (patch) | |
tree | 7221902e95c594a8ae690f90a6929f5b42ea99a1 /drivers/gpio | |
parent | 16fef5c05c2f1eee93546842c6d8377c2a1134cd (diff) | |
download | kernel_samsung_tuna-355d05c3540eec8ae34bc8926a896e5a2b762f13.zip kernel_samsung_tuna-355d05c3540eec8ae34bc8926a896e5a2b762f13.tar.gz kernel_samsung_tuna-355d05c3540eec8ae34bc8926a896e5a2b762f13.tar.bz2 |
GPIO: OMAP: Remove bank->method & METHOD_* macros
The only bank->type (method) used in the OMAP GPIO driver is MPUIO type as they
need to be handled separately. Identify the same using a flag and remove all
METHOD_* macros.
Signed-off-by: Charulatha V <charu@ti.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-omap.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 90a107a..888f37e 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -49,7 +49,6 @@ struct gpio_bank { void __iomem *base; u16 irq; u16 virtual_irq_start; - int method; u32 suspend_wakeup; u32 saved_wakeup; u32 non_wakeup_gpios; @@ -66,6 +65,7 @@ struct gpio_bank { u32 mod_usage; u32 dbck_enable_mask; struct device *dev; + bool is_mpuio; bool dbck_flag; bool loses_context; bool suspend_support; @@ -708,8 +708,6 @@ static struct irq_chip gpio_irq_chip = { }; /*---------------------------------------------------------------------*/ -#define bank_is_mpuio(bank) ((bank)->method == METHOD_MPUIO) - static int omap_mpuio_suspend_noirq(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -773,10 +771,6 @@ static inline void mpuio_init(struct gpio_bank *bank) /*---------------------------------------------------------------------*/ -/* REVISIT these are stupid implementations! replace by ones that - * don't switch on METHOD_* and which mostly avoid spinlocks - */ - static int gpio_input(struct gpio_chip *chip, unsigned offset) { struct gpio_bank *bank; @@ -895,7 +889,7 @@ static void omap_gpio_mod_init(struct gpio_bank *bank) u32 clr_all = 0; /* clear all the bits */ u32 set_all = 0xFFFFFFFF; /* set all the bits */ - if (bank_is_mpuio(bank)) { + if (bank->is_mpuio) { __raw_writel(set_all, bank->base + bank->regs->irqenable); @@ -942,7 +936,7 @@ static void omap_gpio_mod_init(struct gpio_bank *bank) u16 clr_all = 0; /* clear all the bits */ u16 set_all = 0xFFFF; /* set all the bits */ - if (bank_is_mpuio(bank)) { + if (bank->is_mpuio) { __raw_writew(set_all, bank->base + bank->regs->irqenable); @@ -1035,7 +1029,7 @@ static void __devinit omap_gpio_chip_init(struct gpio_bank *bank) bank->chip.set_debounce = gpio_debounce; bank->chip.set = gpio_set; bank->chip.to_irq = gpio_2irq; - if (bank_is_mpuio(bank)) { + if (bank->is_mpuio) { bank->chip.label = "mpuio"; if (bank->suspend_support) bank->chip.dev = &omap_mpuio_device.dev; @@ -1053,7 +1047,7 @@ static void __devinit omap_gpio_chip_init(struct gpio_bank *bank) j < bank->virtual_irq_start + bank->width; j++) { irq_set_lockdep_class(j, &gpio_lock_class); irq_set_chip_data(j, bank); - if (bank_is_mpuio(bank)) { + if (bank->is_mpuio) { omap_mpuio_alloc_gc(bank, j, bank->width); } else { irq_set_chip(j, &gpio_irq_chip); @@ -1097,11 +1091,11 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev) pdata = pdev->dev.platform_data; bank->virtual_irq_start = pdata->virtual_irq_start; - bank->method = pdata->bank_type; bank->dev = &pdev->dev; bank->dbck_flag = pdata->dbck_flag; bank->stride = pdata->bank_stride; bank->width = pdata->bank_width; + bank->is_mpuio = pdata->is_mpuio; bank->suspend_support = pdata->suspend_support; bank->non_wakeup_gpios = pdata->non_wakeup_gpios; bank->loses_context = pdata->loses_context; |