aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-designware.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-designware.c b/drivers/i2c/busses/i2c-designware.c
index f184d822d3d..6acbe846e9c 100644
--- a/drivers/i2c/busses/i2c-designware.c
+++ b/drivers/i2c/busses/i2c-designware.c
@@ -415,12 +415,17 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
/* more bytes to be written */
dev->status |= STATUS_WRITE_IN_PROGRESS;
break;
- } else {
+ } else
dev->status &= ~STATUS_WRITE_IN_PROGRESS;
- intr_mask &= ~DW_IC_INTR_TX_EMPTY;
- }
}
+ /*
+ * If i2c_msg index search is completed, we don't need TX_EMPTY
+ * interrupt any more.
+ */
+ if (dev->msg_write_idx == dev->msgs_num)
+ intr_mask &= ~DW_IC_INTR_TX_EMPTY;
+
writel(intr_mask, dev->base + DW_IC_INTR_MASK);
}