From: Andrew Morton <akpm@linux-foundation.org>
To: Yauhen Kharuzhy <jekhor@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org,
Daniel Mack <daniel@caiaq.de>
Subject: Re: [PATCH 2/2] RTC MXC: Make alarm working
Date: Mon, 28 Nov 2011 14:56:15 -0800 [thread overview]
Message-ID: <20111128145615.98789cfc.akpm@linux-foundation.org> (raw)
In-Reply-To: <1320598006-17678-3-git-send-email-jekhor@gmail.com>
On Sun, 6 Nov 2011 19:46:46 +0300
Yauhen Kharuzhy <jekhor@gmail.com> wrote:
> Fix alarm IRQ handling, make the alarm one-shot. Cleanup black magick with
> a validation of already validated time data.
>
> Add ability to wake the system with alarm.
>
> ...
>
> +#ifdef CONFIG_PM
> +static int mxc_rtc_suspend(struct device *dev)
> +{
> + struct rtc_plat_data *pdata = dev_get_drvdata(dev);
> +
> + if (device_may_wakeup(dev))
> + enable_irq_wake(pdata->irq);
> +
> + return 0;
> +}
> +
> +static int mxc_rtc_resume(struct device *dev)
> +{
> + struct rtc_plat_data *pdata = dev_get_drvdata(dev);
> +
> + if (device_may_wakeup(dev))
> + disable_irq_wake(pdata->irq);
> +
> + return 0;
> +}
> +#endif
> +
> +static struct dev_pm_ops mxc_rtc_pm_ops = {
> + .suspend = mxc_rtc_suspend,
> + .resume = mxc_rtc_resume,
> +};
> +
> static struct platform_driver mxc_rtc_driver = {
> .driver = {
> .name = "mxc_rtc",
> +#ifdef CONFIG_PM
> + .pm = &mxc_rtc_pm_ops,
> +#endif
> .owner = THIS_MODULE,
> },
> .remove = __exit_p(mxc_rtc_remove),
This won't compile with CONFIG_PM=n. Fix:
--- a/drivers/rtc/rtc-mxc.c~drivers-rtc-rtc-mxcc-make-alarm-work-fix
+++ a/drivers/rtc/rtc-mxc.c
@@ -466,12 +466,12 @@ static int mxc_rtc_resume(struct device
return 0;
}
-#endif
static struct dev_pm_ops mxc_rtc_pm_ops = {
.suspend = mxc_rtc_suspend,
.resume = mxc_rtc_resume,
};
+#endif
static struct platform_driver mxc_rtc_driver = {
.driver = {
_
prev parent reply other threads:[~2011-11-28 22:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-06 16:46 [PATCH 0/2] i.MX1 RTC fixes Yauhen Kharuzhy
2011-11-06 16:46 ` [PATCH 1/2] RTC MXC: Fix setting time for MX1 SoC Yauhen Kharuzhy
2011-11-06 16:46 ` [PATCH 2/2] RTC MXC: Make alarm working Yauhen Kharuzhy
2011-11-28 22:56 ` Andrew Morton [this message]
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=20111128145615.98789cfc.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=a.zummo@towertech.it \
--cc=daniel@caiaq.de \
--cc=jekhor@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.com \
/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
all inboxes | Powered by JetHome®