Lines Matching refs:tm
109 struct optee_rtc_time *tm) in atmel_decode_date() argument
121 tm->tm_wday = bcd_decode(RTC_VAL(CAL_DAY, date)) - 1; in atmel_decode_date()
122 tm->tm_mday = bcd_decode(RTC_VAL(CAL_DATE, date)); in atmel_decode_date()
123 tm->tm_mon = bcd_decode(RTC_VAL(CAL_MONTH, date)) - 1; in atmel_decode_date()
124 tm->tm_year = bcd_decode(RTC_VAL(CAL_CENT, date)) * 100; in atmel_decode_date()
125 tm->tm_year += bcd_decode(RTC_VAL(CAL_YEAR, date)); in atmel_decode_date()
127 tm->tm_hour = bcd_decode(RTC_VAL(TIME_HOUR, time)); in atmel_decode_date()
128 tm->tm_min = bcd_decode(RTC_VAL(TIME_MIN, time)); in atmel_decode_date()
129 tm->tm_sec = bcd_decode(RTC_VAL(TIME_SEC, time)); in atmel_decode_date()
133 struct optee_rtc_time *tm) in atmel_rtc_get_time() argument
135 atmel_decode_date(RTC_TIMR, RTC_CALR, tm); in atmel_rtc_get_time()
140 TEE_Result atmel_rtc_get_tamper_timestamp(struct optee_rtc_time *tm) in atmel_rtc_get_tamper_timestamp() argument
145 atmel_decode_date(RTC_TSTR0, RTC_TSDR0, tm); in atmel_rtc_get_tamper_timestamp()
151 struct optee_rtc_time *tm) in atmel_rtc_set_time() argument
172 RTC_SET_VAL(TIME_SEC, bcd_encode(tm->tm_sec)) | in atmel_rtc_set_time()
173 RTC_SET_VAL(TIME_MIN, bcd_encode(tm->tm_min)) | in atmel_rtc_set_time()
174 RTC_SET_VAL(TIME_HOUR, bcd_encode(tm->tm_hour))); in atmel_rtc_set_time()
178 bcd_encode(tm->tm_year / 100)) | in atmel_rtc_set_time()
179 RTC_SET_VAL(CAL_YEAR, bcd_encode(tm->tm_year % 100)) | in atmel_rtc_set_time()
180 RTC_SET_VAL(CAL_MONTH, bcd_encode(tm->tm_mon + 1)) | in atmel_rtc_set_time()
181 RTC_SET_VAL(CAL_DAY, bcd_encode(tm->tm_wday + 1)) | in atmel_rtc_set_time()
182 RTC_SET_VAL(CAL_DATE, bcd_encode(tm->tm_mday))); in atmel_rtc_set_time()