public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dirk Meul <dirk.meul-vA1bhqPz9FBZXbeN9DUtxg@public.gmane.org>
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH] reenable rtc alarm interrupt in acpi_power_off
Date: Mon, 10 Nov 2003 19:41:57 +0100	[thread overview]
Message-ID: <1068489717.1312.6.camel@aragorn> (raw)

[-- 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);
 }
 

                 reply	other threads:[~2003-11-10 18:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1068489717.1312.6.camel@aragorn \
    --to=dirk.meul-va1bhqpz9fbzxben9dutxg@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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