diff options
| author | Hsin-Yi Wang <hsinyi@chromium.org> | 2019-02-15 04:02:02 -0500 |
|---|---|---|
| committer | Wolfram Sang <wsa@the-dreams.de> | 2019-03-12 09:09:15 -0400 |
| commit | bc1a7f75c85e226e82f183d30d75c357f92b6029 (patch) | |
| tree | 1ec5d5103ce20805a6f168e8cf81ba2c5e18c35c | |
| parent | ea295481b6e313b4ea3ca2720ffcafd6005b5643 (diff) | |
i2c: mediatek: modify threshold passed to i2c_get_dma_safe_msg_buf()
DMA with zero-length transfers doesn't make sense and this HW doesn't
support them at all, so increase the threshold.
Fixes: fc66b39fe36a ("i2c: mediatek: Use DMA safe buffers for i2c transactions")
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
[wsa: reworded commit message]
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| -rw-r--r-- | drivers/i2c/busses/i2c-mt65xx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index 660de1ee68ed..684d651612b3 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c | |||
| @@ -503,7 +503,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs, | |||
| 503 | writel(I2C_DMA_INT_FLAG_NONE, i2c->pdmabase + OFFSET_INT_FLAG); | 503 | writel(I2C_DMA_INT_FLAG_NONE, i2c->pdmabase + OFFSET_INT_FLAG); |
| 504 | writel(I2C_DMA_CON_RX, i2c->pdmabase + OFFSET_CON); | 504 | writel(I2C_DMA_CON_RX, i2c->pdmabase + OFFSET_CON); |
| 505 | 505 | ||
| 506 | dma_rd_buf = i2c_get_dma_safe_msg_buf(msgs, 0); | 506 | dma_rd_buf = i2c_get_dma_safe_msg_buf(msgs, 1); |
| 507 | if (!dma_rd_buf) | 507 | if (!dma_rd_buf) |
| 508 | return -ENOMEM; | 508 | return -ENOMEM; |
| 509 | 509 | ||
| @@ -526,7 +526,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs, | |||
| 526 | writel(I2C_DMA_INT_FLAG_NONE, i2c->pdmabase + OFFSET_INT_FLAG); | 526 | writel(I2C_DMA_INT_FLAG_NONE, i2c->pdmabase + OFFSET_INT_FLAG); |
| 527 | writel(I2C_DMA_CON_TX, i2c->pdmabase + OFFSET_CON); | 527 | writel(I2C_DMA_CON_TX, i2c->pdmabase + OFFSET_CON); |
| 528 | 528 | ||
| 529 | dma_wr_buf = i2c_get_dma_safe_msg_buf(msgs, 0); | 529 | dma_wr_buf = i2c_get_dma_safe_msg_buf(msgs, 1); |
| 530 | if (!dma_wr_buf) | 530 | if (!dma_wr_buf) |
| 531 | return -ENOMEM; | 531 | return -ENOMEM; |
| 532 | 532 | ||
| @@ -549,7 +549,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs, | |||
| 549 | writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_INT_FLAG); | 549 | writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_INT_FLAG); |
| 550 | writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_CON); | 550 | writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_CON); |
| 551 | 551 | ||
| 552 | dma_wr_buf = i2c_get_dma_safe_msg_buf(msgs, 0); | 552 | dma_wr_buf = i2c_get_dma_safe_msg_buf(msgs, 1); |
| 553 | if (!dma_wr_buf) | 553 | if (!dma_wr_buf) |
| 554 | return -ENOMEM; | 554 | return -ENOMEM; |
| 555 | 555 | ||
| @@ -561,7 +561,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs, | |||
| 561 | return -ENOMEM; | 561 | return -ENOMEM; |
| 562 | } | 562 | } |
| 563 | 563 | ||
| 564 | dma_rd_buf = i2c_get_dma_safe_msg_buf((msgs + 1), 0); | 564 | dma_rd_buf = i2c_get_dma_safe_msg_buf((msgs + 1), 1); |
| 565 | if (!dma_rd_buf) { | 565 | if (!dma_rd_buf) { |
| 566 | dma_unmap_single(i2c->dev, wpaddr, | 566 | dma_unmap_single(i2c->dev, wpaddr, |
| 567 | msgs->len, DMA_TO_DEVICE); | 567 | msgs->len, DMA_TO_DEVICE); |
