Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173852
b: refs/heads/master
c: c70c5cd
h: refs/heads/master
v: v3
  • Loading branch information
Shinya Kuribayashi authored and Ben Dooks committed Dec 9, 2009
1 parent 540c72a commit b9a4c3d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 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: d60c7e81dda2041302791c6a5261bd0c74d60fba
refs/heads/master: c70c5cd37413c3fa3503212d26ffdf6df535c9de
20 changes: 12 additions & 8 deletions trunk/drivers/i2c/busses/i2c-designware.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
u32 addr = msgs[dev->msg_write_idx].addr;
u32 buf_len = dev->tx_buf_len;

intr_mask = DW_IC_INTR_STOP_DET | DW_IC_INTR_TX_ABRT;

if (!(dev->status & STATUS_WRITE_IN_PROGRESS)) {
/* Disable the adapter */
writel(0, dev->base + DW_IC_ENABLE);
Expand Down Expand Up @@ -387,17 +389,19 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
dev->base + DW_IC_DATA_CMD);
tx_limit--; buf_len--;
}

dev->tx_buf_len = buf_len;

if (buf_len > 0) {
/* more bytes to be written */
intr_mask |= DW_IC_INTR_TX_EMPTY;
dev->status |= STATUS_WRITE_IN_PROGRESS;
break;
} else
dev->status &= ~STATUS_WRITE_IN_PROGRESS;
}

intr_mask = DW_IC_INTR_STOP_DET | DW_IC_INTR_TX_ABRT;
if (buf_len > 0) { /* more bytes to be written */
intr_mask |= DW_IC_INTR_TX_EMPTY;
dev->status |= STATUS_WRITE_IN_PROGRESS;
} else
dev->status &= ~STATUS_WRITE_IN_PROGRESS;
writel(intr_mask, dev->base + DW_IC_INTR_MASK);

dev->tx_buf_len = buf_len;
}

static void
Expand Down

0 comments on commit b9a4c3d

Please sign in to comment.