Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is subject to the terms and conditions of the GNU General Public
0003  * License.  See the file "COPYING" in the main directory of this archive
0004  * for more details.
0005  *
0006  * Copyright (C) 1998, 2001, 03 by Ralf Baechle
0007  *
0008  * RTC routines for PC style attached Dallas chip.
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 /* __ASM_MACH_GENERIC_MC146818RTC_H */