patch-2.1.126 linux/include/asm-mips/mc146818rtc.h
Next file: linux/include/asm-mips/md.h
Previous file: linux/include/asm-mips/keyboard.h
Back to the patch index
Back to the overall index
- Lines: 52
- Date:
Tue Oct 20 13:52:53 1998
- Orig file:
v2.1.125/linux/include/asm-mips/mc146818rtc.h
- Orig date:
Thu Jun 26 12:33:39 1997
diff -u --recursive --new-file v2.1.125/linux/include/asm-mips/mc146818rtc.h linux/include/asm-mips/mc146818rtc.h
@@ -1,15 +1,20 @@
-/*
+/* $Id: mc146818rtc.h,v 1.3 1998/06/25 20:19:26 ralf Exp $
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
* Machine dependent access functions for RTC registers.
+ *
+ * Copyright (C) 1996, 1997, 1998 Ralf Baechle
*/
#ifndef __ASM_MIPS_MC146818RTC_H
#define __ASM_MIPS_MC146818RTC_H
#include <asm/io.h>
-#include <asm/vector.h>
#ifndef RTC_PORT
#define RTC_PORT(x) (0x70 + (x))
-#define RTC_ALWAYS_BCD 0 /* RTC operates in binary mode */
#endif
/*
@@ -17,10 +22,25 @@
* an ISA port access but the way to access the date register differs ...
*/
#define CMOS_READ(addr) ({ \
-feature->rtc_read_data(addr); \
+rtc_ops->rtc_read_data(addr); \
})
#define CMOS_WRITE(val, addr) ({ \
-feature->rtc_write_data(val, addr); \
+rtc_ops->rtc_write_data(val, addr); \
})
+#define RTC_ALWAYS_BCD \
+rtc_ops->rtc_bcd_mode()
+
+/*
+ * This structure defines how to access various features of
+ * different machine types and how to access them.
+ */
+struct rtc_ops {
+ /* How to access the RTC register in a DS1287. */
+ unsigned char (*rtc_read_data)(unsigned long addr);
+ void (*rtc_write_data)(unsigned char data, unsigned long addr);
+ int (*rtc_bcd_mode)(void);
+};
+
+extern struct rtc_ops *rtc_ops;
#endif /* __ASM_MIPS_MC146818RTC_H */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov