Lines Matching refs:tmp
66 int rtc_get (struct rtc_time *tmp) in rtc_get() argument
81 tmp->tm_sec = bcd2bin (soft_spi_read ()); /* Read seconds */ in rtc_get()
82 tmp->tm_min = bcd2bin (soft_spi_read ()); /* Read minutes */ in rtc_get()
90 tmp->tm_hour = (bcd2bin (spi_byte & 0x1F)) + 11; in rtc_get()
93 tmp->tm_hour = (bcd2bin (spi_byte & 0x1F)) - 1; in rtc_get()
97 tmp->tm_hour = (bcd2bin (spi_byte & 0x3F)); in rtc_get()
101 tmp->tm_mday = bcd2bin (soft_spi_read ()); /* Read Day of the Month */ in rtc_get()
102 tmp->tm_mon = bcd2bin (soft_spi_read ()); /* Read Month */ in rtc_get()
105 tmp->tm_year = bcd2bin (soft_spi_read ()) + 2000; in rtc_get()
111 rtc_calc_weekday(tmp); /* Determine the day of week */ in rtc_get()
114 tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, in rtc_get()
115 tmp->tm_hour, tmp->tm_min, tmp->tm_sec); in rtc_get()
123 int rtc_set (struct rtc_time *tmp) in rtc_set() argument
149 bin2bcd (tmp->tm_sec); in rtc_set()
150 soft_spi_send (bin2bcd (tmp->tm_sec)); /* Send Seconds */ in rtc_set()
151 soft_spi_send (bin2bcd (tmp->tm_min)); /* Send Minutes */ in rtc_set()
152 soft_spi_send (bin2bcd (tmp->tm_hour)); /* Send Hour */ in rtc_set()
153 soft_spi_send (bin2bcd (tmp->tm_wday)); /* Send Day of the Week */ in rtc_set()
154 soft_spi_send (bin2bcd (tmp->tm_mday)); /* Send Day of Month */ in rtc_set()
155 soft_spi_send (bin2bcd (tmp->tm_mon)); /* Send Month */ in rtc_set()
156 soft_spi_send (bin2bcd (tmp->tm_year - 2000)); /* Send Year */ in rtc_set()
181 tim = rtc_mktime(tmp); in rtc_set()
188 tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, in rtc_set()
189 tmp->tm_hour, tmp->tm_min, tmp->tm_sec); in rtc_set()
284 int rtc_get (struct rtc_time *tmp) in rtc_get() argument
326 tmp->tm_sec = bcd2bin (sec & 0x7F); /* convert Seconds */ in rtc_get()
327 tmp->tm_min = bcd2bin (min & 0x7F); /* convert Minutes */ in rtc_get()
330 tmp->tm_hour = (hour & 0x40) in rtc_get()
337 tmp->tm_mday = bcd2bin (mday & 0x3F); /* convert Day of the Month */ in rtc_get()
338 tmp->tm_mon = bcd2bin (mon & 0x1F); /* convert Month */ in rtc_get()
339 tmp->tm_year = bcd2bin (year) + 2000; /* convert Year */ in rtc_get()
340 tmp->tm_wday = bcd2bin (wday & 0x07) - 1; /* convert Day of the Week */ in rtc_get()
341 tmp->tm_yday = 0; in rtc_get()
342 tmp->tm_isdst = 0; in rtc_get()
345 tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, in rtc_get()
346 tmp->tm_hour, tmp->tm_min, tmp->tm_sec); in rtc_get()
354 int rtc_set (struct rtc_time *tmp) in rtc_set() argument
368 tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, in rtc_set()
369 tmp->tm_hour, tmp->tm_min, tmp->tm_sec); in rtc_set()
371 rtc_write (RTC_SECONDS, bin2bcd (tmp->tm_sec)); in rtc_set()
372 rtc_write (RTC_MINUTES, bin2bcd (tmp->tm_min)); in rtc_set()
373 rtc_write (RTC_HOURS, bin2bcd (tmp->tm_hour)); in rtc_set()
374 rtc_write (RTC_DAY_OF_WEEK, bin2bcd (tmp->tm_wday + 1)); in rtc_set()
375 rtc_write (RTC_DATE_OF_MONTH, bin2bcd (tmp->tm_mday)); in rtc_set()
376 rtc_write (RTC_MONTH, bin2bcd (tmp->tm_mon)); in rtc_set()
377 rtc_write (RTC_YEAR, bin2bcd (tmp->tm_year - 2000)); in rtc_set()