patch-2.4.20 linux-2.4.20/arch/mips/ddb5xxx/common/rtc_ds1386.c
Next file: linux-2.4.20/arch/mips/ddb5xxx/ddb5074/Makefile
Previous file: linux-2.4.20/arch/mips/ddb5xxx/common/prom.c
Back to the patch index
Back to the overall index
- Lines: 52
- Date:
Thu Nov 28 15:53:09 2002
- Orig file:
linux-2.4.19/arch/mips/ddb5xxx/common/rtc_ds1386.c
- Orig date:
Fri Aug 2 17:39:43 2002
diff -urN linux-2.4.19/arch/mips/ddb5xxx/common/rtc_ds1386.c linux-2.4.20/arch/mips/ddb5xxx/common/rtc_ds1386.c
@@ -24,6 +24,7 @@
#include <asm/time.h>
#include <asm/addrspace.h>
+#include <asm/mc146818rtc.h>
#include <asm/debug.h>
#define EPOCH 2000
@@ -41,7 +42,7 @@
static unsigned long
rtc_ds1386_get_time(void)
-{
+{
u8 byte;
u8 temp;
unsigned int year, month, day, hour, minute, second;
@@ -78,7 +79,7 @@
return mktime(year, month, day, hour, minute, second);
}
-static int
+static int
rtc_ds1386_set_time(unsigned long t)
{
struct rtc_time tm;
@@ -94,6 +95,7 @@
/* convert */
to_tm(t, &tm);
+
/* check each field one by one */
year = BIN_TO_BCD(tm.tm_year - EPOCH);
if (year != READ_RTC(0xA)) {
@@ -136,7 +138,7 @@
if (second != READ_RTC(0x1)) {
WRITE_RTC(0x1, second);
}
-
+
return 0;
}
@@ -144,7 +146,7 @@
rtc_ds1386_init(unsigned long base)
{
unsigned char byte;
-
+
/* remember the base */
rtc_base = base;
db_assert((rtc_base & 0xe0000000) == KSEG1);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)