Lines Matching refs:t

372 static int ds1307_get_time(struct device *dev, struct rtc_time *t)  in ds1307_get_time()  argument
387 t->tm_sec = bcd2bin(ds1307->regs[DS1307_REG_SECS] & 0x7f); in ds1307_get_time()
388 t->tm_min = bcd2bin(ds1307->regs[DS1307_REG_MIN] & 0x7f); in ds1307_get_time()
390 t->tm_hour = bcd2bin(tmp); in ds1307_get_time()
391 t->tm_wday = bcd2bin(ds1307->regs[DS1307_REG_WDAY] & 0x07) - 1; in ds1307_get_time()
392 t->tm_mday = bcd2bin(ds1307->regs[DS1307_REG_MDAY] & 0x3f); in ds1307_get_time()
394 t->tm_mon = bcd2bin(tmp) - 1; in ds1307_get_time()
397 t->tm_year = bcd2bin(ds1307->regs[DS1307_REG_YEAR]) + 100; in ds1307_get_time()
401 "read", t->tm_sec, t->tm_min, in ds1307_get_time()
402 t->tm_hour, t->tm_mday, in ds1307_get_time()
403 t->tm_mon, t->tm_year, t->tm_wday); in ds1307_get_time()
406 return rtc_valid_tm(t); in ds1307_get_time()
409 static int ds1307_set_time(struct device *dev, struct rtc_time *t) in ds1307_set_time() argument
418 "write", t->tm_sec, t->tm_min, in ds1307_set_time()
419 t->tm_hour, t->tm_mday, in ds1307_set_time()
420 t->tm_mon, t->tm_year, t->tm_wday); in ds1307_set_time()
422 buf[DS1307_REG_SECS] = bin2bcd(t->tm_sec); in ds1307_set_time()
423 buf[DS1307_REG_MIN] = bin2bcd(t->tm_min); in ds1307_set_time()
424 buf[DS1307_REG_HOUR] = bin2bcd(t->tm_hour); in ds1307_set_time()
425 buf[DS1307_REG_WDAY] = bin2bcd(t->tm_wday + 1); in ds1307_set_time()
426 buf[DS1307_REG_MDAY] = bin2bcd(t->tm_mday); in ds1307_set_time()
427 buf[DS1307_REG_MONTH] = bin2bcd(t->tm_mon + 1); in ds1307_set_time()
430 tmp = t->tm_year - 100; in ds1307_set_time()
467 static int ds1337_read_alarm(struct device *dev, struct rtc_wkalrm *t) in ds1337_read_alarm() argument
496 t->time.tm_sec = bcd2bin(ds1307->regs[0] & 0x7f); in ds1337_read_alarm()
497 t->time.tm_min = bcd2bin(ds1307->regs[1] & 0x7f); in ds1337_read_alarm()
498 t->time.tm_hour = bcd2bin(ds1307->regs[2] & 0x3f); in ds1337_read_alarm()
499 t->time.tm_mday = bcd2bin(ds1307->regs[3] & 0x3f); in ds1337_read_alarm()
500 t->time.tm_mon = -1; in ds1337_read_alarm()
501 t->time.tm_year = -1; in ds1337_read_alarm()
502 t->time.tm_wday = -1; in ds1337_read_alarm()
503 t->time.tm_yday = -1; in ds1337_read_alarm()
504 t->time.tm_isdst = -1; in ds1337_read_alarm()
507 t->enabled = !!(ds1307->regs[7] & DS1337_BIT_A1IE); in ds1337_read_alarm()
508 t->pending = !!(ds1307->regs[8] & DS1337_BIT_A1I); in ds1337_read_alarm()
512 "alarm read", t->time.tm_sec, t->time.tm_min, in ds1337_read_alarm()
513 t->time.tm_hour, t->time.tm_mday, in ds1337_read_alarm()
514 t->enabled, t->pending); in ds1337_read_alarm()
519 static int ds1337_set_alarm(struct device *dev, struct rtc_wkalrm *t) in ds1337_set_alarm() argument
532 "alarm set", t->time.tm_sec, t->time.tm_min, in ds1337_set_alarm()
533 t->time.tm_hour, t->time.tm_mday, in ds1337_set_alarm()
534 t->enabled, t->pending); in ds1337_set_alarm()
554 buf[0] = bin2bcd(t->time.tm_sec); in ds1337_set_alarm()
555 buf[1] = bin2bcd(t->time.tm_min); in ds1337_set_alarm()
556 buf[2] = bin2bcd(t->time.tm_hour); in ds1337_set_alarm()
557 buf[3] = bin2bcd(t->time.tm_mday); in ds1337_set_alarm()
566 if (t->enabled) { in ds1337_set_alarm()
673 static int mcp794xx_read_alarm(struct device *dev, struct rtc_wkalrm *t) in mcp794xx_read_alarm() argument
688 t->enabled = !!(regs[0] & MCP794XX_BIT_ALM0_EN); in mcp794xx_read_alarm()
691 t->time.tm_sec = bcd2bin(ds1307->regs[3] & 0x7f); in mcp794xx_read_alarm()
692 t->time.tm_min = bcd2bin(ds1307->regs[4] & 0x7f); in mcp794xx_read_alarm()
693 t->time.tm_hour = bcd2bin(ds1307->regs[5] & 0x3f); in mcp794xx_read_alarm()
694 t->time.tm_wday = bcd2bin(ds1307->regs[6] & 0x7) - 1; in mcp794xx_read_alarm()
695 t->time.tm_mday = bcd2bin(ds1307->regs[7] & 0x3f); in mcp794xx_read_alarm()
696 t->time.tm_mon = bcd2bin(ds1307->regs[8] & 0x1f) - 1; in mcp794xx_read_alarm()
697 t->time.tm_year = -1; in mcp794xx_read_alarm()
698 t->time.tm_yday = -1; in mcp794xx_read_alarm()
699 t->time.tm_isdst = -1; in mcp794xx_read_alarm()
703 t->time.tm_sec, t->time.tm_min, t->time.tm_hour, in mcp794xx_read_alarm()
704 t->time.tm_wday, t->time.tm_mday, t->time.tm_mon, t->enabled, in mcp794xx_read_alarm()
712 static int mcp794xx_set_alarm(struct device *dev, struct rtc_wkalrm *t) in mcp794xx_set_alarm() argument
724 t->time.tm_sec, t->time.tm_min, t->time.tm_hour, in mcp794xx_set_alarm()
725 t->time.tm_wday, t->time.tm_mday, t->time.tm_mon, in mcp794xx_set_alarm()
726 t->enabled, t->pending); in mcp794xx_set_alarm()
734 regs[3] = bin2bcd(t->time.tm_sec); in mcp794xx_set_alarm()
735 regs[4] = bin2bcd(t->time.tm_min); in mcp794xx_set_alarm()
736 regs[5] = bin2bcd(t->time.tm_hour); in mcp794xx_set_alarm()
737 regs[6] = bin2bcd(t->time.tm_wday) + 1; in mcp794xx_set_alarm()
738 regs[7] = bin2bcd(t->time.tm_mday); in mcp794xx_set_alarm()
739 regs[8] = bin2bcd(t->time.tm_mon) + 1; in mcp794xx_set_alarm()
746 if (t->enabled) in mcp794xx_set_alarm()