Commit 1333b90f authored by Linus Walleij's avatar Linus Walleij

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 <>
Cc: Santosh Shilimkar <>
Cc: linux-omap <>
Tested-by: default avatarPeter Ujfalusi <>
Tested-by: default avatarJavier Martinez Canillas <>
Tested-by: default avatarNishanth Menon <>
Acked-by: default avatarNishanth Menon <>
Tested-by: default avatarTony Lindgren <>
Signed-off-by: Linus Walleij's avatarLinus Walleij <>
parent 95ad6b9d
......@@ -1409,7 +1409,12 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment