Date: Tue, 21 Nov 2006 17:18:32 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 110322 for review Message-ID: <200611211718.kALHIWrE068813@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=110322 Change 110322 by imp@imp_lighthouse on 2006/11/21 00:54:04 Don't return EIO when reset works (doesn't matter though) Add silly printf at91_twi_wait() returns 0 for success, not failure. We now seem to read things, but the data isn't returned to userland for reasosn unknown. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_twi.c#27 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_twi.c#27 (text+ko) ==== @@ -396,7 +396,7 @@ WR4(sc, TWI_CR, TWI_CR_MSEN | TWI_CR_SVDIS); WR4(sc, TWI_CWGR, sc->cwgr); - return EIO; + return 0; } static int @@ -435,6 +435,8 @@ * See http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-September/024411.html * for details. */ + printf("%d: flags %#x len %d buf %p\n", i, msgs[i].flags, + msgs[i].len, msgs[i].buf); rdwr = (msgs[i].flags & IIC_M_RD) ? TWI_MMR_MREAD : 0; WR4(sc, TWI_MMR, TWI_MMR_DADR(msgs[i].slave) | rdwr); len = msgs[i].len; @@ -446,7 +448,7 @@ while (len--) { if (len == 0) WR4(sc, TWI_CR, TWI_CR_STOP); - if (!at91_twi_wait(sc, TWI_SR_RXRDY)) { + if (at91_twi_wait(sc, TWI_SR_RXRDY)) { printf("1\n"); return (EIO); } @@ -457,13 +459,13 @@ WR4(sc, TWI_THR, *buf++); if (len == 0) WR4(sc, TWI_CR, TWI_CR_STOP); - if (!at91_twi_wait(sc, TWI_SR_TXRDY)) { + if (at91_twi_wait(sc, TWI_SR_TXRDY)) { printf("3\n"); return (EIO); } } } - if (!at91_twi_wait(sc, TWI_SR_TXCOMP)) { + if (at91_twi_wait(sc, TWI_SR_TXCOMP)) { printf("2\n"); return (EIO); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611211718.kALHIWrE068813>