Lines Matching refs:rtc_tm
132 static int pic32_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) in pic32_rtc_gettime() argument
141 rtc_tm->tm_hour = readb(base + PIC32_RTCHOUR); in pic32_rtc_gettime()
142 rtc_tm->tm_min = readb(base + PIC32_RTCMIN); in pic32_rtc_gettime()
143 rtc_tm->tm_mon = readb(base + PIC32_RTCMON); in pic32_rtc_gettime()
144 rtc_tm->tm_mday = readb(base + PIC32_RTCDAY); in pic32_rtc_gettime()
145 rtc_tm->tm_year = readb(base + PIC32_RTCYEAR); in pic32_rtc_gettime()
146 rtc_tm->tm_sec = readb(base + PIC32_RTCSEC); in pic32_rtc_gettime()
154 } while (rtc_tm->tm_sec == 0 && tries < 2); in pic32_rtc_gettime()
156 rtc_tm->tm_sec = bcd2bin(rtc_tm->tm_sec); in pic32_rtc_gettime()
157 rtc_tm->tm_min = bcd2bin(rtc_tm->tm_min); in pic32_rtc_gettime()
158 rtc_tm->tm_hour = bcd2bin(rtc_tm->tm_hour); in pic32_rtc_gettime()
159 rtc_tm->tm_mday = bcd2bin(rtc_tm->tm_mday); in pic32_rtc_gettime()
160 rtc_tm->tm_mon = bcd2bin(rtc_tm->tm_mon) - 1; in pic32_rtc_gettime()
161 rtc_tm->tm_year = bcd2bin(rtc_tm->tm_year); in pic32_rtc_gettime()
163 rtc_tm->tm_year += 100; in pic32_rtc_gettime()
165 dev_dbg(dev, "read time %ptR\n", rtc_tm); in pic32_rtc_gettime()