0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef __ASM_MACH_GENERIC_MC146818RTC_H
0011 #define __ASM_MACH_GENERIC_MC146818RTC_H
0012
0013 #include <asm/io.h>
0014
0015 #define RTC_PORT(x) (0x70 + (x))
0016 #define RTC_IRQ 8
0017
0018 static inline unsigned char CMOS_READ(unsigned long addr)
0019 {
0020 outb_p(addr, RTC_PORT(0));
0021 return inb_p(RTC_PORT(1));
0022 }
0023
0024 static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
0025 {
0026 outb_p(addr, RTC_PORT(0));
0027 outb_p(data, RTC_PORT(1));
0028 }
0029
0030 #define RTC_ALWAYS_BCD 0
0031
0032 #ifndef mc146818_decode_year
0033 #define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900)
0034 #endif
0035
0036 #endif