Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173863
b: refs/heads/master
c: 8f588e4
h: refs/heads/master
i:
  173861: 06020e9
  173859: effbcf4
  173855: fd0b4c8
v: v3
  • Loading branch information
Shinya Kuribayashi authored and Ben Dooks committed Dec 9, 2009
1 parent 6b5e965 commit 16fef1d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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: 69151e532c97f983b498ea03e20b1598a5487318
refs/heads/master: 8f588e40c788e63756ca1028c253f9f663d7d1c5
15 changes: 11 additions & 4 deletions trunk/drivers/i2c/busses/i2c-designware.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,18 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
* reprogram the target address in the i2c
* adapter when we are done with this transfer
*/
if (msgs[dev->msg_write_idx].addr != addr)
return;
if (msgs[dev->msg_write_idx].addr != addr) {
dev_err(dev->dev,
"%s: invalid target address\n", __func__);
dev->msg_err = -EINVAL;
break;
}

if (msgs[dev->msg_write_idx].len == 0) {
dev_err(dev->dev,
"%s: invalid message length\n", __func__);
dev->msg_err = -EINVAL;
return;
break;
}

if (!(dev->status & STATUS_WRITE_IN_PROGRESS)) {
Expand Down Expand Up @@ -426,6 +430,9 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
if (dev->msg_write_idx == dev->msgs_num)
intr_mask &= ~DW_IC_INTR_TX_EMPTY;

if (dev->msg_err)
intr_mask = 0;

writel(intr_mask, dev->base + DW_IC_INTR_MASK);
}

Expand Down Expand Up @@ -628,7 +635,7 @@ static irqreturn_t i2c_dw_isr(int this_irq, void *dev_id)
* the current transmit status.
*/

if (stat & (DW_IC_INTR_TX_ABRT | DW_IC_INTR_STOP_DET))
if ((stat & (DW_IC_INTR_TX_ABRT | DW_IC_INTR_STOP_DET)) || dev->msg_err)
complete(&dev->cmd_complete);

return IRQ_HANDLED;
Expand Down

0 comments on commit 16fef1d

Please sign in to comment.