Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Sep 2010 15:58:20 +0000 (UTC)
From:      Bernd Walter <ticso@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r213203 - head/sys/arm/at91
Message-ID:  <201009271558.o8RFwKwt041218@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ticso
Date: Mon Sep 27 15:58:19 2010
New Revision: 213203
URL: http://svn.freebsd.org/changeset/base/213203

Log:
  The TWI controller automatically stops if we don't fill up with new data in
  time.

Modified:
  head/sys/arm/at91/at91_twi.c

Modified: head/sys/arm/at91/at91_twi.c
==============================================================================
--- head/sys/arm/at91/at91_twi.c	Mon Sep 27 15:55:39 2010	(r213202)
+++ head/sys/arm/at91/at91_twi.c	Mon Sep 27 15:58:19 2010	(r213203)
@@ -338,7 +338,7 @@ at91_twi_transfer(device_t dev, struct i
 			err = EINVAL;
 			goto out;
 		}
-		if (len == 1)
+		if (len == 1 && msgs[i].flags & IIC_M_RD)
 			WR4(sc, TWI_CR, TWI_CR_START | TWI_CR_STOP);
 		else
 			WR4(sc, TWI_CR, TWI_CR_START);
@@ -358,8 +358,6 @@ at91_twi_transfer(device_t dev, struct i
 			}
 		} else {
 			while (len--) {
-				if (len == 0 && msgs[i].len != 1)
-					WR4(sc, TWI_CR, TWI_CR_STOP);
 				if ((err = at91_twi_wait(sc, TWI_SR_TXRDY)))
 					goto out;
 				WR4(sc, TWI_THR, *buf++);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009271558.o8RFwKwt041218>