Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347046
b: refs/heads/master
c: 7c3fe64
h: refs/heads/master
v: v3
  • Loading branch information
Ludovic Desroches authored and Wolfram Sang committed Nov 14, 2012
1 parent a4fdf2a commit b507406
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 58a7371a4dd9d03f77265ee2784781fc39096136
refs/heads/master: 7c3fe64d133fbe4132d9966cd2f79a7193f13139
7 changes: 6 additions & 1 deletion trunk/drivers/i2c/busses/i2c-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#define AT91_TWI_STOP 0x0002 /* Send a Stop Condition */
#define AT91_TWI_MSEN 0x0004 /* Master Transfer Enable */
#define AT91_TWI_SVDIS 0x0020 /* Slave Transfer Disable */
#define AT91_TWI_QUICK 0x0040 /* SMBus quick command */
#define AT91_TWI_SWRST 0x0080 /* Software Reset */

#define AT91_TWI_MMR 0x0004 /* Master Mode Register */
Expand Down Expand Up @@ -212,7 +213,11 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev)

INIT_COMPLETION(dev->cmd_complete);
dev->transfer_status = 0;
if (dev->msg->flags & I2C_M_RD) {

if (!dev->buf_len) {
at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_QUICK);
at91_twi_write(dev, AT91_TWI_IER, AT91_TWI_TXCOMP);
} else if (dev->msg->flags & I2C_M_RD) {
unsigned start_flags = AT91_TWI_START;

if (at91_twi_read(dev, AT91_TWI_SR) & AT91_TWI_RXRDY) {
Expand Down

0 comments on commit b507406

Please sign in to comment.