summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorMartin Kaiser <martin@kaiser.cx>2021-05-11 18:12:44 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2021-05-25 00:41:25 +0200
commitbcae59d0d45b866d5b9525ea8ece6d671e6767c8 (patch)
tree61f081c860a443cc3deb6326fe91374faba2a5b6 /drivers/rtc
parent37401019fe32b37c78b50163e4b4ffc2dbce4830 (diff)
downloadlinux-bcae59d0d45b866d5b9525ea8ece6d671e6767c8.tar.bz2
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@kaiser.cx> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210511161244.16111-1-martin@kaiser.cx
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-imxdi.c4
1 files changed, 4 insertions, 0 deletions
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;