summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2014-04-23 16:45:12 +0200
committerLinus Walleij <linus.walleij@linaro.org>2014-04-28 12:35:10 -0700
commit1333b90f33623cdc4028a3523bc186330573990a (patch)
tree7711c5c0ec5183caa813ecc7a02f9722148468b5 /drivers/gpio/gpiolib.c
parent95ad6b9da5d28dbd8a10e4e0091242504b3d13d1 (diff)
downloadop-kernel-dev-1333b90f33623cdc4028a3523bc186330573990a.zip
op-kernel-dev-1333b90f33623cdc4028a3523bc186330573990a.tar.gz
gpio: do not set up hardware for IRQ_TYPE_NONE
Some GPIO irqchip drivers exploit the irqdomain mapping function to set up the IRQ default type in the hardware, make sure that if we pass IRQ_TYPE_NONE, no hardware setup whatsoever takes place (this should be the norm) until later when the IRQ gets utilized. Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: linux-omap <linux-omap@vger.kernel.org> Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Javier Martinez Canillas <javier@dowhile0.org> Tested-by: Nishanth Menon <nm@ti.com> Acked-by: Nishanth Menon <nm@ti.com> Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index ee1819f..97d173e 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1409,7 +1409,12 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
#else
irq_set_noprobe(irq);
#endif
- irq_set_irq_type(irq, chip->irq_default_type);
+ /*
+ * No set-up of the hardware will happen if IRQ_TYPE_NONE
+ * is passed as default type.
+ */
+ if (chip->irq_default_type != IRQ_TYPE_NONE)
+ irq_set_irq_type(irq, chip->irq_default_type);
return 0;
}
@@ -1490,7 +1495,8 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
* @first_irq: if not dynamically assigned, the base (first) IRQ to
* allocate gpiochip irqs from
* @handler: the irq handler to use (often a predefined irq core function)
- * @type: the default type for IRQs on this irqchip
+ * @type: the default type for IRQs on this irqchip, pass IRQ_TYPE_NONE
+ * to have the core avoid setting up any default type in the hardware.
*
* This function closely associates a certain irqchip with a certain
* gpiochip, providing an irq domain to translate the local IRQs to
OpenPOWER on IntegriCloud