Skip to content

Commit 16b26f6

Browse files
wdmegrvalexandrebelloni
authored andcommitted
rtc: rv3028: Use IRQ flags obtained from device tree if available
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 d4785b4 ("rtc: pcf2127: use IRQ flags obtained from device tree if available") Signed-off-by: Wadim Egorov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 0feebde commit 16b26f6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/rtc/rtc-rv3028.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,9 +902,20 @@ static int rv3028_probe(struct i2c_client *client)
902902
return PTR_ERR(rv3028->rtc);
903903

904904
if (client->irq > 0) {
905+
unsigned long flags;
906+
907+
/*
908+
* If flags = 0, devm_request_threaded_irq() will use IRQ flags
909+
* obtained from device tree.
910+
*/
911+
if (dev_fwnode(&client->dev))
912+
flags = 0;
913+
else
914+
flags = IRQF_TRIGGER_LOW;
915+
905916
ret = devm_request_threaded_irq(&client->dev, client->irq,
906917
NULL, rv3028_handle_irq,
907-
IRQF_TRIGGER_LOW | IRQF_ONESHOT,
918+
flags | IRQF_ONESHOT,
908919
"rv3028", rv3028);
909920
if (ret) {
910921
dev_warn(&client->dev, "unable to request IRQ, alarms disabled\n");

0 commit comments

Comments
 (0)