summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-twl4030.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-09-16 20:05:06 -0700
committerOlof Johansson <olof@lixom.net>2012-09-16 20:05:06 -0700
commit8e51036d348956a3cdb5a977234c395fdb82e170 (patch)
tree4069298c12089ae7702c6b14a3640dcc376f199c /drivers/gpio/gpio-twl4030.c
parenta73403d85ab43ca633e393bb130add337d69fadb (diff)
parent68cb700c59fae6cd539c9dc1e9f2584f671935a0 (diff)
downloadop-kernel-dev-8e51036d348956a3cdb5a977234c395fdb82e170.zip
op-kernel-dev-8e51036d348956a3cdb5a977234c395fdb82e170.tar.gz
Merge tag 'omap-cleanup-sparseirq-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanup
From Tony Lindgren: This branch contains changes needed to make omap2+ work properly with sparse IRQ. It also removes dependencies to mach/hardware.h. These help moving things towards ARM single zImage support. This branch is based on a commit in tty-next branch with omap-devel-gpmc-fixed-for-v3.7 and cleanup-omap-tags-for-v3.7 merged in to keep things compiling and sort out some merge conflicts. * tag 'omap-cleanup-sparseirq-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP1: Move SoC specific headers from plat to mach for omap1 ARM: OMAP2+ Move SoC specific headers to be local to mach-omap2 ARM: OMAP: Split plat/hardware.h, use local soc.h for omap2+ ARM: OMAP: Remove unused old gpio-switch.h ARM: OMAP1: Move plat/irqs.h to mach/irqs.h ARM: OMAP2+: Remove hardcoded IRQs and enable SPARSE_IRQ ARM: OMAP2+: Prepare for irqs.h removal W1: OMAP HDQ1W: Remove dependencies to mach/hardware.h Input: omap-keypad: Remove dependencies to mach includes ARM: OMAP: Move gpio.h to include/linux/platform_data ARM: OMAP2+: Remove hardcoded twl4030 gpio_base, irq_base and irq_end ARM: OMAP2+: Remove unused nand_irq for GPMC ARM: OMAP2+: Make INTCPS_NR_IRQS local for mach-omap2/irq.c ARM: OMAP1: Define OMAP1_INT_I2C locally ARM: OMAP1: Move define of OMAP_LCD_DMA to dma.h
Diffstat (limited to 'drivers/gpio/gpio-twl4030.c')
-rw-r--r--drivers/gpio/gpio-twl4030.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c
index 94256fe..f030880 100644
--- a/drivers/gpio/gpio-twl4030.c
+++ b/drivers/gpio/gpio-twl4030.c
@@ -51,6 +51,7 @@
static struct gpio_chip twl_gpiochip;
+static int twl4030_gpio_base;
static int twl4030_gpio_irq_base;
/* genirq interfaces are not available to modules */
@@ -428,8 +429,6 @@ no_irqs:
twl_gpiochip.dev = &pdev->dev;
if (pdata) {
- twl_gpiochip.base = pdata->gpio_base;
-
/*
* NOTE: boards may waste power if they don't set pullups
* and pulldowns correctly ... default for non-ULPI pins is
@@ -461,15 +460,21 @@ no_irqs:
dev_err(&pdev->dev, "could not register gpiochip, %d\n", ret);
twl_gpiochip.ngpio = 0;
gpio_twl4030_remove(pdev);
- } else if (pdata && pdata->setup) {
+ goto out;
+ }
+
+ twl4030_gpio_base = twl_gpiochip.base;
+
+ if (pdata && pdata->setup) {
int status;
status = pdata->setup(&pdev->dev,
- pdata->gpio_base, TWL4030_GPIO_MAX);
+ twl4030_gpio_base, TWL4030_GPIO_MAX);
if (status)
dev_dbg(&pdev->dev, "setup --> %d\n", status);
}
+out:
return ret;
}
@@ -481,7 +486,7 @@ static int gpio_twl4030_remove(struct platform_device *pdev)
if (pdata && pdata->teardown) {
status = pdata->teardown(&pdev->dev,
- pdata->gpio_base, TWL4030_GPIO_MAX);
+ twl4030_gpio_base, TWL4030_GPIO_MAX);
if (status) {
dev_dbg(&pdev->dev, "teardown --> %d\n", status);
return status;
OpenPOWER on IntegriCloud