2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Machine dependent access functions for RTC registers.
8 * Copyright (C) 1996, 1997, 1998 Ralf Baechle
10 #ifndef _ASM_MC146818RTC_H
11 #define _ASM_MC146818RTC_H
17 * This structure defines how to access various features of
18 * different machine types and how to access them.
21 /* How to access the RTC register in a DS1287. */
22 unsigned char (*rtc_read_data)(unsigned long addr);
23 void (*rtc_write_data)(unsigned char data, unsigned long addr);
24 int (*rtc_bcd_mode)(void);
27 extern struct rtc_ops *rtc_ops;
30 * The yet supported machines all access the RTC index register via
31 * an ISA port access but the way to access the date register differs ...
33 #define CMOS_READ(addr) ({ \
34 rtc_ops->rtc_read_data(addr); \
36 #define CMOS_WRITE(val, addr) ({ \
37 rtc_ops->rtc_write_data(val, addr); \
39 #define RTC_ALWAYS_BCD \
40 rtc_ops->rtc_bcd_mode()
43 #define RTC_PORT(x) (0x70 + (x))
46 #endif /* _ASM_MC146818RTC_H */