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 08/12] rtc: pcf85363: use IRQ flags obtained fromfwnode
Date: Mon, 23 Jan 2023 21:02:13 +0100 [thread overview]
Message-ID: <20230123200217.1236011-8-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-pcf85363.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-pcf85363.c b/drivers/rtc/rtc-pcf85363.c
index c05b722f0060..5de323acd178 100644
--- a/drivers/rtc/rtc-pcf85363.c
+++ b/drivers/rtc/rtc-pcf85363.c
@@ -400,12 +400,17 @@ static int pcf85363_probe(struct i2c_client *client)
clear_bit(RTC_FEATURE_ALARM, pcf85363->rtc->features);
if (client->irq > 0) {
+ unsigned long irqflags = IRQF_TRIGGER_LOW;
+
+ if (dev_fwnode(&client->dev))
+ irqflags = 0;
+
regmap_write(pcf85363->regmap, CTRL_FLAGS, 0);
regmap_update_bits(pcf85363->regmap, CTRL_PIN_IO,
PIN_IO_INTA_OUT, PIN_IO_INTAPM);
ret = devm_request_threaded_irq(&client->dev, client->irq,
NULL, pcf85363_rtc_handle_irq,
- IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+ irqflags | IRQF_ONESHOT,
"pcf85363", client);
if (ret)
dev_warn(&client->dev, "unable to request IRQ, alarms disabled\n");
--
2.39.1
next prev 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: use IRQ flags obtained from fwnode 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 ` [PATCH 04/12] rtc: m41t80: " alexandre.belloni
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 ` alexandre.belloni [this message]
2023-01-23 20:02 ` [PATCH 09/12] rtc: pcf8563: " 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-8-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®