aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorM'boumba Cedric Madianga <cedric.madianga@gmail.com>2016-12-13 08:40:50 -0500
committerVinod Koul <vinod.koul@intel.com>2017-01-02 22:53:23 -0500
commitdc808675104b920f2be1ac4bf1e9aa57680f0699 (patch)
treea73040332886eeaa490a3b7d9f9fc8f8998fe0b2
parent2b12c5580e0a4c0ffd513d1522dd39b2464fb207 (diff)
dmaengine: stm32-dma: Add synchronization support
Implement the new device_synchronize() callback to allow proper synchronization when stopping a channel. Signed-off-by: M'boumba Cedric Madianga <cedric.madianga@gmail.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/stm32-dma.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
index 8a29b028d39e..53b2ee79cc0e 100644
--- a/drivers/dma/stm32-dma.c
+++ b/drivers/dma/stm32-dma.c
@@ -403,6 +403,13 @@ static int stm32_dma_terminate_all(struct dma_chan *c)
403 return 0; 403 return 0;
404} 404}
405 405
406static void stm32_dma_synchronize(struct dma_chan *c)
407{
408 struct stm32_dma_chan *chan = to_stm32_dma_chan(c);
409
410 vchan_synchronize(&chan->vchan);
411}
412
406static void stm32_dma_dump_reg(struct stm32_dma_chan *chan) 413static void stm32_dma_dump_reg(struct stm32_dma_chan *chan)
407{ 414{
408 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); 415 struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan);
@@ -1066,6 +1073,7 @@ static int stm32_dma_probe(struct platform_device *pdev)
1066 dd->device_prep_dma_cyclic = stm32_dma_prep_dma_cyclic; 1073 dd->device_prep_dma_cyclic = stm32_dma_prep_dma_cyclic;
1067 dd->device_config = stm32_dma_slave_config; 1074 dd->device_config = stm32_dma_slave_config;
1068 dd->device_terminate_all = stm32_dma_terminate_all; 1075 dd->device_terminate_all = stm32_dma_terminate_all;
1076 dd->device_synchronize = stm32_dma_synchronize;
1069 dd->src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | 1077 dd->src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) |
1070 BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | 1078 BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) |
1071 BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); 1079 BIT(DMA_SLAVE_BUSWIDTH_4_BYTES);