diff options
author | David Brownell <david-b@pacbell.net> | 2006-12-13 03:35:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 12:05:52 -0500 |
commit | a2db8dfce8d94fecae50128d912fec7980687a51 (patch) | |
tree | 0670b0d16e3282967dabb073cad6a7e3342812f5 /drivers | |
parent | 5a6534e4cf53e16a6ea92f033f89d6575b3d7422 (diff) |
[PATCH] rtc framewok: rtc_wkalrm.enabled reporting updates
Fix a glitch in the procfs dumping of whether the alarm IRQ is enabled: use
the traditional name (from drivers/char/rtc.c and many other places) of
"alarm_IRQ", not "alrm_wakeup" (which didn't even match the efirtc code, which
originated that reporting API).
Also, update a few of the RTC drivers to stop providing that duplicate status,
and/or to expose it properly when reporting the alarm state. We really don't
want every RTC driver doing their own thing here...
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/rtc/rtc-at91rm9200.c | 5 | ||||
-rw-r--r-- | drivers/rtc/rtc-omap.c | 3 | ||||
-rw-r--r-- | drivers/rtc/rtc-proc.c | 2 | ||||
-rw-r--r-- | drivers/rtc/rtc-s3c.c | 6 | ||||
-rw-r--r-- | drivers/rtc/rtc-sa1100.c | 4 |
5 files changed, 8 insertions, 12 deletions
diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c index 5c8addcaf1fb..4f654c901c64 100644 --- a/drivers/rtc/rtc-at91rm9200.c +++ b/drivers/rtc/rtc-at91rm9200.c | |||
@@ -137,6 +137,9 @@ static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
137 | tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year); | 137 | tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year); |
138 | tm->tm_year = at91_alarm_year - 1900; | 138 | tm->tm_year = at91_alarm_year - 1900; |
139 | 139 | ||
140 | alrm->enabled = (at91_sys_read(AT91_RTC_IMR) & AT91_RTC_ALARM) | ||
141 | ? 1 : 0; | ||
142 | |||
140 | pr_debug("%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __FUNCTION__, | 143 | pr_debug("%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __FUNCTION__, |
141 | 1900 + tm->tm_year, tm->tm_mon, tm->tm_mday, | 144 | 1900 + tm->tm_year, tm->tm_mon, tm->tm_mday, |
142 | tm->tm_hour, tm->tm_min, tm->tm_sec); | 145 | tm->tm_hour, tm->tm_min, tm->tm_sec); |
@@ -223,8 +226,6 @@ static int at91_rtc_proc(struct device *dev, struct seq_file *seq) | |||
223 | { | 226 | { |
224 | unsigned long imr = at91_sys_read(AT91_RTC_IMR); | 227 | unsigned long imr = at91_sys_read(AT91_RTC_IMR); |
225 | 228 | ||
226 | seq_printf(seq, "alarm_IRQ\t: %s\n", | ||
227 | (imr & AT91_RTC_ALARM) ? "yes" : "no"); | ||
228 | seq_printf(seq, "update_IRQ\t: %s\n", | 229 | seq_printf(seq, "update_IRQ\t: %s\n", |
229 | (imr & AT91_RTC_ACKUPD) ? "yes" : "no"); | 230 | (imr & AT91_RTC_ACKUPD) ? "yes" : "no"); |
230 | seq_printf(seq, "periodic_IRQ\t: %s\n", | 231 | seq_printf(seq, "periodic_IRQ\t: %s\n", |
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index eac5fb1fc02f..d59880d44fba 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c | |||
@@ -279,9 +279,8 @@ static int omap_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) | |||
279 | local_irq_enable(); | 279 | local_irq_enable(); |
280 | 280 | ||
281 | bcd2tm(&alm->time); | 281 | bcd2tm(&alm->time); |
282 | alm->pending = !!(rtc_read(OMAP_RTC_INTERRUPTS_REG) | 282 | alm->enabled = !!(rtc_read(OMAP_RTC_INTERRUPTS_REG) |
283 | & OMAP_RTC_INTERRUPTS_IT_ALARM); | 283 | & OMAP_RTC_INTERRUPTS_IT_ALARM); |
284 | alm->enabled = alm->pending && device_may_wakeup(dev); | ||
285 | 284 | ||
286 | return 0; | 285 | return 0; |
287 | } | 286 | } |
diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c index 91a43c970b21..c272afd62173 100644 --- a/drivers/rtc/rtc-proc.c +++ b/drivers/rtc/rtc-proc.c | |||
@@ -65,7 +65,7 @@ static int rtc_proc_show(struct seq_file *seq, void *offset) | |||
65 | seq_printf(seq, "%02d\n", alrm.time.tm_mday); | 65 | seq_printf(seq, "%02d\n", alrm.time.tm_mday); |
66 | else | 66 | else |
67 | seq_printf(seq, "**\n"); | 67 | seq_printf(seq, "**\n"); |
68 | seq_printf(seq, "alrm_wakeup\t: %s\n", | 68 | seq_printf(seq, "alarm_IRQ\t: %s\n", |
69 | alrm.enabled ? "yes" : "no"); | 69 | alrm.enabled ? "yes" : "no"); |
70 | seq_printf(seq, "alrm_pending\t: %s\n", | 70 | seq_printf(seq, "alrm_pending\t: %s\n", |
71 | alrm.pending ? "yes" : "no"); | 71 | alrm.pending ? "yes" : "no"); |
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index e301dea57bb3..f406a2b55aea 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c | |||
@@ -191,6 +191,8 @@ static int s3c_rtc_getalarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
191 | 191 | ||
192 | alm_en = readb(base + S3C2410_RTCALM); | 192 | alm_en = readb(base + S3C2410_RTCALM); |
193 | 193 | ||
194 | alrm->enabled = (alm_en & S3C2410_RTCALM_ALMEN) ? 1 : 0; | ||
195 | |||
194 | pr_debug("read alarm %02x %02x.%02x.%02x %02x/%02x/%02x\n", | 196 | pr_debug("read alarm %02x %02x.%02x.%02x %02x/%02x/%02x\n", |
195 | alm_en, | 197 | alm_en, |
196 | alm_tm->tm_year, alm_tm->tm_mon, alm_tm->tm_mday, | 198 | alm_tm->tm_year, alm_tm->tm_mon, alm_tm->tm_mday, |
@@ -331,12 +333,8 @@ static int s3c_rtc_ioctl(struct device *dev, | |||
331 | 333 | ||
332 | static int s3c_rtc_proc(struct device *dev, struct seq_file *seq) | 334 | static int s3c_rtc_proc(struct device *dev, struct seq_file *seq) |
333 | { | 335 | { |
334 | unsigned int rtcalm = readb(s3c_rtc_base + S3C2410_RTCALM); | ||
335 | unsigned int ticnt = readb(s3c_rtc_base + S3C2410_TICNT); | 336 | unsigned int ticnt = readb(s3c_rtc_base + S3C2410_TICNT); |
336 | 337 | ||
337 | seq_printf(seq, "alarm_IRQ\t: %s\n", | ||
338 | (rtcalm & S3C2410_RTCALM_ALMEN) ? "yes" : "no" ); | ||
339 | |||
340 | seq_printf(seq, "periodic_IRQ\t: %s\n", | 338 | seq_printf(seq, "periodic_IRQ\t: %s\n", |
341 | (ticnt & S3C2410_TICNT_ENABLE) ? "yes" : "no" ); | 339 | (ticnt & S3C2410_TICNT_ENABLE) ? "yes" : "no" ); |
342 | 340 | ||
diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c index bd4d7d174ef4..9c8ead43a59c 100644 --- a/drivers/rtc/rtc-sa1100.c +++ b/drivers/rtc/rtc-sa1100.c | |||
@@ -289,9 +289,7 @@ static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
289 | 289 | ||
290 | static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq) | 290 | static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq) |
291 | { | 291 | { |
292 | seq_printf(seq, "trim/divider\t: 0x%08lx\n", RTTR); | 292 | seq_printf(seq, "trim/divider\t: 0x%08x\n", (u32) RTTR); |
293 | seq_printf(seq, "alarm_IRQ\t: %s\n", | ||
294 | (RTSR & RTSR_ALE) ? "yes" : "no" ); | ||
295 | seq_printf(seq, "update_IRQ\t: %s\n", | 293 | seq_printf(seq, "update_IRQ\t: %s\n", |
296 | (RTSR & RTSR_HZE) ? "yes" : "no"); | 294 | (RTSR & RTSR_HZE) ? "yes" : "no"); |
297 | seq_printf(seq, "periodic_IRQ\t: %s\n", | 295 | seq_printf(seq, "periodic_IRQ\t: %s\n", |