rtc-jazz.c
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:1k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  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.  * RTC routines for Jazz style attached Dallas chip.
  7.  *
  8.  * Copyright (C) 1998, 2001 by Ralf Baechle
  9.  */
  10. #include <linux/mc146818rtc.h>
  11. #include <asm/io.h>
  12. #include <asm/jazz.h>
  13. static unsigned char jazz_rtc_read_data(unsigned long addr)
  14. {
  15. outb_p(addr, RTC_PORT(0));
  16. return *(char *)JAZZ_RTC_BASE;
  17. }
  18. static void jazz_rtc_write_data(unsigned char data, unsigned long addr)
  19. {
  20. outb_p(addr, RTC_PORT(0));
  21. *(char *)JAZZ_RTC_BASE = data;
  22. }
  23. static int jazz_rtc_bcd_mode(void)
  24. {
  25. return 0;
  26. }
  27. struct rtc_ops jazz_rtc_ops = {
  28. &jazz_rtc_read_data,
  29. &jazz_rtc_write_data,
  30. &jazz_rtc_bcd_mode
  31. };