Import 2.3.18pre1
[davej-history.git] / include / asm-mips / mc146818rtc.h
blob2b455951ebac3eb33b7c988ebca57d4ebc5689bf
1 /* $Id: mc146818rtc.h,v 1.3 1998/06/25 20:19:26 ralf Exp $
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_MIPS_MC146818RTC_H
12 #define __ASM_MIPS_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_MIPS_MC146818RTC_H */