diff options
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-designware.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-designware.c b/drivers/i2c/busses/i2c-designware.c index da5612b21aff..e8e2212d576e 100644 --- a/drivers/i2c/busses/i2c-designware.c +++ b/drivers/i2c/busses/i2c-designware.c | |||
@@ -364,6 +364,7 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev) | |||
364 | int rx_limit = dev->rx_fifo_depth - readl(dev->base + DW_IC_RXFLR); | 364 | int rx_limit = dev->rx_fifo_depth - readl(dev->base + DW_IC_RXFLR); |
365 | u32 addr = msgs[dev->msg_write_idx].addr; | 365 | u32 addr = msgs[dev->msg_write_idx].addr; |
366 | u32 buf_len = dev->tx_buf_len; | 366 | u32 buf_len = dev->tx_buf_len; |
367 | u8 *buf = dev->tx_buf;; | ||
367 | 368 | ||
368 | intr_mask = DW_IC_INTR_STOP_DET | DW_IC_INTR_TX_ABRT | DW_IC_INTR_RX_FULL; | 369 | intr_mask = DW_IC_INTR_STOP_DET | DW_IC_INTR_TX_ABRT | DW_IC_INTR_RX_FULL; |
369 | 370 | ||
@@ -384,7 +385,7 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev) | |||
384 | 385 | ||
385 | if (!(dev->status & STATUS_WRITE_IN_PROGRESS)) { | 386 | if (!(dev->status & STATUS_WRITE_IN_PROGRESS)) { |
386 | /* new i2c_msg */ | 387 | /* new i2c_msg */ |
387 | dev->tx_buf = msgs[dev->msg_write_idx].buf; | 388 | buf = msgs[dev->msg_write_idx].buf; |
388 | buf_len = msgs[dev->msg_write_idx].len; | 389 | buf_len = msgs[dev->msg_write_idx].len; |
389 | } | 390 | } |
390 | 391 | ||
@@ -393,11 +394,11 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev) | |||
393 | writel(0x100, dev->base + DW_IC_DATA_CMD); | 394 | writel(0x100, dev->base + DW_IC_DATA_CMD); |
394 | rx_limit--; | 395 | rx_limit--; |
395 | } else | 396 | } else |
396 | writel(*(dev->tx_buf++), | 397 | writel(*buf++, dev->base + DW_IC_DATA_CMD); |
397 | dev->base + DW_IC_DATA_CMD); | ||
398 | tx_limit--; buf_len--; | 398 | tx_limit--; buf_len--; |
399 | } | 399 | } |
400 | 400 | ||
401 | dev->tx_buf = buf; | ||
401 | dev->tx_buf_len = buf_len; | 402 | dev->tx_buf_len = buf_len; |
402 | 403 | ||
403 | if (buf_len > 0) { | 404 | if (buf_len > 0) { |