mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] pinctrl: mcp23s08: Don't change irq trigger type
@ 2025-08-21  8:15 Dmitry Mastykin
  0 siblings, 0 replies; only message in thread
From: Dmitry Mastykin @ 2025-08-21  8:15 UTC (permalink / raw)
  To: Linus Walleij, linux-gpio, linux-kernel, Alexander Stein; +Cc: Dmitry Mastykin

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;

Signed-off-by: Dmitry Mastykin <mastichi@gmail.com>
---
 drivers/pinctrl/pinctrl-mcp23s08.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c
index db3d616abf93..824c3cc6a6e6 100644
--- a/drivers/pinctrl/pinctrl-mcp23s08.c
+++ b/drivers/pinctrl/pinctrl-mcp23s08.c
@@ -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);
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-08-21  8:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-21  8:15 [PATCH] pinctrl: mcp23s08: Don't change irq trigger type Dmitry Mastykin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®