linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / mips / tx4938 / common / rtc_rx5c348.c
index 07f782f..d249edb 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/string.h>
 #include <linux/rtc.h>
 #include <linux/time.h>
-#include <linux/bcd.h>
 #include <asm/time.h>
 #include <asm/tx4938/spi.h>
 
@@ -78,6 +77,17 @@ spi_rtc_io(unsigned char *inbuf, unsigned char *outbuf, unsigned int count)
                           inbufs, incounts, outbufs, outcounts, 0);
 }
 
+/*
+ * Conversion between binary and BCD.
+ */
+#ifndef BCD_TO_BIN
+#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
+#endif
+
+#ifndef BIN_TO_BCD
+#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
+#endif
+
 /* RTC-dependent code for time.c */
 
 static int
@@ -187,6 +197,6 @@ rtc_rx5c348_init(int chipid)
                srtc_24h = 1;
 
        /* set the function pointers */
-       rtc_mips_get_time = rtc_rx5c348_get_time;
-       rtc_mips_set_time = rtc_rx5c348_set_time;
+       rtc_get_time = rtc_rx5c348_get_time;
+       rtc_set_time = rtc_rx5c348_set_time;
 }