Lines Matching full:time
3 * RTC driver for the SD2405AL Real-Time Clock
16 /* Real time clock registers */
86 static int sd2405al_read_time(struct device *dev, struct rtc_time *time) in sd2405al_read_time() argument
97 time->tm_sec = bcd2bin(data[SD2405AL_REG_T_SEC] & 0x7F); in sd2405al_read_time()
98 time->tm_min = bcd2bin(data[SD2405AL_REG_T_MIN] & 0x7F); in sd2405al_read_time()
101 time->tm_hour = bcd2bin(data[SD2405AL_REG_T_HOUR] & 0x3F); in sd2405al_read_time()
104 time->tm_hour = bcd2bin(data[SD2405AL_REG_T_HOUR] in sd2405al_read_time()
107 time->tm_hour = bcd2bin(data[SD2405AL_REG_T_HOUR] in sd2405al_read_time()
110 time->tm_wday = bcd2bin(data[SD2405AL_REG_T_WEEK] & 0x07); in sd2405al_read_time()
111 time->tm_mday = bcd2bin(data[SD2405AL_REG_T_DAY] & 0x3F); in sd2405al_read_time()
112 time->tm_mon = bcd2bin(data[SD2405AL_REG_T_MON] & 0x1F) - 1; in sd2405al_read_time()
113 time->tm_year = bcd2bin(data[SD2405AL_REG_T_YEAR]) + 100; in sd2405al_read_time()
115 dev_dbg(sd2405al->dev, "read time: %ptR (%d)\n", time, time->tm_wday); in sd2405al_read_time()
120 static int sd2405al_set_time(struct device *dev, struct rtc_time *time) in sd2405al_set_time() argument
126 data[SD2405AL_REG_T_SEC] = bin2bcd(time->tm_sec); in sd2405al_set_time()
127 data[SD2405AL_REG_T_MIN] = bin2bcd(time->tm_min); in sd2405al_set_time()
128 data[SD2405AL_REG_T_HOUR] = bin2bcd(time->tm_hour) | SD2405AL_BIT_24H; in sd2405al_set_time()
129 data[SD2405AL_REG_T_DAY] = bin2bcd(time->tm_mday); in sd2405al_set_time()
130 data[SD2405AL_REG_T_WEEK] = bin2bcd(time->tm_wday); in sd2405al_set_time()
131 data[SD2405AL_REG_T_MON] = bin2bcd(time->tm_mon) + 1; in sd2405al_set_time()
132 data[SD2405AL_REG_T_YEAR] = bin2bcd(time->tm_year - 100); in sd2405al_set_time()
151 dev_dbg(sd2405al->dev, "set time: %ptR (%d)\n", time, time->tm_wday); in sd2405al_set_time()