Lines Matching defs:i2c_tp
236 i2c_transfer_t *i2c_tp = NULL;
277 &i2c_tp, 1, 1, I2C_SLEEP);
278 i2c_tp->i2c_version = I2C_XFER_REV;
279 i2c_tp->i2c_flags = I2C_WR_RD;
280 i2c_tp->i2c_wbuf[0] = (uchar_t)0x00; /* Read 00h */
281 i2c_tp->i2c_wlen = 1;
282 i2c_tp->i2c_rlen = 1;
284 if ((i2c_transfer(statep->ds1307_i2c_hdl, i2c_tp)) != I2C_SUCCESS) {
285 (void) i2c_transfer_free(statep->ds1307_i2c_hdl, i2c_tp);
291 tempVal = i2c_tp->i2c_rbuf[0];
293 (void) i2c_transfer_free(statep->ds1307_i2c_hdl, i2c_tp);
296 (void) i2c_transfer_alloc(statep->ds1307_i2c_hdl, &i2c_tp,
298 i2c_tp->i2c_version = I2C_XFER_REV;
299 i2c_tp->i2c_flags = I2C_WR;
300 i2c_tp->i2c_wbuf[0] = 0x00;
301 i2c_tp->i2c_wbuf[1] =
302 (uchar_t)(i2c_tp->i2c_rbuf[0]& 0x7f);
303 i2c_tp->i2c_wlen = 2;
305 if ((i2c_transfer(statep->ds1307_i2c_hdl, i2c_tp))
308 i2c_tp);
312 (void) i2c_transfer_free(statep->ds1307_i2c_hdl, i2c_tp);
485 i2c_transfer_t *i2c_tp = NULL;
505 if ((i2c_transfer_alloc(statep->ds1307_i2c_hdl, &i2c_tp, 1,
512 i2c_tp->i2c_version = I2C_XFER_REV;
513 i2c_tp->i2c_flags = I2C_WR_RD;
514 i2c_tp->i2c_wbuf[0] = (uchar_t)0x00; /* Start from reg 0x00 */
515 i2c_tp->i2c_wlen = 1; /* Write one byte address */
516 i2c_tp->i2c_rlen = 7; /* Read 7 regs */
519 i2c_tp)) != I2C_SUCCESS) {
526 bcopy(i2c_tp->i2c_rbuf, tod_read, 7);
530 i2c_tp->i2c_wbuf[0] = (uchar_t)0x00;
531 i2c_tp->i2c_wlen = 1; /* Write one byte address */
532 i2c_tp->i2c_rlen = 7; /* Read 7 regs */
534 i2c_tp)) != I2C_SUCCESS) {
539 if (bcmp(tod_read, i2c_tp->i2c_rbuf, 7) != 0) {
545 } while (i2c_tp->i2c_rbuf[0] == 0x59 &&
547 bcmp(&tod_read[1], &i2c_tp->i2c_rbuf[1], 6) != 0 &&
554 bcopy(i2c_tp->i2c_rbuf, tod_read, 7);
557 rtc->rtc_year = bcd2int(i2c_tp->i2c_rbuf[6]);
558 rtc->rtc_mon = bcd2int(i2c_tp->i2c_rbuf[5]);
559 rtc->rtc_dom = bcd2int(i2c_tp->i2c_rbuf[4]);
560 rtc->rtc_dow = bcd2int(i2c_tp->i2c_rbuf[3]);
561 rtc->rtc_hrs = bcd2int(i2c_tp->i2c_rbuf[2]);
562 rtc->rtc_min = bcd2int(i2c_tp->i2c_rbuf[1]);
563 rtc->rtc_sec = bcd2int(i2c_tp->i2c_rbuf[0]);
566 (void) i2c_transfer_free(statep->ds1307_i2c_hdl, i2c_tp);
577 i2c_transfer_t *i2c_tp = NULL;
591 &i2c_tp, 8, 0, I2C_SLEEP)) != I2C_SUCCESS) {
595 i2c_tp->i2c_version = I2C_XFER_REV;
596 i2c_tp->i2c_flags = I2C_WR;
597 i2c_tp->i2c_wbuf[0] = (uchar_t)0x00;
598 i2c_tp->i2c_wbuf[1] = rtc->rtc_sec;
599 i2c_tp->i2c_wbuf[2] = rtc->rtc_min;
600 i2c_tp->i2c_wbuf[3] = rtc->rtc_hrs;
601 i2c_tp->i2c_wbuf[4] = rtc->rtc_dow;
602 i2c_tp->i2c_wbuf[5] = rtc->rtc_dom;
603 i2c_tp->i2c_wbuf[6] = rtc->rtc_mon;
604 i2c_tp->i2c_wbuf[7] = rtc->rtc_year;
605 i2c_tp->i2c_wlen = 8;
608 i2c_tp)) != I2C_SUCCESS) {
609 (void) i2c_transfer_free(statep->ds1307_i2c_hdl, i2c_tp);
617 (void) i2c_transfer_free(statep->ds1307_i2c_hdl, i2c_tp);