Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358778
b: refs/heads/master
c: 17a76b4
h: refs/heads/master
v: v3
  • Loading branch information
Mika Westerberg authored and Wolfram Sang committed Jan 28, 2013
1 parent 9158489 commit d3ec162
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 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: 5c38dc8911b86b7c49305e2f2b631cd1241f2d87
refs/heads/master: 17a76b4b32aca7c19df6988213dfe2eb4b631431
16 changes: 14 additions & 2 deletions trunk/drivers/i2c/busses/i2c-designware-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,23 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
rx_limit = dev->rx_fifo_depth - dw_readl(dev, DW_IC_RXFLR);

while (buf_len > 0 && tx_limit > 0 && rx_limit > 0) {
u32 cmd = 0;

/*
* If IC_EMPTYFIFO_HOLD_MASTER_EN is set we must
* manually set the stop bit. However, it cannot be
* detected from the registers so we set it always
* when writing/reading the last byte.
*/
if (dev->msg_write_idx == dev->msgs_num - 1 &&
buf_len == 1)
cmd |= BIT(9);

if (msgs[dev->msg_write_idx].flags & I2C_M_RD) {
dw_writel(dev, 0x100, DW_IC_DATA_CMD);
dw_writel(dev, cmd | 0x100, DW_IC_DATA_CMD);
rx_limit--;
} else
dw_writel(dev, *buf++, DW_IC_DATA_CMD);
dw_writel(dev, cmd | *buf++, DW_IC_DATA_CMD);
tx_limit--; buf_len--;
}

Expand Down

0 comments on commit d3ec162

Please sign in to comment.