Skip to contentSkip to conversation

rtc: ds1307: Use irq when available for wakeup-source device

PATCH Applied Nishanth Menon 2 participants 2 messages Apr 19, 2016 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: ds1307: Use irq when available for wakeup-source device

With commit 8bc2a40730ec ("rtc: ds1307: add support for the DT property 'wakeup-source'") we lost the ability for rtc irq functionality for devices that are actually hooked on a real IRQ line and have capability to wakeup as well. This is not an expected behavior. So, instead of just not requesting IRQ, skip the IRQ requirement only if interrupts are not defined for the device.

Fixes 8bc2a40730ec ("rtc: ds1307: add support for the DT property 'wakeup-source'")
Cc Michael Lange <[email protected]>
Cc Alexandre Belloni <[email protected]>

---

 drivers/rtc/rtc-ds1307.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-ds1307.c +1 -1
index b2156ee5bae1..74cd5cd544ee 100644
@@ -1531,7 +1531,7 @@ read_rtc:
 		return PTR_ERR(ds1307->rtc);
 	}
 
-	if (ds1307_can_wakeup_device) {
+	if (ds1307_can_wakeup_device && ds1307->client->irq <= 0) {
 		/* Disable request for an IRQ */
 		want_irq = false;
 		dev_info(&client->dev, "'wakeup-source' is set, request for an IRQ is disabled!\n");
Signature · 1 line
2.8.0
#1 lore raw
Quoted 12 lines · Nishanth Menon

With commit 8bc2a40730ec ("rtc: ds1307: add support for the DT property 'wakeup-source'") we lost the ability for rtc irq functionality for devices that are actually hooked on a real IRQ line and have capability to wakeup as well. This is not an expected behavior. So, instead of just not requesting IRQ, skip the IRQ requirement only if interrupts are not defined for the device.

Fixes 8bc2a40730ec ("rtc: ds1307: add support for the DT property 'wakeup-source'")
Cc Michael Lange <[email protected]>
Cc Alexandre Belloni <[email protected]>
Quoted 5 lines

---

 drivers/rtc/rtc-ds1307.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Signature · 3 lines
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com