Lines Matching defs:i2c_tp

233 	i2c_transfer_t	*i2c_tp = NULL;
282 &i2c_tp, 1, 1, I2C_SLEEP);
283 i2c_tp->i2c_version = I2C_XFER_REV;
284 i2c_tp->i2c_flags = I2C_WR_RD;
285 i2c_tp->i2c_wbuf[0] = (uchar_t)RTC_STATUS; /* Read Status register */
286 i2c_tp->i2c_wlen = 1;
287 i2c_tp->i2c_rlen = 1;
289 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) {
290 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
299 tempVal = i2c_tp->i2c_rbuf[0];
301 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
308 (void) i2c_transfer_alloc(statep->ds1337_i2c_hdl, &i2c_tp,
310 i2c_tp->i2c_version = I2C_XFER_REV;
311 i2c_tp->i2c_flags = I2C_WR;
312 i2c_tp->i2c_wbuf[0] = RTC_CTL; /* Write Control register */
313 i2c_tp->i2c_wbuf[1] = (uchar_t)(RTC_CTL_RS2 | RTC_CTL_RS1 |
315 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp))
318 i2c_tp);
327 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
332 (void) i2c_transfer_alloc(statep->ds1337_i2c_hdl, &i2c_tp,
334 i2c_tp->i2c_version = I2C_XFER_REV;
335 i2c_tp->i2c_flags = I2C_WR;
336 i2c_tp->i2c_wbuf[0] = RTC_STATUS;
337 i2c_tp->i2c_wbuf[1] = (uchar_t)0;
338 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp))
341 i2c_tp);
350 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
480 i2c_transfer_t *i2c_tp = NULL;
511 &i2c_tp, 1, 1, I2C_SLEEP);
512 i2c_tp->i2c_version = I2C_XFER_REV;
513 i2c_tp->i2c_flags = I2C_WR_RD;
514 i2c_tp->i2c_wbuf[0] = (uchar_t)RTC_CTL; /* Read Control register */
516 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) {
517 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
525 tmpval = i2c_tp->i2c_rbuf[0];
527 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
530 &i2c_tp, 2, 0, I2C_SLEEP);
531 i2c_tp->i2c_version = I2C_XFER_REV;
532 i2c_tp->i2c_flags = I2C_WR;
533 i2c_tp->i2c_wbuf[0] = (uchar_t)RTC_CTL; /* Write Control register */
534 i2c_tp->i2c_wbuf[1] = tmpval & ~RTC_CTL_A1IE;
536 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) {
537 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
545 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
553 &i2c_tp, 5, 0, I2C_SLEEP);
554 i2c_tp->i2c_version = I2C_XFER_REV;
555 i2c_tp->i2c_flags = I2C_WR;
556 i2c_tp->i2c_wbuf[0] = (uchar_t)RTC_ALARM_SEC; /* Alarm #1 Seconds */
557 i2c_tp->i2c_wbuf[1] = BYTE_TO_BCD(tod.tod_sec);
558 i2c_tp->i2c_wbuf[2] = BYTE_TO_BCD(tod.tod_min);
559 i2c_tp->i2c_wbuf[3] = BYTE_TO_BCD(tod.tod_hour);
560 i2c_tp->i2c_wbuf[4] = BYTE_TO_BCD(tod.tod_day);
562 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) {
563 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
571 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
578 &i2c_tp, 2, 0, I2C_SLEEP);
579 i2c_tp->i2c_version = I2C_XFER_REV;
580 i2c_tp->i2c_flags = I2C_WR;
581 i2c_tp->i2c_wbuf[0] = (uchar_t)RTC_CTL; /* Write Control register */
582 i2c_tp->i2c_wbuf[1] = tmpval | RTC_CTL_A1IE;
584 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) {
585 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
593 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
604 i2c_transfer_t *i2c_tp = NULL;
633 &i2c_tp, 1, 1, I2C_SLEEP);
634 i2c_tp->i2c_version = I2C_XFER_REV;
635 i2c_tp->i2c_flags = I2C_WR_RD;
636 i2c_tp->i2c_wbuf[0] = (uchar_t)RTC_CTL; /* Read Control register */
638 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) {
639 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
647 tmpval = i2c_tp->i2c_rbuf[0];
649 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
652 &i2c_tp, 2, 0, I2C_SLEEP);
653 i2c_tp->i2c_version = I2C_XFER_REV;
654 i2c_tp->i2c_flags = I2C_WR;
655 i2c_tp->i2c_wbuf[0] = (uchar_t)RTC_CTL; /* Write Control register */
656 i2c_tp->i2c_wbuf[1] = tmpval & ~RTC_CTL_A1IE;
658 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) {
659 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
667 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
673 &i2c_tp, 1, 1, I2C_SLEEP);
674 i2c_tp->i2c_version = I2C_XFER_REV;
675 i2c_tp->i2c_flags = I2C_WR_RD;
676 i2c_tp->i2c_wbuf[0] = (uchar_t)RTC_STATUS; /* Read Status register */
678 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) {
679 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
687 tmpval = i2c_tp->i2c_rbuf[0];
689 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
692 &i2c_tp, 2, 0, I2C_SLEEP);
693 i2c_tp->i2c_version = I2C_XFER_REV;
694 i2c_tp->i2c_flags = I2C_WR;
695 i2c_tp->i2c_wbuf[0] = (uchar_t)RTC_STATUS; /* Write Status register */
696 i2c_tp->i2c_wbuf[1] = tmpval & ~RTC_STATUS_A1F;
698 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) {
699 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
707 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
736 i2c_transfer_t *i2c_tp = NULL;
756 if ((i2c_transfer_alloc(statep->ds1337_i2c_hdl, &i2c_tp, 1,
763 i2c_tp->i2c_version = I2C_XFER_REV;
764 i2c_tp->i2c_flags = I2C_WR_RD;
765 i2c_tp->i2c_wbuf[0] = (uchar_t)RTC_SEC; /* Start from 0x00 */
766 i2c_tp->i2c_wlen = 1; /* Write one byte address */
767 i2c_tp->i2c_rlen = 7; /* Read 7 regs */
770 i2c_tp)) != I2C_SUCCESS) {
776 bcopy(i2c_tp->i2c_rbuf, tod_read, 7);
780 i2c_tp->i2c_wbuf[0] = (uchar_t)0x00;
781 i2c_tp->i2c_wlen = 1; /* Write one byte address */
782 i2c_tp->i2c_rlen = 7; /* Read 7 regs */
784 i2c_tp)) != I2C_SUCCESS) {
788 if (bcmp(tod_read, i2c_tp->i2c_rbuf, 7) != 0) {
794 } while (i2c_tp->i2c_rbuf[0] == 0x59 &&
796 bcmp(&tod_read[1], &i2c_tp->i2c_rbuf[1], 6) != 0 &&
803 bcopy(i2c_tp->i2c_rbuf, tod_read, 7);
806 rtc->rtc_year = BCD_TO_BYTE(i2c_tp->i2c_rbuf[6]);
807 rtc->rtc_mon = BCD_TO_BYTE(i2c_tp->i2c_rbuf[5]);
808 rtc->rtc_dom = BCD_TO_BYTE(i2c_tp->i2c_rbuf[4]);
809 rtc->rtc_dow = BCD_TO_BYTE(i2c_tp->i2c_rbuf[3]);
810 rtc->rtc_hrs = BCD_TO_BYTE(i2c_tp->i2c_rbuf[2]);
811 rtc->rtc_min = BCD_TO_BYTE(i2c_tp->i2c_rbuf[1]);
812 rtc->rtc_sec = BCD_TO_BYTE(i2c_tp->i2c_rbuf[0]);
815 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
826 i2c_transfer_t *i2c_tp = NULL;
840 &i2c_tp, 8, 0, I2C_SLEEP)) != I2C_SUCCESS) {
844 i2c_tp->i2c_version = I2C_XFER_REV;
845 i2c_tp->i2c_flags = I2C_WR;
846 i2c_tp->i2c_wbuf[0] = (uchar_t)RTC_SEC;
847 i2c_tp->i2c_wbuf[1] = BYTE_TO_BCD(rtc->rtc_sec);
848 i2c_tp->i2c_wbuf[2] = BYTE_TO_BCD(rtc->rtc_min);
849 i2c_tp->i2c_wbuf[3] = BYTE_TO_BCD(rtc->rtc_hrs);
850 i2c_tp->i2c_wbuf[4] = BYTE_TO_BCD(rtc->rtc_dow);
851 i2c_tp->i2c_wbuf[5] = BYTE_TO_BCD(rtc->rtc_dom);
852 i2c_tp->i2c_wbuf[6] = BYTE_TO_BCD(rtc->rtc_mon);
853 i2c_tp->i2c_wbuf[7] = BYTE_TO_BCD(rtc->rtc_year);
854 i2c_tp->i2c_wlen = 8;
857 i2c_tp)) != I2C_SUCCESS) {
858 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);
864 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp);