diff options
author | Raphael Assenat <raph@raphnet.net> | 2006-06-25 08:48:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:01:14 -0400 |
commit | 362600fe60fd18a25b4de8ec544b9e24e77e1484 (patch) | |
tree | 7dd8c3c518e1b453eb5bd412e69d9d598c680948 /include/linux/rtc-v3020.h | |
parent | 9be05b57bd9152b7c26b1599b87aeb42a102f0cf (diff) |
[PATCH] Add v3020 RTC support
This patch adds support for the v3020 RTC from EM Microelectronic.
The v3020 RTC is designed to be connected on a bus using only one data bit.
Since any data bit may be used, it is necessary to specify this to the
driver by passing a struct v3020_platform_data pointer (see
include/linux/rtc-v3020.h) to the driver.
Part of the following code comes from the kernel patchs produced by
Compulab for their products. The original file (available here:
http://raph.people.8d.com/misc/emv3020.c) was released under the terms of
the GPL license.
[akpm@osdl.org: cleanups]
Signed-off-by: Raphael Assenat <raph@raphnet.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/rtc-v3020.h')
-rw-r--r-- | include/linux/rtc-v3020.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/rtc-v3020.h b/include/linux/rtc-v3020.h new file mode 100644 index 00000000000..bf74e63c98f --- /dev/null +++ b/include/linux/rtc-v3020.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * v3020.h - Registers definition and platform data structure for the v3020 RTC. | ||
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) 2006, 8D Technologies inc. | ||
9 | */ | ||
10 | #ifndef __LINUX_V3020_H | ||
11 | #define __LINUX_V3020_H | ||
12 | |||
13 | /* The v3020 has only one data pin but which one | ||
14 | * is used depends on the board. */ | ||
15 | struct v3020_platform_data { | ||
16 | int leftshift; /* (1<<(leftshift)) & readl() */ | ||
17 | }; | ||
18 | |||
19 | #define V3020_STATUS_0 0x00 | ||
20 | #define V3020_STATUS_1 0x01 | ||
21 | #define V3020_SECONDS 0x02 | ||
22 | #define V3020_MINUTES 0x03 | ||
23 | #define V3020_HOURS 0x04 | ||
24 | #define V3020_MONTH_DAY 0x05 | ||
25 | #define V3020_MONTH 0x06 | ||
26 | #define V3020_YEAR 0x07 | ||
27 | #define V3020_WEEK_DAY 0x08 | ||
28 | #define V3020_WEEK 0x09 | ||
29 | |||
30 | #define V3020_IS_COMMAND(val) ((val)>=0x0E) | ||
31 | |||
32 | #define V3020_CMD_RAM2CLOCK 0x0E | ||
33 | #define V3020_CMD_CLOCK2RAM 0x0F | ||
34 | |||
35 | #endif /* __LINUX_V3020_H */ | ||