Lines Matching refs:tregs
253 read_timeregs(struct nxprtc_softc *sc, struct time_regs *tregs, uint8_t *tmr)
262 * timer, ensuring the fractional part is from the same second as tregs.
275 if ((err = iicdev_readfrom(sc->dev, sc->secaddr, tregs,
276 sizeof(*tregs), WAITFLAGS)) != 0)
278 } while (sc->use_timer && tregs->sec != sec);
294 * get its zero point back in sync with the tregs.sec rollover.
302 write_timeregs(struct nxprtc_softc *sc, struct time_regs *tregs)
305 return (iicdev_writeto(sc->dev, sc->secaddr, tregs,
306 sizeof(*tregs), WAITFLAGS));
556 struct time_regs tregs;
570 if ((err = read_timeregs(sc, &tregs, &tmrcount)) == 0) {
578 if ((tregs.sec & PCF85xx_B_SECOND_OS) || (cs1 & PCF85xx_B_CS1_STOP)) {
589 bct.ispm = (tregs.hour & PCF8523_B_HOUR_PM) != 0;
590 bct.sec = tregs.sec & PCF85xx_M_SECOND;
591 bct.min = tregs.min & PCF85xx_M_MINUTE;
592 bct.hour = tregs.hour & hourmask;
593 bct.day = tregs.day & PCF85xx_M_DAY;
594 bct.mon = tregs.month & PCF85xx_M_MONTH;
595 bct.year = tregs.year & PCF85xx_M_YEAR;
604 if (tregs.month & PCF8563_B_MONTH_C) {
622 struct time_regs tregs;
664 tregs.sec = bct.sec;
665 tregs.min = bct.min;
666 tregs.hour = bct.hour | (bct.ispm ? PCF8523_B_HOUR_PM : 0);
667 tregs.day = bct.day;
668 tregs.month = bct.mon;
669 tregs.year = (bct.year & 0xff) | cflag;
670 tregs.wday = bct.dow;
675 if ((err = write_timeregs(sc, &tregs)) != 0)