From owner-p4-projects@FreeBSD.ORG Tue Nov 21 16:21:07 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C9F6016B085; Tue, 21 Nov 2006 16:21:07 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6724416B040 for ; Tue, 21 Nov 2006 16:21:07 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7580143D7E for ; Tue, 21 Nov 2006 16:19:19 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kALGJJxg046074 for ; Tue, 21 Nov 2006 16:19:19 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kALGJIC3046071 for perforce@freebsd.org; Tue, 21 Nov 2006 16:19:18 GMT (envelope-from imp@freebsd.org) Date: Tue, 21 Nov 2006 16:19:18 GMT Message-Id: <200611211619.kALGJIC3046071@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 110322 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2006 16:21:08 -0000 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); }