mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: linux-acpi@vger.kernel.org, linux-pm@lists.linux-foundation.org
Cc: linux-kernel@vger.kernel.org, Daniel Drake <dsd@laptop.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: [PATCH 04/15] rtc-cmos / PM: report wakeup event on ACPI RTC alarm
Date: Mon,  4 Jun 2012 01:39:55 -0400	[thread overview]
Message-ID: <b2201e5482bc2376ea5c049442850a260142ac40.1338786831.git.len.brown@intel.com> (raw)
In-Reply-To: <1338788406-29981-1-git-send-email-lenb@kernel.org>
In-Reply-To: <c5971456964290da7e98222892797b71ef793e62.1338786831.git.len.brown@intel.com>

From: Daniel Drake <dsd@laptop.org>

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>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/rtc/rtc-cmos.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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;
 
-- 
1.7.11.rc0.100.g5498c5f


  parent reply	other threads:[~2012-06-04  5:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-04  5:39 ACPI & Power Management Patches for Linux 3.5-rc1 Len Brown
2012-06-04  5:39 ` [PATCH 01/15] ACPI battery: only refresh the sysfs files when pertinent information changes Len Brown
2012-06-04  5:39   ` [PATCH 02/15] ACPI: Ignore invalid _PSS entries, but use valid ones Len Brown
2012-06-04  5:39   ` [PATCH 03/15] ACPI / PM: Generate wakeup events on fixed power button Len Brown
2012-06-04  5:39   ` Len Brown [this message]
2012-06-04  5:39   ` [PATCH 05/15] ACPI / PM: Fix error messages in drivers/acpi/bus.c Len Brown
2012-06-04  5:39   ` [PATCH 06/15] ACPI / PM: Make __acpi_bus_get_power() cover D3cold correctly Len Brown
2012-06-04  5:39   ` [PATCH 07/15] ACPI / PM: Make acpi_pm_device_sleep_state() follow the specification Len Brown
2012-06-04  5:39   ` [PATCH 08/15] acpi_video: fix leaking PCI references Len Brown
2012-06-04  5:40   ` [PATCH 09/15] acpi_video: Intel video is not always i915 Len Brown
2012-06-04  5:40   ` [PATCH 10/15] gma500: don't register the ACPI video bus Len Brown
2012-06-04  5:40   ` [PATCH 11/15] ACPI video: use after input_unregister_device() Len Brown
2012-06-04  5:40   ` [PATCH 12/15] tools/power turbostat: fix un-intended affinity of forked program Len Brown
2012-06-04  5:40   ` [PATCH 13/15] tools/power turbostat: fix IVB support Len Brown
2012-06-04  5:40   ` [PATCH 14/15] drivers: acpi: Fix dependency for ACPI_HOTPLUG_CPU Len Brown
2012-06-04  5:40   ` [PATCH 15/15] ACPI: fix acpi_bus.h build warnings when ACPI is not enabled Len Brown

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=b2201e5482bc2376ea5c049442850a260142ac40.1338786831.git.len.brown@intel.com \
    --to=lenb@kernel.org \
    --cc=dsd@laptop.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rjw@sisk.pl \
    /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®