Commit 3a8ce46c authored by Ran Wang's avatar Ran Wang Committed by Alexandre Belloni

rtc: fsl-ftm-alarm: fix freeze(s2idle) failed to wake

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: default avatarRan Wang <ran.wang_1@nxp.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200601071914.36444-1-ran.wang_1@nxp.com
parent 6e429f6b
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/rtc.h> #include <linux/rtc.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/pm_wakeirq.h>
#define FTM_SC_CLK(c) ((c) << FTM_SC_CLK_MASK_SHIFT) #define FTM_SC_CLK(c) ((c) << FTM_SC_CLK_MASK_SHIFT)
...@@ -272,7 +273,7 @@ static int ftm_rtc_probe(struct platform_device *pdev) ...@@ -272,7 +273,7 @@ static int ftm_rtc_probe(struct platform_device *pdev)
return irq; return irq;
ret = devm_request_irq(&pdev->dev, irq, ftm_rtc_alarm_interrupt, 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) { if (ret < 0) {
dev_err(&pdev->dev, "failed to request irq\n"); dev_err(&pdev->dev, "failed to request irq\n");
return ret; return ret;
...@@ -285,6 +286,9 @@ static int ftm_rtc_probe(struct platform_device *pdev) ...@@ -285,6 +286,9 @@ static int ftm_rtc_probe(struct platform_device *pdev)
rtc->rtc_dev->ops = &ftm_rtc_ops; rtc->rtc_dev->ops = &ftm_rtc_ops;
device_init_wakeup(&pdev->dev, true); 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); ret = rtc_register_device(rtc->rtc_dev);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment