Skip to contentSkip to conversation

gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode

PATCH Superseded Marek Vasut 1 participant 1 message Jul 23, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode

Always configure GPIO pins which are used as interrupt source as INPUTs. In case the default pin configuration is OUTPUT, or the prior stage does configure the pins as OUTPUT, then Linux will not reconfigure the pin as INPUT and no interrupts are received.

Always configure interrupt source GPIO pin as input to fix the above case.

Cc Bartosz Golaszewski <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Loic Poulain <[email protected]>
Cc Marc Zyngier <[email protected]>
---
 drivers/gpio/gpio-mxc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpio/gpio-mxc.c +2 -0
index c871602fc5ba9..d4e8146e38d57 100644
@@ -204,6 +204,8 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
 
 	writel(1 << gpio_idx, port->base + GPIO_ISR);
 
+	writel(1 << gpio_idx, port->base + GPIO_GDIR);
+
 	return 0;
 }
 
Signature · 1 line
2.35.1