diff options
author | ticso <ticso@FreeBSD.org> | 2010-09-27 15:58:19 +0000 |
---|---|---|
committer | ticso <ticso@FreeBSD.org> | 2010-09-27 15:58:19 +0000 |
commit | 0901947e8d8500bb8120febd32587bc1eeabca98 (patch) | |
tree | 627042c9f5072876995641c727db6fa71f523c9b /sys/arm | |
parent | 59ebbd28982a62d14ee28b3894103094363ae886 (diff) | |
download | FreeBSD-src-0901947e8d8500bb8120febd32587bc1eeabca98.zip FreeBSD-src-0901947e8d8500bb8120febd32587bc1eeabca98.tar.gz |
The TWI controller automatically stops if we don't fill up with new data in
time.
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/at91/at91_twi.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/arm/at91/at91_twi.c b/sys/arm/at91/at91_twi.c index 6442d07..b101772 100644 --- a/sys/arm/at91/at91_twi.c +++ b/sys/arm/at91/at91_twi.c @@ -338,7 +338,7 @@ at91_twi_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) 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 iic_msg *msgs, uint32_t nmsgs) } } 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++); |