View | Details | Raw Unified | Return to bug 247576 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/dev/iicbus/twsi/twsi.c (-5 / +9 lines)
Lines 535-547 twsi_intr(void *arg) Link Here
535
	debugf(sc->dev, "Got interrupt Current msg=%x\n", sc->msg_idx);
535
	debugf(sc->dev, "Got interrupt Current msg=%x\n", sc->msg_idx);
536
536
537
	status = TWSI_READ(sc, sc->reg_status);
537
	status = TWSI_READ(sc, sc->reg_status);
538
	debugf(sc->dev, "initial status=%x\n", status);
538
	debugf(sc->dev, "reg control=%x\n", TWSI_READ(sc, sc->reg_control));
539
539
540
	switch (status) {
540
	switch (status) {
541
	case TWSI_STATUS_START:
541
	case TWSI_STATUS_START:
542
	case TWSI_STATUS_RPTD_START:
542
	case TWSI_STATUS_RPTD_START:
543
		/* Transmit the address */
543
		/* Transmit the address */
544
		debugf(sc->dev, "Send the address\n");
544
		debugf(sc->dev, "Send the address (%x)", sc->msgs[sc->msg_idx].slave);
545
545
546
		if (sc->msgs[sc->msg_idx].flags & IIC_M_RD)
546
		if (sc->msgs[sc->msg_idx].flags & IIC_M_RD)
547
			TWSI_WRITE(sc, sc->reg_data,
547
			TWSI_WRITE(sc, sc->reg_data,
Lines 631-639 twsi_intr(void *arg) Link Here
631
				TWSI_WRITE(sc, sc->reg_control,
631
				TWSI_WRITE(sc, sc->reg_control,
632
				    sc->control_val | TWSI_CONTROL_STOP);
632
				    sc->control_val | TWSI_CONTROL_STOP);
633
		} else {
633
		} else {
634
			debugf(sc->dev, "No ack when receiving data\n");
634
			debugf(sc->dev, "No ack when receiving data, sending stop anyway\n");
635
			sc->error = ENXIO;
635
			if (!(sc->msgs[sc->msg_idx].flags & IIC_M_NOSTOP))
636
			sc->control_val = 0;
636
				TWSI_WRITE(sc, sc->reg_control,
637
				    sc->control_val | TWSI_CONTROL_STOP);
637
		}
638
		}
638
		sc->transfer = 0;
639
		sc->transfer = 0;
639
		transfer_done = 1;
640
		transfer_done = 1;
Lines 647-652 twsi_intr(void *arg) Link Here
647
		wakeup(sc);
648
		wakeup(sc);
648
		break;
649
		break;
649
	}
650
	}
651
	debugf(sc->dev, "Refresh reg_control\n");
652
	TWSI_WRITE(sc, sc->reg_control,
653
	  sc->control_val | TWSI_CONTROL_IFLG);
650
654
651
	debugf(sc->dev, "Done with interrupts\n\n");
655
	debugf(sc->dev, "Done with interrupts\n\n");
652
	if (transfer_done == 1) {
656
	if (transfer_done == 1) {

Return to bug 247576