* [PATCH] rtc: rv3028: Use IRQ flags obtained from device tree if available
@ 2022-12-08 13:36 Wadim Egorov
2022-12-13 17:10 ` Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Wadim Egorov @ 2022-12-08 13:36 UTC (permalink / raw)
To: linux-rtc, linux-kernel, upstream; +Cc: a.zummo, alexandre.belloni
Make the interrupt pin of the RV3028 usable with GPIO controllers
without level type IRQs support, such as the TI Davinci GPIO controller.
Therefore, allow the IRQ type to be passed from the device tree if
available.
Based on commit d4785b46345c ("rtc: pcf2127: use IRQ flags obtained from device tree if available")
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
---
drivers/rtc/rtc-rv3028.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c
index dd170e3efd83..b0099e26e3b0 100644
--- a/drivers/rtc/rtc-rv3028.c
+++ b/drivers/rtc/rtc-rv3028.c
@@ -902,9 +902,20 @@ static int rv3028_probe(struct i2c_client *client)
return PTR_ERR(rv3028->rtc);
if (client->irq > 0) {
+ unsigned long flags;
+
+ /*
+ * If flags = 0, devm_request_threaded_irq() will use IRQ flags
+ * obtained from device tree.
+ */
+ if (dev_fwnode(&client->dev))
+ flags = 0;
+ else
+ flags = IRQF_TRIGGER_LOW;
+
ret = devm_request_threaded_irq(&client->dev, client->irq,
NULL, rv3028_handle_irq,
- IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+ flags | IRQF_ONESHOT,
"rv3028", rv3028);
if (ret) {
dev_warn(&client->dev, "unable to request IRQ, alarms disabled\n");
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] rtc: rv3028: Use IRQ flags obtained from device tree if available
2022-12-08 13:36 [PATCH] rtc: rv3028: Use IRQ flags obtained from device tree if available Wadim Egorov
@ 2022-12-13 17:10 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2022-12-13 17:10 UTC (permalink / raw)
To: upstream, linux-rtc, linux-kernel, Wadim Egorov; +Cc: a.zummo
On Thu, 8 Dec 2022 14:36:05 +0100, Wadim Egorov wrote:
> Make the interrupt pin of the RV3028 usable with GPIO controllers
> without level type IRQs support, such as the TI Davinci GPIO controller.
>
> Therefore, allow the IRQ type to be passed from the device tree if
> available.
>
> Based on commit d4785b46345c ("rtc: pcf2127: use IRQ flags obtained from device tree if available")
>
> [...]
Applied, thanks!
[1/1] rtc: rv3028: Use IRQ flags obtained from device tree if available
commit: 2d620d98d74311ac06719adf08dc9a695bd1a10b
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-12-13 17:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-08 13:36 [PATCH] rtc: rv3028: Use IRQ flags obtained from device tree if available Wadim Egorov
2022-12-13 17:10 ` Alexandre Belloni
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®