Lines Matching refs:tm
33 static void opal_to_tm(u32 y_m_d, u64 h_m_s_ms, struct rtc_time *tm) in opal_to_tm() argument
35 tm->tm_year = ((bcd2bin(y_m_d >> 24) * 100) + in opal_to_tm()
37 tm->tm_mon = bcd2bin((y_m_d >> 8) & 0xff) - 1; in opal_to_tm()
38 tm->tm_mday = bcd2bin(y_m_d & 0xff); in opal_to_tm()
39 tm->tm_hour = bcd2bin((h_m_s_ms >> 56) & 0xff); in opal_to_tm()
40 tm->tm_min = bcd2bin((h_m_s_ms >> 48) & 0xff); in opal_to_tm()
41 tm->tm_sec = bcd2bin((h_m_s_ms >> 40) & 0xff); in opal_to_tm()
43 GregorianDay(tm); in opal_to_tm()
46 static void tm_to_opal(struct rtc_time *tm, u32 *y_m_d, u64 *h_m_s_ms) in tm_to_opal() argument
48 *y_m_d |= ((u32)bin2bcd((tm->tm_year + 1900) / 100)) << 24; in tm_to_opal()
49 *y_m_d |= ((u32)bin2bcd((tm->tm_year + 1900) % 100)) << 16; in tm_to_opal()
50 *y_m_d |= ((u32)bin2bcd((tm->tm_mon + 1))) << 8; in tm_to_opal()
51 *y_m_d |= ((u32)bin2bcd(tm->tm_mday)); in tm_to_opal()
53 *h_m_s_ms |= ((u64)bin2bcd(tm->tm_hour)) << 56; in tm_to_opal()
54 *h_m_s_ms |= ((u64)bin2bcd(tm->tm_min)) << 48; in tm_to_opal()
55 *h_m_s_ms |= ((u64)bin2bcd(tm->tm_sec)) << 40; in tm_to_opal()
58 static int opal_get_rtc_time(struct device *dev, struct rtc_time *tm) in opal_get_rtc_time() argument
79 opal_to_tm(y_m_d, h_m_s_ms, tm); in opal_get_rtc_time()
84 static int opal_set_rtc_time(struct device *dev, struct rtc_time *tm) in opal_set_rtc_time() argument
90 tm_to_opal(tm, &y_m_d, &h_m_s_ms); in opal_set_rtc_time()