Lines Matching refs:tm
67 static int tps80031_rtc_read_time(struct device *dev, struct rtc_time *tm) in tps80031_rtc_read_time() argument
79 tm->tm_sec = bcd2bin(buff[0]); in tps80031_rtc_read_time()
80 tm->tm_min = bcd2bin(buff[1]); in tps80031_rtc_read_time()
81 tm->tm_hour = bcd2bin(buff[2]); in tps80031_rtc_read_time()
82 tm->tm_mday = bcd2bin(buff[3]); in tps80031_rtc_read_time()
83 tm->tm_mon = bcd2bin(buff[4]) - 1; in tps80031_rtc_read_time()
84 tm->tm_year = bcd2bin(buff[5]) + RTC_YEAR_OFFSET; in tps80031_rtc_read_time()
85 tm->tm_wday = bcd2bin(buff[6]); in tps80031_rtc_read_time()
89 static int tps80031_rtc_set_time(struct device *dev, struct rtc_time *tm) in tps80031_rtc_set_time() argument
94 buff[0] = bin2bcd(tm->tm_sec); in tps80031_rtc_set_time()
95 buff[1] = bin2bcd(tm->tm_min); in tps80031_rtc_set_time()
96 buff[2] = bin2bcd(tm->tm_hour); in tps80031_rtc_set_time()
97 buff[3] = bin2bcd(tm->tm_mday); in tps80031_rtc_set_time()
98 buff[4] = bin2bcd(tm->tm_mon + 1); in tps80031_rtc_set_time()
99 buff[5] = bin2bcd(tm->tm_year % RTC_YEAR_OFFSET); in tps80031_rtc_set_time()
100 buff[6] = bin2bcd(tm->tm_wday); in tps80031_rtc_set_time()
239 struct rtc_time tm; in tps80031_rtc_probe() local
258 tps80031_rtc_read_time(&pdev->dev, &tm); in tps80031_rtc_probe()
259 if ((tm.tm_year == RTC_YEAR_OFFSET + TPS80031_RTC_POR_YEAR) && in tps80031_rtc_probe()
260 (tm.tm_mon == (TPS80031_RTC_POR_MONTH - 1)) && in tps80031_rtc_probe()
261 (tm.tm_mday == TPS80031_RTC_POR_DAY)) { in tps80031_rtc_probe()
262 tm.tm_year = 2000; in tps80031_rtc_probe()
263 tm.tm_mday = 1; in tps80031_rtc_probe()
264 tm.tm_mon = 1; in tps80031_rtc_probe()
265 ret = tps80031_rtc_set_time(&pdev->dev, &tm); in tps80031_rtc_probe()