aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dma/intel_mid_dma.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
index 41941d05bfb9..0c0feb8834d0 100644
--- a/drivers/dma/intel_mid_dma.c
+++ b/drivers/dma/intel_mid_dma.c
@@ -664,11 +664,20 @@ static struct dma_async_tx_descriptor *intel_mid_dma_prep_memcpy(
664 /*calculate CTL_LO*/ 664 /*calculate CTL_LO*/
665 ctl_lo.ctl_lo = 0; 665 ctl_lo.ctl_lo = 0;
666 ctl_lo.ctlx.int_en = 1; 666 ctl_lo.ctlx.int_en = 1;
667 ctl_lo.ctlx.dst_tr_width = mids->dma_slave.dst_addr_width;
668 ctl_lo.ctlx.src_tr_width = mids->dma_slave.src_addr_width;
669 ctl_lo.ctlx.dst_msize = mids->dma_slave.src_maxburst; 667 ctl_lo.ctlx.dst_msize = mids->dma_slave.src_maxburst;
670 ctl_lo.ctlx.src_msize = mids->dma_slave.dst_maxburst; 668 ctl_lo.ctlx.src_msize = mids->dma_slave.dst_maxburst;
671 669
670 /*
671 * Here we need some translation from "enum dma_slave_buswidth"
672 * to the format for our dma controller
673 * standard intel_mid_dmac's format
674 * 1 Byte 0b000
675 * 2 Bytes 0b001
676 * 4 Bytes 0b010
677 */
678 ctl_lo.ctlx.dst_tr_width = mids->dma_slave.dst_addr_width / 2;
679 ctl_lo.ctlx.src_tr_width = mids->dma_slave.src_addr_width / 2;
680
672 if (mids->cfg_mode == LNW_DMA_MEM_TO_MEM) { 681 if (mids->cfg_mode == LNW_DMA_MEM_TO_MEM) {
673 ctl_lo.ctlx.tt_fc = 0; 682 ctl_lo.ctlx.tt_fc = 0;
674 ctl_lo.ctlx.sinc = 0; 683 ctl_lo.ctlx.sinc = 0;
@@ -746,8 +755,18 @@ static struct dma_async_tx_descriptor *intel_mid_dma_prep_slave_sg(
746 BUG_ON(!mids); 755 BUG_ON(!mids);
747 756
748 if (!midc->dma->pimr_mask) { 757 if (!midc->dma->pimr_mask) {
749 pr_debug("MDMA: SG list is not supported by this controller\n"); 758 /* We can still handle sg list with only one item */
750 return NULL; 759 if (sg_len == 1) {
760 txd = intel_mid_dma_prep_memcpy(chan,
761 mids->dma_slave.dst_addr,
762 mids->dma_slave.src_addr,
763 sgl->length,
764 flags);
765 return txd;
766 } else {
767 pr_warn("MDMA: SG list is not supported by this controller\n");
768 return NULL;
769 }
751 } 770 }
752 771
753 pr_debug("MDMA: SG Length = %d, direction = %d, Flags = %#lx\n", 772 pr_debug("MDMA: SG Length = %d, direction = %d, Flags = %#lx\n",
@@ -758,6 +777,7 @@ static struct dma_async_tx_descriptor *intel_mid_dma_prep_slave_sg(
758 pr_err("MDMA: Prep memcpy failed\n"); 777 pr_err("MDMA: Prep memcpy failed\n");
759 return NULL; 778 return NULL;
760 } 779 }
780
761 desc = to_intel_mid_dma_desc(txd); 781 desc = to_intel_mid_dma_desc(txd);
762 desc->dirn = direction; 782 desc->dirn = direction;
763 ctl_lo.ctl_lo = desc->ctl_lo; 783 ctl_lo.ctl_lo = desc->ctl_lo;