Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / arch / mips / ite-boards / generic / time.c
index 30a6c0d..dee497a 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/sched.h>
 #include <linux/time.h>
 #include <linux/spinlock.h>
+#include <linux/mc146818rtc.h>
 
 #include <asm/time.h>
 #include <asm/mipsregs.h>
@@ -72,7 +73,7 @@ static inline int rtc_dm_binary(void) { return saved_control & RTC_DM_BINARY; }
 static inline unsigned char
 bin_to_hw(unsigned char c)
 {
-       if (rtc_dm_binary()) 
+       if (rtc_dm_binary())
                return c;
        else
                return ((c/10) << 4) + (c%10);
@@ -91,9 +92,9 @@ hw_to_bin(unsigned char c)
 static inline unsigned char
 hour_bin_to_hw(unsigned char c)
 {
-       if (rtc_24h()) 
+       if (rtc_24h())
                return bin_to_hw(c);
-       if (c >= 12) 
+       if (c >= 12)
                return 0x80 | bin_to_hw((c==12)?12:c-12);  /* 12 is 12pm */
        else
                return bin_to_hw((c==0)?12:c);  /* 0 is 12 AM, not 0 am */
@@ -105,9 +106,9 @@ hour_hw_to_bin(unsigned char c)
        unsigned char tmp = hw_to_bin(c&0x3f);
        if (rtc_24h())
                return tmp;
-       if (c & 0x80) 
+       if (c & 0x80)
                return (tmp==12)?12:tmp+12;     /* 12pm is 12, not 24 */
-       else 
+       else
                return (tmp==12)?0:tmp;         /* 12am is 0 */
 }
 
@@ -145,7 +146,7 @@ static unsigned long __init cal_r4koff(void)
        return (mips_hpt_frequency / HZ);
 }
 
-static unsigned long 
+static unsigned long
 it8172_rtc_get_time(void)
 {
        unsigned int year, mon, day, hour, min, sec;
@@ -166,12 +167,12 @@ it8172_rtc_get_time(void)
        hour = hour_hw_to_bin(CMOS_READ(RTC_HOURS));
        day = hw_to_bin(CMOS_READ(RTC_DAY_OF_MONTH));
        mon = hw_to_bin(CMOS_READ(RTC_MONTH));
-       year = hw_to_bin(CMOS_READ(RTC_YEAR)) + 
+       year = hw_to_bin(CMOS_READ(RTC_YEAR)) +
                hw_to_bin(*rtc_century_reg) * 100;
 
        /* restore interrupts */
        local_irq_restore(flags);
-               
+
        return mktime(year, mon, day, hour, min, sec);
 }
 
@@ -227,8 +228,8 @@ void __init it8172_time_init(void)
 
        local_irq_restore(flags);
 
-       rtc_get_time = it8172_rtc_get_time;
-       rtc_set_time = it8172_rtc_set_time;
+       rtc_mips_get_time = it8172_rtc_get_time;
+       rtc_mips_set_time = it8172_rtc_set_time;
 }
 
 #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)