[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210511161244.16111-1-martin@kaiser.cx>
Date: Tue, 11 May 2021 18:12:44 +0200
From: Martin Kaiser <martin@...ser.cx>
To: Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Shawn Guo <shawnguo@...nel.org>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>
Cc: linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org,
Martin Kaiser <martin@...ser.cx>
Subject: [PATCH v3] rtc: imxdi: add wakeup support
The DryIce-based RTC supports alarms that trigger an interrupt.
Configure this interrupt as a wakeup source that wakes the system up
from standby mode.
Signed-off-by: Martin Kaiser <martin@...ser.cx>
---
v3:
- fix the commit message, the interrupt is always a wakeup source
v2:
- unconditionally declare rtc-imxdi as wakeup source
- use dev_pm_set_wake_irq instead of manually coding suspend and resume
drivers/rtc/rtc-imxdi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/rtc/rtc-imxdi.c b/drivers/rtc/rtc-imxdi.c
index c1806f4d68e7..4b712e5ab08a 100644
--- a/drivers/rtc/rtc-imxdi.c
+++ b/drivers/rtc/rtc-imxdi.c
@@ -24,6 +24,7 @@
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/pm_wakeirq.h>
#include <linux/rtc.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
@@ -811,6 +812,9 @@ static int __init dryice_rtc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, imxdi);
+ device_init_wakeup(&pdev->dev, true);
+ dev_pm_set_wake_irq(&pdev->dev, norm_irq);
+
imxdi->rtc->ops = &dryice_rtc_ops;
imxdi->rtc->range_max = U32_MAX;
--
2.20.1
Powered by blists - more mailing lists