Skip to contentSkip to conversation

rtc-sa1100 correctly reports rtc_wkalrm.enabled

PATCH New David Brownell 1 participant 1 message Jan 6, 2007 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc-sa1100 correctly reports rtc_wkalrm.enabled

This fixes one bug in the SA-1100/PXA RTC support: read_alarm() isn't reporting whether the alarm is enabled. This causes a small regression, with procfs no longer reporting that state.

---
Note there are still bugs with how this driver handles this "enabled" flag when it _sets_ alarms. I'm told the hh.org tree already merged this particular patch.

drivers/rtc/rtc-sa1100.c +5 -1
Index: at91/drivers/rtc/rtc-sa1100.c
===================================================================
@@ -263,8 +263,12 @@ static int sa1100_rtc_set_time(struct de
 
 static int sa1100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
 {
+	u32 rtsr;
+
 	memcpy(&alrm->time, &rtc_alarm, sizeof(struct rtc_time));
-	alrm->pending = RTSR & RTSR_AL ? 1 : 0;
+	rtsr = RTSR;
+	alrm->enabled = (rtsr & RTSR_ALE) ? 1 : 0;
+	alrm->pending = (rtsr & RTSR_AL) ? 1 : 0;
 	return 0;
 }