mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: alexandre.belloni@bootlin.com
To: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 04/12] rtc: m41t80: use IRQ flags obtained from fwnode
Date: Mon, 23 Jan 2023 21:02:09 +0100	[thread overview]
Message-ID: <20230123200217.1236011-4-alexandre.belloni@bootlin.com> (raw)
In-Reply-To: <20230123200217.1236011-1-alexandre.belloni@bootlin.com>

From: Alexandre Belloni <alexandre.belloni@bootlin.com>

Allow the IRQ type to be passed from the device tree if available as there
may be components changing the trigger type of the interrupt between the
RTC and the IRQ controller.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-m41t80.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
index 494052dbd39f..c1963f7c424d 100644
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -914,9 +914,14 @@ static int m41t80_probe(struct i2c_client *client)
 					      "wakeup-source");
 #endif
 	if (client->irq > 0) {
+		unsigned long irqflags = IRQF_TRIGGER_LOW;
+
+		if (dev_fwnode(&client->dev))
+			irqflags = 0;
+
 		rc = devm_request_threaded_irq(&client->dev, client->irq,
 					       NULL, m41t80_handle_irq,
-					       IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+					       irqflags | IRQF_ONESHOT,
 					       "m41t80", client);
 		if (rc) {
 			dev_warn(&client->dev, "unable to request IRQ, alarms disabled\n");
-- 
2.39.1


  parent reply	other threads:[~2023-01-23 20:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 20:02 [PATCH 01/12] rtc: rx8010: " alexandre.belloni
2023-01-23 20:02 ` [PATCH 02/12] rtc: ab-eoz9: " alexandre.belloni
2023-01-23 20:02 ` [PATCH 03/12] rtc: hym8563: " alexandre.belloni
2023-01-23 20:02 ` alexandre.belloni [this message]
2023-01-23 20:02 ` [PATCH 05/12] rtc: pcf2123: " alexandre.belloni
2023-01-23 20:02 ` [PATCH 06/12] rtc: pcf85063: " alexandre.belloni
2023-01-23 20:02 ` [PATCH 07/12] rtc: pcf8523: " alexandre.belloni
2023-01-23 20:02 ` [PATCH 08/12] rtc: pcf85363: use IRQ flags obtained fromfwnode alexandre.belloni
2023-01-23 20:02 ` [PATCH 09/12] rtc: pcf8563: use IRQ flags obtained from fwnode alexandre.belloni
2023-01-23 20:02 ` [PATCH 10/12] rtc: rv3029c2: " alexandre.belloni
2023-01-23 20:02 ` [PATCH 11/12] rtc: rv3032: " alexandre.belloni
2023-01-23 20:02 ` [PATCH 12/12] rtc: rv8803: " alexandre.belloni

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=20230123200217.1236011-4-alexandre.belloni@bootlin.com \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@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®