diff options
Diffstat (limited to 'drivers/dma/xilinx/xilinx_vdma.c')
-rw-r--r-- | drivers/dma/xilinx/xilinx_vdma.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/dma/xilinx/xilinx_vdma.c b/drivers/dma/xilinx/xilinx_vdma.c index a6e64767186e..4a3a8f3137b3 100644 --- a/drivers/dma/xilinx/xilinx_vdma.c +++ b/drivers/dma/xilinx/xilinx_vdma.c | |||
@@ -942,6 +942,9 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan *dchan, | |||
942 | if (!xt->numf || !xt->sgl[0].size) | 942 | if (!xt->numf || !xt->sgl[0].size) |
943 | return NULL; | 943 | return NULL; |
944 | 944 | ||
945 | if (xt->frame_size != 1) | ||
946 | return NULL; | ||
947 | |||
945 | /* Allocate a transaction descriptor. */ | 948 | /* Allocate a transaction descriptor. */ |
946 | desc = xilinx_vdma_alloc_tx_descriptor(chan); | 949 | desc = xilinx_vdma_alloc_tx_descriptor(chan); |
947 | if (!desc) | 950 | if (!desc) |
@@ -960,7 +963,7 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan *dchan, | |||
960 | hw = &segment->hw; | 963 | hw = &segment->hw; |
961 | hw->vsize = xt->numf; | 964 | hw->vsize = xt->numf; |
962 | hw->hsize = xt->sgl[0].size; | 965 | hw->hsize = xt->sgl[0].size; |
963 | hw->stride = xt->sgl[0].icg << | 966 | hw->stride = (xt->sgl[0].icg + xt->sgl[0].size) << |
964 | XILINX_VDMA_FRMDLY_STRIDE_STRIDE_SHIFT; | 967 | XILINX_VDMA_FRMDLY_STRIDE_STRIDE_SHIFT; |
965 | hw->stride |= chan->config.frm_dly << | 968 | hw->stride |= chan->config.frm_dly << |
966 | XILINX_VDMA_FRMDLY_STRIDE_FRMDLY_SHIFT; | 969 | XILINX_VDMA_FRMDLY_STRIDE_FRMDLY_SHIFT; |
@@ -971,9 +974,11 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan *dchan, | |||
971 | hw->buf_addr = xt->src_start; | 974 | hw->buf_addr = xt->src_start; |
972 | 975 | ||
973 | /* Link the previous next descriptor to current */ | 976 | /* Link the previous next descriptor to current */ |
974 | prev = list_last_entry(&desc->segments, | 977 | if (!list_empty(&desc->segments)) { |
975 | struct xilinx_vdma_tx_segment, node); | 978 | prev = list_last_entry(&desc->segments, |
976 | prev->hw.next_desc = segment->phys; | 979 | struct xilinx_vdma_tx_segment, node); |
980 | prev->hw.next_desc = segment->phys; | ||
981 | } | ||
977 | 982 | ||
978 | /* Insert the segment into the descriptor segments list. */ | 983 | /* Insert the segment into the descriptor segments list. */ |
979 | list_add_tail(&segment->node, &desc->segments); | 984 | list_add_tail(&segment->node, &desc->segments); |