3 * Copyright (c) 2011-2014 Samsung Electronics Co., Ltd
4 * http://www.samsung.com
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
18 #ifndef __LINUX_MFD_SEC_RTC_H
19 #define __LINUX_MFD_SEC_RTC_H
86 #define RTC_I2C_ADDR (0x0C >> 1)
88 #define HOUR_12 (1 << 7)
89 #define HOUR_AMPM (1 << 6)
90 #define HOUR_PM (1 << 5)
91 #define S5M_ALARM0_STATUS (1 << 1)
92 #define S5M_ALARM1_STATUS (1 << 2)
93 #define S5M_UPDATE_AD (1 << 0)
95 #define S2MPS_ALARM0_STATUS (1 << 2)
96 #define S2MPS_ALARM1_STATUS (1 << 1)
98 /* RTC Control Register */
99 #define BCD_EN_SHIFT 0
100 #define BCD_EN_MASK (1 << BCD_EN_SHIFT)
101 #define MODEL24_SHIFT 1
102 #define MODEL24_MASK (1 << MODEL24_SHIFT)
103 /* RTC Update Register1 */
104 #define S5M_RTC_UDR_SHIFT 0
105 #define S5M_RTC_UDR_MASK (1 << S5M_RTC_UDR_SHIFT)
106 #define S2MPS_RTC_WUDR_SHIFT 4
107 #define S2MPS_RTC_WUDR_MASK (1 << S2MPS_RTC_WUDR_SHIFT)
108 #define S2MPS15_RTC_AUDR_SHIFT 4
109 #define S2MPS15_RTC_AUDR_MASK (1 << S2MPS15_RTC_AUDR_SHIFT)
110 #define S2MPS13_RTC_AUDR_SHIFT 1
111 #define S2MPS13_RTC_AUDR_MASK (1 << S2MPS13_RTC_AUDR_SHIFT)
112 #define S2MPS15_RTC_WUDR_SHIFT 1
113 #define S2MPS15_RTC_WUDR_MASK (1 << S2MPS15_RTC_WUDR_SHIFT)
114 #define S2MPS_RTC_RUDR_SHIFT 0
115 #define S2MPS_RTC_RUDR_MASK (1 << S2MPS_RTC_RUDR_SHIFT)
116 #define RTC_TCON_SHIFT 1
117 #define RTC_TCON_MASK (1 << RTC_TCON_SHIFT)
118 #define S5M_RTC_TIME_EN_SHIFT 3
119 #define S5M_RTC_TIME_EN_MASK (1 << S5M_RTC_TIME_EN_SHIFT)
121 * UDR_T field in S5M_RTC_UDR_CON register determines the time needed
122 * for updating alarm and time registers. Default is 7.32 ms.
124 #define S5M_RTC_UDR_T_SHIFT 6
125 #define S5M_RTC_UDR_T_MASK (0x3 << S5M_RTC_UDR_T_SHIFT)
126 #define S5M_RTC_UDR_T_7320_US (0x0 << S5M_RTC_UDR_T_SHIFT)
127 #define S5M_RTC_UDR_T_1830_US (0x1 << S5M_RTC_UDR_T_SHIFT)
128 #define S5M_RTC_UDR_T_3660_US (0x2 << S5M_RTC_UDR_T_SHIFT)
129 #define S5M_RTC_UDR_T_450_US (0x3 << S5M_RTC_UDR_T_SHIFT)
131 /* RTC Hour register */
132 #define HOUR_PM_SHIFT 6
133 #define HOUR_PM_MASK (1 << HOUR_PM_SHIFT)
134 /* RTC Alarm Enable */
135 #define ALARM_ENABLE_SHIFT 7
136 #define ALARM_ENABLE_MASK (1 << ALARM_ENABLE_SHIFT)
138 #define SMPL_ENABLE_SHIFT 7
139 #define SMPL_ENABLE_MASK (1 << SMPL_ENABLE_SHIFT)
141 #define WTSR_ENABLE_SHIFT 6
142 #define WTSR_ENABLE_MASK (1 << WTSR_ENABLE_SHIFT)
155 #endif /* __LINUX_MFD_SEC_RTC_H */