xref: /OK3568_Linux_fs/kernel/include/linux/platform_data/rtc-v3020.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * v3020.h - Registers definition and platform data structure for the v3020 RTC.
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * This file is subject to the terms and conditions of the GNU General Public
5*4882a593Smuzhiyun  * License.  See the file "COPYING" in the main directory of this archive
6*4882a593Smuzhiyun  * for more details.
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  * Copyright (C) 2006, 8D Technologies inc.
9*4882a593Smuzhiyun  */
10*4882a593Smuzhiyun #ifndef __LINUX_V3020_H
11*4882a593Smuzhiyun #define __LINUX_V3020_H
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun /* The v3020 has only one data pin but which one
14*4882a593Smuzhiyun  * is used depends on the board. */
15*4882a593Smuzhiyun struct v3020_platform_data {
16*4882a593Smuzhiyun 	int leftshift; /* (1<<(leftshift)) & readl() */
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun 	unsigned int use_gpio:1;
19*4882a593Smuzhiyun 	unsigned int gpio_cs;
20*4882a593Smuzhiyun 	unsigned int gpio_wr;
21*4882a593Smuzhiyun 	unsigned int gpio_rd;
22*4882a593Smuzhiyun 	unsigned int gpio_io;
23*4882a593Smuzhiyun };
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun #define V3020_STATUS_0	0x00
26*4882a593Smuzhiyun #define V3020_STATUS_1	0x01
27*4882a593Smuzhiyun #define V3020_SECONDS	0x02
28*4882a593Smuzhiyun #define V3020_MINUTES	0x03
29*4882a593Smuzhiyun #define V3020_HOURS		0x04
30*4882a593Smuzhiyun #define V3020_MONTH_DAY	0x05
31*4882a593Smuzhiyun #define V3020_MONTH		0x06
32*4882a593Smuzhiyun #define V3020_YEAR		0x07
33*4882a593Smuzhiyun #define V3020_WEEK_DAY	0x08
34*4882a593Smuzhiyun #define V3020_WEEK		0x09
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun #define V3020_IS_COMMAND(val) ((val)>=0x0E)
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun #define V3020_CMD_RAM2CLOCK	0x0E
39*4882a593Smuzhiyun #define V3020_CMD_CLOCK2RAM	0x0F
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun #endif /* __LINUX_V3020_H */
42