public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] [PATCH 1/3] Allow to override the RTC alarm time
@ 2008-04-09  6:34 Zhao Yakui
  2008-04-09  7:34 ` David Brownell
  0 siblings, 1 reply; 13+ messages in thread
From: Zhao Yakui @ 2008-04-09  6:34 UTC (permalink / raw)
  To: linux-acpi; +Cc: lenb, rui.zhang, david-b

Subject: ACPI: Allow to override the RTC alarm time 
>From : Zhao Yakui <yakui.zhao@intel.com>

In current kernel when RTC alarm time is set and not fired,
it is impossible to set RTC alarm again. But it is more
reasonable that the RTC alarm time can be overrided.

At the same time there is a bug in the function of 
cmos_set_alarm. RTC alarm time for October can't be set 
correctly. 
For October: 0x0A will be written into the RTC region
(MONTH_ALARM). But in fact 0x10 should be written.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Zhang Rui  <rui.zhang@intel.com>

---
 drivers/rtc/rtc-cmos.c  |    5 ++---
 drivers/rtc/rtc-sysfs.c |    2 --
 2 files changed, 2 insertions(+), 5 deletions(-)

Index: linux-2.6/drivers/rtc/rtc-cmos.c
===================================================================
--- linux-2.6.orig/drivers/rtc/rtc-cmos.c
+++ linux-2.6/drivers/rtc/rtc-cmos.c
@@ -198,9 +198,8 @@ static int cmos_set_alarm(struct device 
 
 	/* Writing 0xff means "don't care" or "match all".  */
 
-	mon = t->time.tm_mon;
-	mon = (mon < 12) ? BIN2BCD(mon) : 0xff;
-	mon++;
+	mon = t->time.tm_mon + 1;
+	mon = (mon <= 12) ? BIN2BCD(mon) : 0xff;
 
 	mday = t->time.tm_mday;
 	mday = (mday >= 1 && mday <= 31) ? BIN2BCD(mday) : 0xff;
Index: linux-2.6/drivers/rtc/rtc-sysfs.c
===================================================================
--- linux-2.6.orig/drivers/rtc/rtc-sysfs.c
+++ linux-2.6/drivers/rtc/rtc-sysfs.c
@@ -163,8 +163,6 @@ rtc_sysfs_set_wakealarm(struct device *d
 		retval = rtc_read_alarm(rtc, &alm);
 		if (retval < 0)
 			return retval;
-		if (alm.enabled)
-			return -EBUSY;
 
 		alm.enabled = 1;
 	} else {



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-04-11  6:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-09  6:34 [RFC] [PATCH 1/3] Allow to override the RTC alarm time Zhao Yakui
2008-04-09  7:34 ` David Brownell
2008-04-09  7:46   ` Zhang, Rui
2008-04-09  8:27     ` David Brownell
2008-04-09 16:55       ` Zhao Yakui
2008-04-09 10:13         ` David Brownell
2008-04-10 11:08           ` Zhao Yakui
2008-04-11  5:13             ` David Brownell
2008-04-11 11:04           ` Zhao Yakui
2008-04-11  3:46             ` David Brownell
2008-04-11 12:44               ` Zhao Yakui
2008-04-11  5:12                 ` David Brownell
2008-04-11  6:30                 ` Alessandro Zummo

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