svn commit: r213203 - head/sys/arm/at91
Bernd Walter
ticso at FreeBSD.org
Mon Sep 27 15:58:20 UTC 2010
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++);
More information about the svn-src-head
mailing list