public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reenable rtc alarm interrupt in acpi_power_off
@ 2003-11-10 18:41 Dirk Meul
  0 siblings, 0 replies; only message in thread
From: Dirk Meul @ 2003-11-10 18:41 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 515 bytes --]

Hello!

I need attached patch for powering on my computer by the RTC alarm
clock. The lines are copied from drivers/acpi/sleep/proc.c. With this
patch i'm able to set the wakeup time with /proc/acpi/alarm. Without
this patch this will only work for S1, so it maybe that i will need a
similar patch for S3.

Regards,
-- 
                           /"\
Dirk Meul                  \ /    ASCII Ribbon Campaign
dirk.meul-vA1bhqPz9FBZXbeN9DUtxg@public.gmane.org    X     Against HTML Mail
                           / \

[-- Attachment #2: fix-rtc-alarm-interrupt.diff --]
[-- Type: text/x-patch, Size: 756 bytes --]

--- linux-2.6.0-test9/drivers/acpi/sleep/poweroff.c	2003-09-28 02:51:07.000000000 +0200
+++ linux-2.6.0-test9-dm2/drivers/acpi/sleep/poweroff.c	2003-11-10 18:30:28.000000000 +0100
@@ -9,12 +9,25 @@
 #include <linux/init.h>
 #include <acpi/acpi_bus.h>
 
+#ifdef CONFIG_X86
+#include <linux/mc146818rtc.h>
+#endif
+
 static void
 acpi_power_off (void)
 {
+	unsigned char rtc_control = 0;
+	
 	printk("%s called\n",__FUNCTION__);
 	acpi_enter_sleep_state_prep(ACPI_STATE_S5);
 	ACPI_DISABLE_IRQS();
+	/* enable the rtc alarm interrupt */
+	rtc_control = CMOS_READ(RTC_CONTROL);
+	if (!(rtc_control & RTC_AIE)) {
+		rtc_control |= RTC_AIE;
+		CMOS_WRITE(rtc_control,RTC_CONTROL);
+		CMOS_READ(RTC_INTR_FLAGS);
+	}
 	acpi_enter_sleep_state(ACPI_STATE_S5);
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-10 18:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-10 18:41 [PATCH] reenable rtc alarm interrupt in acpi_power_off Dirk Meul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox