]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] rtc framewok: rtc_wkalrm.enabled reporting updates
authorDavid Brownell <david-b@pacbell.net>
Wed, 13 Dec 2006 08:35:08 +0000 (00:35 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Wed, 13 Dec 2006 17:05:52 +0000 (09:05 -0800)
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>
drivers/rtc/rtc-at91rm9200.c
drivers/rtc/rtc-omap.c
drivers/rtc/rtc-proc.c
drivers/rtc/rtc-s3c.c
drivers/rtc/rtc-sa1100.c

index 5c8addcaf1fbd8a0a49078155a81be129b040800..4f654c901c64d8c37278970576d13cdd829de904 100644 (file)
@@ -137,6 +137,9 @@ static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
        tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year);
        tm->tm_year = at91_alarm_year - 1900;
 
+       alrm->enabled = (at91_sys_read(AT91_RTC_IMR) & AT91_RTC_ALARM)
+                       ? 1 : 0;
+
        pr_debug("%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __FUNCTION__,
                1900 + tm->tm_year, tm->tm_mon, tm->tm_mday,
                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)
 {
        unsigned long imr = at91_sys_read(AT91_RTC_IMR);
 
-       seq_printf(seq, "alarm_IRQ\t: %s\n",
-                       (imr & AT91_RTC_ALARM) ? "yes" : "no");
        seq_printf(seq, "update_IRQ\t: %s\n",
                        (imr & AT91_RTC_ACKUPD) ? "yes" : "no");
        seq_printf(seq, "periodic_IRQ\t: %s\n",
index eac5fb1fc02f4c9a66ff4d8e4bffacea3cee9715..d59880d44fba26e3555c46d000c13a65e12d3ec4 100644 (file)
@@ -279,9 +279,8 @@ static int omap_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
        local_irq_enable();
 
        bcd2tm(&alm->time);
-       alm->pending = !!(rtc_read(OMAP_RTC_INTERRUPTS_REG)
+       alm->enabled = !!(rtc_read(OMAP_RTC_INTERRUPTS_REG)
                        & OMAP_RTC_INTERRUPTS_IT_ALARM);
-       alm->enabled = alm->pending && device_may_wakeup(dev);
 
        return 0;
 }
index 91a43c970b2183a15281e5ce020a973d7fdb2a82..c272afd62173245b3d6d503fd9703a8102891329 100644 (file)
@@ -65,7 +65,7 @@ static int rtc_proc_show(struct seq_file *seq, void *offset)
                        seq_printf(seq, "%02d\n", alrm.time.tm_mday);
                else
                        seq_printf(seq, "**\n");
-               seq_printf(seq, "alrm_wakeup\t: %s\n",
+               seq_printf(seq, "alarm_IRQ\t: %s\n",
                                alrm.enabled ? "yes" : "no");
                seq_printf(seq, "alrm_pending\t: %s\n",
                                alrm.pending ? "yes" : "no");
index e301dea57bb37fff0918791a2f6e74117c079b88..f406a2b55aea829b48e05b53180e40e8b1a48a04 100644 (file)
@@ -191,6 +191,8 @@ static int s3c_rtc_getalarm(struct device *dev, struct rtc_wkalrm *alrm)
 
        alm_en = readb(base + S3C2410_RTCALM);
 
+       alrm->enabled = (alm_en & S3C2410_RTCALM_ALMEN) ? 1 : 0;
+
        pr_debug("read alarm %02x %02x.%02x.%02x %02x/%02x/%02x\n",
                 alm_en,
                 alm_tm->tm_year, alm_tm->tm_mon, alm_tm->tm_mday,
@@ -331,12 +333,8 @@ static int s3c_rtc_ioctl(struct device *dev,
 
 static int s3c_rtc_proc(struct device *dev, struct seq_file *seq)
 {
-       unsigned int rtcalm = readb(s3c_rtc_base + S3C2410_RTCALM);
        unsigned int ticnt = readb(s3c_rtc_base + S3C2410_TICNT);
 
-       seq_printf(seq, "alarm_IRQ\t: %s\n",
-                  (rtcalm & S3C2410_RTCALM_ALMEN) ? "yes" : "no" );
-
        seq_printf(seq, "periodic_IRQ\t: %s\n",
                     (ticnt & S3C2410_TICNT_ENABLE) ? "yes" : "no" );
 
index bd4d7d174ef4a01a7d58d5835cea904d910e50dc..9c8ead43a59c38561c1393ea32a1b66b187e0578 100644 (file)
@@ -289,9 +289,7 @@ static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
 
 static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq)
 {
-       seq_printf(seq, "trim/divider\t: 0x%08lx\n", RTTR);
-       seq_printf(seq, "alarm_IRQ\t: %s\n",
-                       (RTSR & RTSR_ALE) ? "yes" : "no" );
+       seq_printf(seq, "trim/divider\t: 0x%08x\n", (u32) RTTR);
        seq_printf(seq, "update_IRQ\t: %s\n",
                        (RTSR & RTSR_HZE) ? "yes" : "no");
        seq_printf(seq, "periodic_IRQ\t: %s\n",