mirror of https://gitee.com/openkylin/linux.git
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: fc66b39fe3
("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>
This commit is contained in:
parent
ea295481b6
commit
bc1a7f75c8
|
@ -503,7 +503,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs,
|
|||
writel(I2C_DMA_INT_FLAG_NONE, i2c->pdmabase + OFFSET_INT_FLAG);
|
||||
writel(I2C_DMA_CON_RX, i2c->pdmabase + OFFSET_CON);
|
||||
|
||||
dma_rd_buf = i2c_get_dma_safe_msg_buf(msgs, 0);
|
||||
dma_rd_buf = i2c_get_dma_safe_msg_buf(msgs, 1);
|
||||
if (!dma_rd_buf)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -526,7 +526,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs,
|
|||
writel(I2C_DMA_INT_FLAG_NONE, i2c->pdmabase + OFFSET_INT_FLAG);
|
||||
writel(I2C_DMA_CON_TX, i2c->pdmabase + OFFSET_CON);
|
||||
|
||||
dma_wr_buf = i2c_get_dma_safe_msg_buf(msgs, 0);
|
||||
dma_wr_buf = i2c_get_dma_safe_msg_buf(msgs, 1);
|
||||
if (!dma_wr_buf)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -549,7 +549,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs,
|
|||
writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_INT_FLAG);
|
||||
writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_CON);
|
||||
|
||||
dma_wr_buf = i2c_get_dma_safe_msg_buf(msgs, 0);
|
||||
dma_wr_buf = i2c_get_dma_safe_msg_buf(msgs, 1);
|
||||
if (!dma_wr_buf)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -561,7 +561,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs,
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
dma_rd_buf = i2c_get_dma_safe_msg_buf((msgs + 1), 0);
|
||||
dma_rd_buf = i2c_get_dma_safe_msg_buf((msgs + 1), 1);
|
||||
if (!dma_rd_buf) {
|
||||
dma_unmap_single(i2c->dev, wpaddr,
|
||||
msgs->len, DMA_TO_DEVICE);
|
||||
|
|
Loading…
Reference in New Issue