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  * Copyright (C) 2007 Thomas Bogendoerfer
0008  *
0009  * RTC routines for Jazz style attached Dallas chip.
0010  */
0011 #ifndef __ASM_MACH_JAZZ_MC146818RTC_H
0012 #define __ASM_MACH_JAZZ_MC146818RTC_H
0013 
0014 #include <linux/delay.h>
0015 
0016 #include <asm/io.h>
0017 #include <asm/jazz.h>
0018 
0019 #define RTC_PORT(x) (0x70 + (x))
0020 #define RTC_IRQ     8
0021 
0022 static inline unsigned char CMOS_READ(unsigned long addr)
0023 {
0024     outb_p(addr, RTC_PORT(0));
0025     return *(volatile char *)JAZZ_RTC_BASE;
0026 }
0027 
0028 static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
0029 {
0030     outb_p(addr, RTC_PORT(0));
0031     *(volatile char *)JAZZ_RTC_BASE = data;
0032 }
0033 
0034 #define RTC_ALWAYS_BCD  0
0035 
0036 #define mc146818_decode_year(year) ((year) + 1980)
0037 
0038 #endif /* __ASM_MACH_JAZZ_MC146818RTC_H */