diff options
-rw-r--r-- | drivers/dma/imx-sdma.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index c50305043f15..8707723e36da 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c | |||
@@ -925,10 +925,24 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg( | |||
925 | ret = -EINVAL; | 925 | ret = -EINVAL; |
926 | goto err_out; | 926 | goto err_out; |
927 | } | 927 | } |
928 | if (sdmac->word_size == DMA_SLAVE_BUSWIDTH_4_BYTES) | 928 | |
929 | switch (sdmac->word_size) { | ||
930 | case DMA_SLAVE_BUSWIDTH_4_BYTES: | ||
929 | bd->mode.command = 0; | 931 | bd->mode.command = 0; |
930 | else | 932 | if (count & 3 || sg->dma_address & 3) |
931 | bd->mode.command = sdmac->word_size; | 933 | return NULL; |
934 | break; | ||
935 | case DMA_SLAVE_BUSWIDTH_2_BYTES: | ||
936 | bd->mode.command = 2; | ||
937 | if (count & 1 || sg->dma_address & 1) | ||
938 | return NULL; | ||
939 | break; | ||
940 | case DMA_SLAVE_BUSWIDTH_1_BYTE: | ||
941 | bd->mode.command = 1; | ||
942 | break; | ||
943 | default: | ||
944 | return NULL; | ||
945 | } | ||
932 | 946 | ||
933 | param = BD_DONE | BD_EXTD | BD_CONT; | 947 | param = BD_DONE | BD_EXTD | BD_CONT; |
934 | 948 | ||