mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Mastykin <mastichi@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Dmitry Mastykin <mastichi@gmail.com>
Subject: [PATCH] pinctrl: mcp23s08: Don't change irq trigger type
Date: Thu, 21 Aug 2025 11:15:32 +0300	[thread overview]
Message-ID: <20250821081532.3084159-1-mastichi@gmail.com> (raw)

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


                 reply	other threads:[~2025-08-21  8:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250821081532.3084159-1-mastichi@gmail.com \
    --to=mastichi@gmail.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®