summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-05-16 14:18:12 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-05-16 14:18:12 +0000
commitd46913964dd390ca5b9b162941abb1a1eb414ef4 (patch)
treebcc18e2c5278170812fc807e58f60ceb2add035b /include
parentf9055aeda90fec2eb7ce0c49382e51b87f6a4fc9 (diff)
Cleanup RTC definitions. Patch with the entire MIPS RTC related
headerfile changes sent to Linus.
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/mc146818rtc.h27
-rw-r--r--include/asm-i386/mc146818rtc.h6
2 files changed, 30 insertions, 3 deletions
diff --git a/include/asm-arm/mc146818rtc.h b/include/asm-arm/mc146818rtc.h
new file mode 100644
index 000000000..8729c5dfb
--- /dev/null
+++ b/include/asm-arm/mc146818rtc.h
@@ -0,0 +1,27 @@
+/*
+ * Machine dependent access functions for RTC registers.
+ */
+#ifndef _ASM_MC146818RTC_H
+#define _ASM_MC146818RTC_H
+
+#include <asm/io.h>
+
+#ifndef RTC_PORT
+#define RTC_PORT(x) (0x70 + (x))
+#define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */
+#endif
+
+/*
+ * The yet supported machines all access the RTC index register via
+ * an ISA port access but the way to access the date register differs ...
+ */
+#define CMOS_READ(addr) ({ \
+outb_p((addr),RTC_PORT(0)); \
+inb_p(RTC_PORT(1)); \
+})
+#define CMOS_WRITE(val, addr) ({ \
+outb_p((addr),RTC_PORT(0)); \
+outb_p((val),RTC_PORT(1)); \
+})
+
+#endif /* _ASM_MC146818RTC_H */
diff --git a/include/asm-i386/mc146818rtc.h b/include/asm-i386/mc146818rtc.h
index 07f4149a4..8729c5dfb 100644
--- a/include/asm-i386/mc146818rtc.h
+++ b/include/asm-i386/mc146818rtc.h
@@ -1,8 +1,8 @@
/*
* Machine dependent access functions for RTC registers.
*/
-#ifndef _I386_MC146818RTC_H
-#define _I386_MC146818RTC_H
+#ifndef _ASM_MC146818RTC_H
+#define _ASM_MC146818RTC_H
#include <asm/io.h>
@@ -24,4 +24,4 @@ outb_p((addr),RTC_PORT(0)); \
outb_p((val),RTC_PORT(1)); \
})
-#endif /* _I386_MC146818RTC_H */
+#endif /* _ASM_MC146818RTC_H */