diff options
author | Mark Lord <lkml@rtr.ca> | 2007-11-03 22:04:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-04 16:13:09 -0500 |
commit | 615bb29ccbe9fa06d9f33b29d9c3f51340726656 (patch) | |
tree | 705059547b9564e8c57afb1645db04bc4b7e556c /drivers/rtc/rtc-cmos.c | |
parent | b4f555081fdd27d13e6ff39d455d5aefae9d2c0c (diff) |
rtc: ignore msb when reading back mday from alarm
I have a system here that actively relies upon RTC wake alarms, and it
has been failing (again) for a few days when attempting to use the
/sys/class/rtc/rtc?/wakealarm interface.
The old (fixed by Linus) /proc/ interface still works, but I'd like to
get it using the new one.
This patch fixes rtc-cmos to ignore the two upper bits when reading the
BCD mday (day of month) register from CMOS. Some systems (eg. mine)
seem to have the top bit set to "1" for some reason.
The older /proc/ interface ignores the upper bits, and so we should too.
Signed-off-by: Mark Lord <mlord@pobox.com>
Acked-by: David Brownell <david-b@pacbell.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-cmos.c')
-rw-r--r-- | drivers/rtc/rtc-cmos.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index e3fe83a23cf7..29cf1457ca10 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c | |||
@@ -120,7 +120,8 @@ static int cmos_read_alarm(struct device *dev, struct rtc_wkalrm *t) | |||
120 | t->time.tm_hour = CMOS_READ(RTC_HOURS_ALARM); | 120 | t->time.tm_hour = CMOS_READ(RTC_HOURS_ALARM); |
121 | 121 | ||
122 | if (cmos->day_alrm) { | 122 | if (cmos->day_alrm) { |
123 | t->time.tm_mday = CMOS_READ(cmos->day_alrm); | 123 | /* ignore upper bits on readback per ACPI spec */ |
124 | t->time.tm_mday = CMOS_READ(cmos->day_alrm) & 0x3f; | ||
124 | if (!t->time.tm_mday) | 125 | if (!t->time.tm_mday) |
125 | t->time.tm_mday = -1; | 126 | t->time.tm_mday = -1; |
126 | 127 | ||