spicc: fix the condition issue of dma [1/1]

PD#SH-1213

Problem:
spicc will not run dma if bits_per_word isn't 64,
though dma mapped by the slave driver.

Solution:
change to run dma once dma mapped

Verify:
axg s400

Change-Id: I8625f973bdd5a2d69831e2c766dd43bc0417e0a5
Signed-off-by: Sunny Luo <sunny.luo@amlogic.com>
This commit is contained in:
Sunny Luo
2019-09-19 19:21:34 +08:00
committed by Tao Zeng
parent bf875eb002
commit a5f97be7ba

View File

@@ -555,9 +555,9 @@ static void meson_spicc_setup_xfer(struct meson_spicc_device *spicc,
meson_spicc_auto_io_delay(spicc);
spicc->using_dma = 0;
if ((xfer->bits_per_word == 64)
&& (spicc->message->is_dma_mapped
|| !meson_spicc_dma_map(spicc, xfer))) {
if (spicc->message->is_dma_mapped ||
((xfer->bits_per_word == 64) &&
!meson_spicc_dma_map(spicc, xfer))) {
spicc->using_dma = 1;
writel_relaxed(xfer->tx_dma, spicc->base + SPICC_DRADDR);
writel_relaxed(xfer->rx_dma, spicc->base + SPICC_DWADDR);
@@ -585,6 +585,9 @@ static int meson_spicc_transfer_one(struct spi_master *master,
spicc->bytes_per_word =
DIV_ROUND_UP(spicc->xfer->bits_per_word, 8);
if (spicc->message->is_dma_mapped)
spicc->bytes_per_word = 8;
if (xfer->len % spicc->bytes_per_word)
return -EINVAL;