From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Martin Kaiser <martin@kaiser.cx>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
Shawn Guo <shawnguo@kernel.org>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] rtc: imxdi: add wakeup support
Date: Wed, 5 May 2021 19:34:30 +0200 [thread overview]
Message-ID: <YJLXJgiMw6u4+rtF@piout.net> (raw)
In-Reply-To: <20210505163009.14252-1-martin@kaiser.cx>
Hi,
On 05/05/2021 18:30:09+0200, Martin Kaiser wrote:
> The DryIce-based RTC supports alarms that trigger an interrupt.
>
> Add an option to configure this interrupt as a wakeup source that wakes the
> system up from standby mode.
>
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
> v2:
> - unconditionally declare rtc-imxdi as wakeup source
> - use dev_pm_set_wake_irq instead of manually coding suspend and resume
>
> simple test (no need to configure the wakeup source via sysfs any more)
>
> [root@board ]# rtcwake -s 3 -m mem
> wakeup from "mem" at Fri Apr 30 09:23:52 2021
> ...
> [root@board ]#
>
> 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);
> +
That's nice and concise ;) I'll apply that once -rc1 is released
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2021-05-05 17:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 9:32 [PATCH] rtc: imxdi: add wakeup support Martin Kaiser
2021-05-01 10:05 ` Alexandre Belloni
2021-05-04 10:08 ` Martin Kaiser
2021-05-04 12:12 ` Alexandre Belloni
2021-05-05 16:25 ` Martin Kaiser
2021-05-05 16:30 ` [PATCH v2] " Martin Kaiser
2021-05-05 17:34 ` Alexandre Belloni [this message]
2021-05-11 16:12 ` [PATCH v3] " Martin Kaiser
2021-05-24 22:43 ` Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YJLXJgiMw6u4+rtF@piout.net \
--to=alexandre.belloni@bootlin.com \
--cc=a.zummo@towertech.it \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=martin@kaiser.cx \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).