mc146818rtc.h 925 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  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
  4. * for more details.
  5. *
  6. * Copyright (C) 1998, 2001, 03 by Ralf Baechle
  7. * Copyright (C) 2007 Thomas Bogendoerfer
  8. *
  9. * RTC routines for Jazz style attached Dallas chip.
  10. */
  11. #ifndef __ASM_MACH_JAZZ_MC146818RTC_H
  12. #define __ASM_MACH_JAZZ_MC146818RTC_H
  13. #include <linux/delay.h>
  14. #include <asm/io.h>
  15. #include <asm/jazz.h>
  16. #define RTC_PORT(x) (0x70 + (x))
  17. #define RTC_IRQ 8
  18. static inline unsigned char CMOS_READ(unsigned long addr)
  19. {
  20. outb_p(addr, RTC_PORT(0));
  21. return *(volatile char *)JAZZ_RTC_BASE;
  22. }
  23. static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
  24. {
  25. outb_p(addr, RTC_PORT(0));
  26. *(volatile char *)JAZZ_RTC_BASE = data;
  27. }
  28. #define RTC_ALWAYS_BCD 0
  29. #define mc146818_decode_year(year) ((year) + 1980)
  30. #endif /* __ASM_MACH_JAZZ_MC146818RTC_H */