1 /* rtc.h 2 * 3 * Copyright (c) 2011 Samsung Electronics Co., Ltd 4 * http://www.samsung.com 5 * 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. 10 * 11 */ 12 13 #ifndef __LINUX_MFD_SEC_RTC_H 14 #define __LINUX_MFD_SEC_RTC_H 15 16 enum sec_rtc_reg { 17 SEC_RTC_SEC, 18 SEC_RTC_MIN, 19 SEC_RTC_HOUR, 20 SEC_RTC_WEEKDAY, 21 SEC_RTC_DATE, 22 SEC_RTC_MONTH, 23 SEC_RTC_YEAR1, 24 SEC_RTC_YEAR2, 25 SEC_ALARM0_SEC, 26 SEC_ALARM0_MIN, 27 SEC_ALARM0_HOUR, 28 SEC_ALARM0_WEEKDAY, 29 SEC_ALARM0_DATE, 30 SEC_ALARM0_MONTH, 31 SEC_ALARM0_YEAR1, 32 SEC_ALARM0_YEAR2, 33 SEC_ALARM1_SEC, 34 SEC_ALARM1_MIN, 35 SEC_ALARM1_HOUR, 36 SEC_ALARM1_WEEKDAY, 37 SEC_ALARM1_DATE, 38 SEC_ALARM1_MONTH, 39 SEC_ALARM1_YEAR1, 40 SEC_ALARM1_YEAR2, 41 SEC_ALARM0_CONF, 42 SEC_ALARM1_CONF, 43 SEC_RTC_STATUS, 44 SEC_WTSR_SMPL_CNTL, 45 SEC_RTC_UDR_CON, 46 }; 47 48 #define RTC_I2C_ADDR (0x0C >> 1) 49 50 #define HOUR_12 (1 << 7) 51 #define HOUR_AMPM (1 << 6) 52 #define HOUR_PM (1 << 5) 53 #define ALARM0_STATUS (1 << 1) 54 #define ALARM1_STATUS (1 << 2) 55 #define UPDATE_AD (1 << 0) 56 57 /* RTC Control Register */ 58 #define BCD_EN_SHIFT 0 59 #define BCD_EN_MASK (1 << BCD_EN_SHIFT) 60 #define MODEL24_SHIFT 1 61 #define MODEL24_MASK (1 << MODEL24_SHIFT) 62 /* RTC Update Register1 */ 63 #define RTC_UDR_SHIFT 0 64 #define RTC_UDR_MASK (1 << RTC_UDR_SHIFT) 65 /* RTC Hour register */ 66 #define HOUR_PM_SHIFT 6 67 #define HOUR_PM_MASK (1 << HOUR_PM_SHIFT) 68 /* RTC Alarm Enable */ 69 #define ALARM_ENABLE_SHIFT 7 70 #define ALARM_ENABLE_MASK (1 << ALARM_ENABLE_SHIFT) 71 72 enum { 73 RTC_SEC = 0, 74 RTC_MIN, 75 RTC_HOUR, 76 RTC_WEEKDAY, 77 RTC_DATE, 78 RTC_MONTH, 79 RTC_YEAR1, 80 RTC_YEAR2, 81 }; 82 83 #endif /* __LINUX_MFD_SEC_RTC_H */ 84