diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2005-11-17 11:23:43 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2005-11-17 11:23:43 -0500 |
commit | cd017fbdd33f2d8294b0e0324faa1dc7750b4af0 (patch) | |
tree | 7d7191c3be2270b036876a137d417c1ef9da7e11 | |
parent | 443bf3292f04c53e92bf0588f1aa2c9b421545e2 (diff) |
Add definitions for the Dallas DS1742 RTC / non-volatile memory.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | include/linux/ds1742rtc.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/include/linux/ds1742rtc.h b/include/linux/ds1742rtc.h new file mode 100644 index 000000000000..a83cdd1cafc9 --- /dev/null +++ b/include/linux/ds1742rtc.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * ds1742rtc.h - register definitions for the Real-Time-Clock / CMOS RAM | ||
3 | * | ||
4 | * Copyright (C) 1999-2001 Toshiba Corporation | ||
5 | * Copyright (C) 2003 Ralf Baechle (ralf@linux-mips.org) | ||
6 | * | ||
7 | * Permission is hereby granted to copy, modify and redistribute this code | ||
8 | * in terms of the GNU Library General Public License, Version 2 or later, | ||
9 | * at your option. | ||
10 | */ | ||
11 | #ifndef __LINUX_DS1742RTC_H | ||
12 | #define __LINUX_DS1742RTC_H | ||
13 | |||
14 | #include <asm/ds1742.h> | ||
15 | |||
16 | #define RTC_BRAM_SIZE 0x800 | ||
17 | #define RTC_OFFSET 0x7f8 | ||
18 | |||
19 | /* | ||
20 | * Register summary | ||
21 | */ | ||
22 | #define RTC_CONTROL (RTC_OFFSET + 0) | ||
23 | #define RTC_CENTURY (RTC_OFFSET + 0) | ||
24 | #define RTC_SECONDS (RTC_OFFSET + 1) | ||
25 | #define RTC_MINUTES (RTC_OFFSET + 2) | ||
26 | #define RTC_HOURS (RTC_OFFSET + 3) | ||
27 | #define RTC_DAY (RTC_OFFSET + 4) | ||
28 | #define RTC_DATE (RTC_OFFSET + 5) | ||
29 | #define RTC_MONTH (RTC_OFFSET + 6) | ||
30 | #define RTC_YEAR (RTC_OFFSET + 7) | ||
31 | |||
32 | #define RTC_CENTURY_MASK 0x3f | ||
33 | #define RTC_SECONDS_MASK 0x7f | ||
34 | #define RTC_DAY_MASK 0x07 | ||
35 | |||
36 | /* | ||
37 | * Bits in the Control/Century register | ||
38 | */ | ||
39 | #define RTC_WRITE 0x80 | ||
40 | #define RTC_READ 0x40 | ||
41 | |||
42 | /* | ||
43 | * Bits in the Seconds register | ||
44 | */ | ||
45 | #define RTC_STOP 0x80 | ||
46 | |||
47 | /* | ||
48 | * Bits in the Day register | ||
49 | */ | ||
50 | #define RTC_BATT_FLAG 0x80 | ||
51 | #define RTC_FREQ_TEST 0x40 | ||
52 | |||
53 | #endif /* __LINUX_DS1742RTC_H */ | ||