Revert last change. Bug noticed by Linus.
[linux-2.6/linux-mips.git] / include / asm-mips64 / mc146818rtc.h
blobf9e51fa61902096f05eab8442d70d71dc21909fa
1 /* $Id$
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
7 * Machine dependent access functions for RTC registers.
9 * Copyright (C) 1996, 1997, 1998 Ralf Baechle
11 #ifndef _ASM_MC146818RTC_H
12 #define _ASM_MC146818RTC_H
14 #include <asm/io.h>
16 #ifndef RTC_PORT
17 #define RTC_PORT(x) (0x70 + (x))
18 #endif
21 * The yet supported machines all access the RTC index register via
22 * an ISA port access but the way to access the date register differs ...
24 #define CMOS_READ(addr) ({ \
25 rtc_ops->rtc_read_data(addr); \
27 #define CMOS_WRITE(val, addr) ({ \
28 rtc_ops->rtc_write_data(val, addr); \
30 #define RTC_ALWAYS_BCD \
31 rtc_ops->rtc_bcd_mode()
34 * This structure defines how to access various features of
35 * different machine types and how to access them.
37 struct rtc_ops {
38 /* How to access the RTC register in a DS1287. */
39 unsigned char (*rtc_read_data)(unsigned long addr);
40 void (*rtc_write_data)(unsigned char data, unsigned long addr);
41 int (*rtc_bcd_mode)(void);
44 extern struct rtc_ops *rtc_ops;
46 #endif /* _ASM_MC146818RTC_H */