Skip to contentSkip to conversation

pinctrl: mcp23s08: Don't change irq trigger type

PATCH New Dmitry Mastykin 1 participant 1 message Aug 21, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: mcp23s08: Don't change irq trigger type

IRQ polarity option "microchip,irq-active-high" not only sets polarity in IOCON_INTPOL register, but also imposes trigger type to interrupt-parent. Trigger type must be taken from device-tree "interrupts" property, otherwise:
- trigger type in device-tree unexpectedly doesn't correspond to real one;
- it's impossible to use inverting level shifter between mcp and interrupt-parent;

---
 drivers/pinctrl/pinctrl-mcp23s08.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/pinctrl/pinctrl-mcp23s08.c +2 -7
index db3d616abf93..824c3cc6a6e6 100644
@@ -572,16 +572,11 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
 {
 	struct gpio_chip *chip = &mcp->chip;
 	int err;
-	unsigned long irqflags = IRQF_ONESHOT | IRQF_SHARED;
-
-	if (mcp->irq_active_high)
-		irqflags |= IRQF_TRIGGER_HIGH;
-	else
-		irqflags |= IRQF_TRIGGER_LOW;
 
 	err = devm_request_threaded_irq(chip->parent, mcp->irq, NULL,
 					mcp23s08_irq,
-					irqflags, dev_name(chip->parent), mcp);
+					IRQF_ONESHOT | IRQF_SHARED,
+					dev_name(chip->parent), mcp);
 	if (err != 0) {
 		dev_err(chip->parent, "unable to request IRQ#%d: %d\n",
 			mcp->irq, err);
Signature · 1 line
2.34.1