From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Daniel Drake <dsd@laptop.org>, Len Brown <lenb@kernel.org>
Cc: a.zummo@towertech.it, rtc-linux@googlegroups.com,
linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org,
pgf@laptop.org, John Stultz <john.stultz@linaro.org>
Subject: Re: [PATCH resend] rtc-cmos: report wakeup event on ACPI RTC alarm
Date: Thu, 10 May 2012 22:06:42 +0200 [thread overview]
Message-ID: <201205102206.42891.rjw@sisk.pl> (raw)
In-Reply-To: <20120509231845.0301C9D401E@zog.reactivated.net>
On Thursday, May 10, 2012, Daniel Drake wrote:
> When the ACPI-driven RTC alarm wakes the system, report it as a wakeup
> event. This allows userspace to determine that the reason for system
> wakeup was RTC alarm.
>
> Signed-off-by: Daniel Drake <dsd@laptop.org>
Len, John, any objections to this or may I take it for v3.5?
Rafael
> ---
> drivers/rtc/rtc-cmos.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> Resending after 3 weeks with no response.
>
> diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
> index 7d5f56e..4267789 100644
> --- a/drivers/rtc/rtc-cmos.c
> +++ b/drivers/rtc/rtc-cmos.c
> @@ -910,14 +910,17 @@ static inline int cmos_poweroff(struct device *dev)
>
> static u32 rtc_handler(void *context)
> {
> + struct device *dev = context;
> +
> + pm_wakeup_event(dev, 0);
> acpi_clear_event(ACPI_EVENT_RTC);
> acpi_disable_event(ACPI_EVENT_RTC, 0);
> return ACPI_INTERRUPT_HANDLED;
> }
>
> -static inline void rtc_wake_setup(void)
> +static inline void rtc_wake_setup(struct device *dev)
> {
> - acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL);
> + acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, dev);
> /*
> * After the RTC handler is installed, the Fixed_RTC event should
> * be disabled. Only when the RTC alarm is set will it be enabled.
> @@ -950,7 +953,7 @@ cmos_wake_setup(struct device *dev)
> if (acpi_disabled)
> return;
>
> - rtc_wake_setup();
> + rtc_wake_setup(dev);
> acpi_rtc_info.wake_on = rtc_wake_on;
> acpi_rtc_info.wake_off = rtc_wake_off;
>
>
next prev parent reply other threads:[~2012-05-10 20:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-09 23:18 [PATCH resend] rtc-cmos: report wakeup event on ACPI RTC alarm Daniel Drake
2012-05-10 20:06 ` Rafael J. Wysocki [this message]
2012-05-22 0:38 ` John Stultz
2012-05-22 15:12 ` Rafael J. Wysocki
2012-05-28 22:51 ` Daniel Drake
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=201205102206.42891.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=a.zummo@towertech.it \
--cc=dsd@laptop.org \
--cc=john.stultz@linaro.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pgf@laptop.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