aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/shdma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/shdma.c')
-rw-r--r--drivers/dma/shdma.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c
index 5d17e09cb625..ce28c1e22825 100644
--- a/drivers/dma/shdma.c
+++ b/drivers/dma/shdma.c
@@ -580,12 +580,16 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg(
580 direction, flags); 580 direction, flags);
581} 581}
582 582
583static void sh_dmae_terminate_all(struct dma_chan *chan) 583static int sh_dmae_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd)
584{ 584{
585 struct sh_dmae_chan *sh_chan = to_sh_chan(chan); 585 struct sh_dmae_chan *sh_chan = to_sh_chan(chan);
586 586
587 /* Only supports DMA_TERMINATE_ALL */
588 if (cmd != DMA_TERMINATE_ALL)
589 return -ENXIO;
590
587 if (!chan) 591 if (!chan)
588 return; 592 return -EINVAL;
589 593
590 dmae_halt(sh_chan); 594 dmae_halt(sh_chan);
591 595
@@ -601,6 +605,8 @@ static void sh_dmae_terminate_all(struct dma_chan *chan)
601 spin_unlock_bh(&sh_chan->desc_lock); 605 spin_unlock_bh(&sh_chan->desc_lock);
602 606
603 sh_dmae_chan_ld_cleanup(sh_chan, true); 607 sh_dmae_chan_ld_cleanup(sh_chan, true);
608
609 return 0;
604} 610}
605 611
606static dma_async_tx_callback __ld_cleanup(struct sh_dmae_chan *sh_chan, bool all) 612static dma_async_tx_callback __ld_cleanup(struct sh_dmae_chan *sh_chan, bool all)
@@ -1029,7 +1035,7 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
1029 1035
1030 /* Compulsory for DMA_SLAVE fields */ 1036 /* Compulsory for DMA_SLAVE fields */
1031 shdev->common.device_prep_slave_sg = sh_dmae_prep_slave_sg; 1037 shdev->common.device_prep_slave_sg = sh_dmae_prep_slave_sg;
1032 shdev->common.device_terminate_all = sh_dmae_terminate_all; 1038 shdev->common.device_control = sh_dmae_control;
1033 1039
1034 shdev->common.dev = &pdev->dev; 1040 shdev->common.dev = &pdev->dev;
1035 /* Default transfer size of 32 bytes requires 32-byte alignment */ 1041 /* Default transfer size of 32 bytes requires 32-byte alignment */