linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] rtc: fsl-ftm-alarm: fix freeze(s2idle) failed to wake
@ 2020-06-01  7:19 Ran Wang
  2020-06-05 22:34 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Ran Wang @ 2020-06-01  7:19 UTC (permalink / raw)
  To: Alexandre Belloni, Alessandro Zummo, Li Biwen
  Cc: linux-rtc, linux-kernel, Ran Wang

Use dev_pm_set_wake_irq() instead of flag IRQF_NO_SUSPEND to enable
wakeup system feature for both freeze(s2idle) and mem(deep).

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
Change in v2:
 - Remove wakeup-source control since the irq should be able to wakeup.
   And this is not the case that RTC interrupt line is not connected
   directly to SoC.

 drivers/rtc/rtc-fsl-ftm-alarm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-ftm-alarm.c
index 756af62..6775205 100644
--- a/drivers/rtc/rtc-fsl-ftm-alarm.c
+++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
@@ -21,6 +21,7 @@
 #include <linux/rtc.h>
 #include <linux/time.h>
 #include <linux/acpi.h>
+#include <linux/pm_wakeirq.h>
 
 #define FTM_SC_CLK(c)		((c) << FTM_SC_CLK_MASK_SHIFT)
 
@@ -274,7 +275,7 @@ static int ftm_rtc_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_request_irq(&pdev->dev, irq, ftm_rtc_alarm_interrupt,
-			       IRQF_NO_SUSPEND, dev_name(&pdev->dev), rtc);
+			       0, dev_name(&pdev->dev), rtc);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "failed to request irq\n");
 		return ret;
@@ -287,6 +288,9 @@ static int ftm_rtc_probe(struct platform_device *pdev)
 	rtc->rtc_dev->ops = &ftm_rtc_ops;
 
 	device_init_wakeup(&pdev->dev, true);
+	ret = dev_pm_set_wake_irq(&pdev->dev, irq);
+	if (ret)
+		dev_err(&pdev->dev, "failed to enable irq wake\n");
 
 	ret = rtc_register_device(rtc->rtc_dev);
 	if (ret) {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] rtc: fsl-ftm-alarm: fix freeze(s2idle) failed to wake
  2020-06-01  7:19 [PATCH v2] rtc: fsl-ftm-alarm: fix freeze(s2idle) failed to wake Ran Wang
@ 2020-06-05 22:34 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2020-06-05 22:34 UTC (permalink / raw)
  To: Ran Wang, Alessandro Zummo, Li Biwen
  Cc: Alexandre Belloni, linux-rtc, linux-kernel

On Mon, 1 Jun 2020 15:19:14 +0800, Ran Wang wrote:
> Use dev_pm_set_wake_irq() instead of flag IRQF_NO_SUSPEND to enable
> wakeup system feature for both freeze(s2idle) and mem(deep).

Applied, thanks!

[1/1] rtc: fsl-ftm-alarm: fix freeze(s2idle) failed to wake
      commit: 3a8ce46ce15accad53b39837735c12d886964211

Best regards,
-- 
Alexandre Belloni <alexandre.belloni@bootlin.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-05 22:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-01  7:19 [PATCH v2] rtc: fsl-ftm-alarm: fix freeze(s2idle) failed to wake Ran Wang
2020-06-05 22:34 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).