Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: pcf2123: use IRQ flags obtained from fwnode

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.

Link: https://lore.kernel.org/r/20230123200217.1236011-5-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

+6 -1
+6 -1
drivers/rtc/rtc-pcf2123.c
··· 413 413 414 414 /* Register alarm irq */ 415 415 if (spi->irq > 0) { 416 + unsigned long irqflags = IRQF_TRIGGER_LOW; 417 + 418 + if (dev_fwnode(&spi->dev)) 419 + irqflags = 0; 420 + 416 421 ret = devm_request_threaded_irq(&spi->dev, spi->irq, NULL, 417 422 pcf2123_rtc_irq, 418 - IRQF_TRIGGER_LOW | IRQF_ONESHOT, 423 + irqflags | IRQF_ONESHOT, 419 424 pcf2123_driver.driver.name, &spi->dev); 420 425 if (!ret) 421 426 device_init_wakeup(&spi->dev, true);