Lines Matching refs:t

351 static int ds1307_get_time(struct device *dev, struct rtc_time *t)  in ds1307_get_time()  argument
366 t->tm_sec = bcd2bin(ds1307->regs[DS1307_REG_SECS] & 0x7f); in ds1307_get_time()
367 t->tm_min = bcd2bin(ds1307->regs[DS1307_REG_MIN] & 0x7f); in ds1307_get_time()
369 t->tm_hour = bcd2bin(tmp); in ds1307_get_time()
370 t->tm_wday = bcd2bin(ds1307->regs[DS1307_REG_WDAY] & 0x07) - 1; in ds1307_get_time()
371 t->tm_mday = bcd2bin(ds1307->regs[DS1307_REG_MDAY] & 0x3f); in ds1307_get_time()
373 t->tm_mon = bcd2bin(tmp) - 1; in ds1307_get_time()
376 t->tm_year = bcd2bin(ds1307->regs[DS1307_REG_YEAR]) + 100; in ds1307_get_time()
380 "read", t->tm_sec, t->tm_min, in ds1307_get_time()
381 t->tm_hour, t->tm_mday, in ds1307_get_time()
382 t->tm_mon, t->tm_year, t->tm_wday); in ds1307_get_time()
385 return rtc_valid_tm(t); in ds1307_get_time()
388 static int ds1307_set_time(struct device *dev, struct rtc_time *t) in ds1307_set_time() argument
397 "write", t->tm_sec, t->tm_min, in ds1307_set_time()
398 t->tm_hour, t->tm_mday, in ds1307_set_time()
399 t->tm_mon, t->tm_year, t->tm_wday); in ds1307_set_time()
401 buf[DS1307_REG_SECS] = bin2bcd(t->tm_sec); in ds1307_set_time()
402 buf[DS1307_REG_MIN] = bin2bcd(t->tm_min); in ds1307_set_time()
403 buf[DS1307_REG_HOUR] = bin2bcd(t->tm_hour); in ds1307_set_time()
404 buf[DS1307_REG_WDAY] = bin2bcd(t->tm_wday + 1); in ds1307_set_time()
405 buf[DS1307_REG_MDAY] = bin2bcd(t->tm_mday); in ds1307_set_time()
406 buf[DS1307_REG_MONTH] = bin2bcd(t->tm_mon + 1); in ds1307_set_time()
409 tmp = t->tm_year - 100; in ds1307_set_time()
446 static int ds1337_read_alarm(struct device *dev, struct rtc_wkalrm *t) in ds1337_read_alarm() argument
475 t->time.tm_sec = bcd2bin(ds1307->regs[0] & 0x7f); in ds1337_read_alarm()
476 t->time.tm_min = bcd2bin(ds1307->regs[1] & 0x7f); in ds1337_read_alarm()
477 t->time.tm_hour = bcd2bin(ds1307->regs[2] & 0x3f); in ds1337_read_alarm()
478 t->time.tm_mday = bcd2bin(ds1307->regs[3] & 0x3f); in ds1337_read_alarm()
479 t->time.tm_mon = -1; in ds1337_read_alarm()
480 t->time.tm_year = -1; in ds1337_read_alarm()
481 t->time.tm_wday = -1; in ds1337_read_alarm()
482 t->time.tm_yday = -1; in ds1337_read_alarm()
483 t->time.tm_isdst = -1; in ds1337_read_alarm()
486 t->enabled = !!(ds1307->regs[7] & DS1337_BIT_A1IE); in ds1337_read_alarm()
487 t->pending = !!(ds1307->regs[8] & DS1337_BIT_A1I); in ds1337_read_alarm()
491 "alarm read", t->time.tm_sec, t->time.tm_min, in ds1337_read_alarm()
492 t->time.tm_hour, t->time.tm_mday, in ds1337_read_alarm()
493 t->enabled, t->pending); in ds1337_read_alarm()
498 static int ds1337_set_alarm(struct device *dev, struct rtc_wkalrm *t) in ds1337_set_alarm() argument
511 "alarm set", t->time.tm_sec, t->time.tm_min, in ds1337_set_alarm()
512 t->time.tm_hour, t->time.tm_mday, in ds1337_set_alarm()
513 t->enabled, t->pending); in ds1337_set_alarm()
533 buf[0] = bin2bcd(t->time.tm_sec); in ds1337_set_alarm()
534 buf[1] = bin2bcd(t->time.tm_min); in ds1337_set_alarm()
535 buf[2] = bin2bcd(t->time.tm_hour); in ds1337_set_alarm()
536 buf[3] = bin2bcd(t->time.tm_mday); in ds1337_set_alarm()
545 if (t->enabled) { in ds1337_set_alarm()
653 static int mcp794xx_read_alarm(struct device *dev, struct rtc_wkalrm *t) in mcp794xx_read_alarm() argument
668 t->enabled = !!(regs[0] & MCP794XX_BIT_ALM0_EN); in mcp794xx_read_alarm()
671 t->time.tm_sec = bcd2bin(ds1307->regs[3] & 0x7f); in mcp794xx_read_alarm()
672 t->time.tm_min = bcd2bin(ds1307->regs[4] & 0x7f); in mcp794xx_read_alarm()
673 t->time.tm_hour = bcd2bin(ds1307->regs[5] & 0x3f); in mcp794xx_read_alarm()
674 t->time.tm_wday = bcd2bin(ds1307->regs[6] & 0x7) - 1; in mcp794xx_read_alarm()
675 t->time.tm_mday = bcd2bin(ds1307->regs[7] & 0x3f); in mcp794xx_read_alarm()
676 t->time.tm_mon = bcd2bin(ds1307->regs[8] & 0x1f) - 1; in mcp794xx_read_alarm()
677 t->time.tm_year = -1; in mcp794xx_read_alarm()
678 t->time.tm_yday = -1; in mcp794xx_read_alarm()
679 t->time.tm_isdst = -1; in mcp794xx_read_alarm()
683 t->time.tm_sec, t->time.tm_min, t->time.tm_hour, in mcp794xx_read_alarm()
684 t->time.tm_wday, t->time.tm_mday, t->time.tm_mon, t->enabled, in mcp794xx_read_alarm()
692 static int mcp794xx_set_alarm(struct device *dev, struct rtc_wkalrm *t) in mcp794xx_set_alarm() argument
704 t->time.tm_sec, t->time.tm_min, t->time.tm_hour, in mcp794xx_set_alarm()
705 t->time.tm_wday, t->time.tm_mday, t->time.tm_mon, in mcp794xx_set_alarm()
706 t->enabled, t->pending); in mcp794xx_set_alarm()
714 regs[3] = bin2bcd(t->time.tm_sec); in mcp794xx_set_alarm()
715 regs[4] = bin2bcd(t->time.tm_min); in mcp794xx_set_alarm()
716 regs[5] = bin2bcd(t->time.tm_hour); in mcp794xx_set_alarm()
717 regs[6] = bin2bcd(t->time.tm_wday + 1); in mcp794xx_set_alarm()
718 regs[7] = bin2bcd(t->time.tm_mday); in mcp794xx_set_alarm()
719 regs[8] = bin2bcd(t->time.tm_mon + 1); in mcp794xx_set_alarm()
732 if (!t->enabled) in mcp794xx_set_alarm()