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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * RTC routines for IP32 style attached Dallas chip.
  3.  *
  4.  * This file is subject to the terms and conditions of the GNU General Public
  5.  * License.  See the file "COPYING" in the main directory of this archive
  6.  * for more details.
  7.  *
  8.  * Copyright (C) 2000 Harald Koerfgen
  9.  */
  10. #include <linux/mc146818rtc.h>
  11. #include <asm/ip32/mace.h>
  12. static unsigned char ip32_rtc_read_data(unsigned long addr)
  13. {
  14. return (unsigned char) mace_read_8 (MACEISA_RTC_BASE + (addr << 8));
  15. }
  16. static void ip32_rtc_write_data(unsigned char data, unsigned long addr)
  17. {
  18. mace_write_8 (MACEISA_RTC_BASE + (addr << 8), data);
  19. }
  20. static int ip32_rtc_bcd_mode(void)
  21. {
  22. return 0;
  23. }
  24. struct rtc_ops ip32_rtc_ops = {
  25. &ip32_rtc_read_data,
  26. &ip32_rtc_write_data,
  27. &ip32_rtc_bcd_mode
  28. };