Merge tag 'v4.4-rc7'
[firefly-linux-kernel-4.4.55.git] / drivers / rtc / rtc-s35392a.h
1 /*drivers/rtc/rtc-s35392a.h - driver for s35392a\r
2  *\r
3  * Copyright (C) 2010 ROCKCHIP, Inc.\r
4  *\r
5  * This software is licensed under the terms of the GNU General Public\r
6  * License version 2, as published by the Free Software Foundation, and\r
7  * may be copied, distributed, and modified under those terms.\r
8  *\r
9  * This program is distributed in the hope that it will be useful,\r
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
12  * GNU General Public License for more details.\r
13  */\r
14  #ifndef RTC_S35392A_H_\r
15  #define RTC_S35392A_H_\r
16  \r
17 #define S35392A_CMD_STATUS1     0x0\r
18 #define S35392A_CMD_STATUS2     0x1\r
19 #define S35392A_CMD_TIME1               0x2\r
20 #define S35392A_CMD_TIME2               0x3\r
21 #define S35392A_CMD_INT1                0x4\r
22 #define S35392A_CMD_INT2                0x5\r
23 #define S35392A_CMD_CHECK       0x6\r
24 #define S35392A_CMD_FREE                0x7\r
25 \r
26 #define S35392A_BYTE_YEAR               0\r
27 #define S35392A_BYTE_MONTH      1\r
28 #define S35392A_BYTE_DAY                2\r
29 #define S35392A_BYTE_WDAY               3\r
30 #define S35392A_BYTE_HOURS      4\r
31 #define S35392A_BYTE_MINS               5\r
32 #define S35392A_BYTE_SECS               6\r
33 \r
34 #define S35392A_ALARM_WDAYS    0\r
35 #define S35392A_ALARM_HOURS    1\r
36 #define S35392A_ALARM_MINS      2\r
37 \r
38 #define S35392A_FLAG_POC                0x01\r
39 #define S35392A_FLAG_BLD                0x02\r
40 #define S35392A_FLAG_INT2               0x04\r
41 #define S35392A_FLAG_INT1               0x08\r
42 #define S35392A_FLAG_24H                0x40\r
43 \r
44 #define S35392A_FLAG_TEST               0x01\r
45 #define S35392A_FLAG_INT1AE      0x20\r
46 #define S35392A_FLAG_RESET              0x80\r
47 #define S35392A_FLAG_INT2AE      0x2\r
48 \r
49 #define S35392A_ALARM_ENABLE   0X80\r
50 #define S35392A_ALARM_DISABLE  0X7F\r
51 #define S35392A_MASK_INT1         0XE0\r
52 #define S35392A_INT1_ENABLE      0X20\r
53 #define S35392A_MASK_INT2         0X0E\r
54 #define S35392A_INT2_ENABLE      0X02\r
55 \r
56 //#define S35392_STATUS_INT1       (~(0x3<<5))\r
57 //#define S35392_STATUS_INT2       (~(0x3<<1))\r
58 #endif\r
59 \r