mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
spi: s3c64xx: Use DMA mode from fifo size
If the SPI data size is smaller than FIFO, it operates in PIO mode,
and if it is larger than FIFO size, it oerates in DMA mode.
If the SPI data size is equal to fifo, it operates in PIO mode and it is
separated to 2 transfers. To prevent it, it must operate in DMA mode
from the case where the data size and the fifo size are the same.
Fixes: 1ee806718d
("spi: s3c64xx: support interrupt based pio mode")
Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Link: https://lore.kernel.org/r/20240329085840.65856-1-jaewon02.kim@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
4cece76496
commit
a3d3eab627
1 changed files with 2 additions and 3 deletions
|
@ -430,7 +430,7 @@ static bool s3c64xx_spi_can_dma(struct spi_controller *host,
|
||||||
struct s3c64xx_spi_driver_data *sdd = spi_controller_get_devdata(host);
|
struct s3c64xx_spi_driver_data *sdd = spi_controller_get_devdata(host);
|
||||||
|
|
||||||
if (sdd->rx_dma.ch && sdd->tx_dma.ch)
|
if (sdd->rx_dma.ch && sdd->tx_dma.ch)
|
||||||
return xfer->len > sdd->fifo_depth;
|
return xfer->len >= sdd->fifo_depth;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -826,10 +826,9 @@ static int s3c64xx_spi_transfer_one(struct spi_controller *host,
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_polling(sdd) && (xfer->len > fifo_len) &&
|
if (!is_polling(sdd) && xfer->len >= fifo_len &&
|
||||||
sdd->rx_dma.ch && sdd->tx_dma.ch) {
|
sdd->rx_dma.ch && sdd->tx_dma.ch) {
|
||||||
use_dma = 1;
|
use_dma = 1;
|
||||||
|
|
||||||
} else if (xfer->len >= fifo_len) {
|
} else if (xfer->len >= fifo_len) {
|
||||||
tx_buf = xfer->tx_buf;
|
tx_buf = xfer->tx_buf;
|
||||||
rx_buf = xfer->rx_buf;
|
rx_buf = xfer->rx_buf;
|
||||||
|
|
Loading…
Reference in a new issue