Lines Matching refs:rtc_tm
384 static int ac100_rtc_get_time(struct device *dev, struct rtc_time *rtc_tm) in ac100_rtc_get_time() argument
395 rtc_tm->tm_sec = bcd2bin(reg[0] & AC100_RTC_SEC_MASK); in ac100_rtc_get_time()
396 rtc_tm->tm_min = bcd2bin(reg[1] & AC100_RTC_MIN_MASK); in ac100_rtc_get_time()
397 rtc_tm->tm_hour = bcd2bin(reg[2] & AC100_RTC_HOU_MASK); in ac100_rtc_get_time()
398 rtc_tm->tm_wday = bcd2bin(reg[3] & AC100_RTC_WEE_MASK); in ac100_rtc_get_time()
399 rtc_tm->tm_mday = bcd2bin(reg[4] & AC100_RTC_DAY_MASK); in ac100_rtc_get_time()
400 rtc_tm->tm_mon = bcd2bin(reg[5] & AC100_RTC_MON_MASK) - 1; in ac100_rtc_get_time()
401 rtc_tm->tm_year = bcd2bin(reg[6] & AC100_RTC_YEA_MASK) + in ac100_rtc_get_time()
407 static int ac100_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) in ac100_rtc_set_time() argument
415 year = rtc_tm->tm_year - AC100_YEAR_OFF; in ac100_rtc_set_time()
423 reg[0] = bin2bcd(rtc_tm->tm_sec) & AC100_RTC_SEC_MASK; in ac100_rtc_set_time()
424 reg[1] = bin2bcd(rtc_tm->tm_min) & AC100_RTC_MIN_MASK; in ac100_rtc_set_time()
425 reg[2] = bin2bcd(rtc_tm->tm_hour) & AC100_RTC_HOU_MASK; in ac100_rtc_set_time()
426 reg[3] = bin2bcd(rtc_tm->tm_wday) & AC100_RTC_WEE_MASK; in ac100_rtc_set_time()
427 reg[4] = bin2bcd(rtc_tm->tm_mday) & AC100_RTC_DAY_MASK; in ac100_rtc_set_time()
428 reg[5] = bin2bcd(rtc_tm->tm_mon + 1) & AC100_RTC_MON_MASK; in ac100_rtc_set_time()