aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/edma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/edma.c')
-rw-r--r--drivers/dma/edma.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index d7649d229755..35db3f282bdb 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -242,6 +242,26 @@ static int edma_slave_config(struct edma_chan *echan,
242 return 0; 242 return 0;
243} 243}
244 244
245static int edma_dma_pause(struct edma_chan *echan)
246{
247 /* Pause/Resume only allowed with cyclic mode */
248 if (!echan->edesc->cyclic)
249 return -EINVAL;
250
251 edma_pause(echan->ch_num);
252 return 0;
253}
254
255static int edma_dma_resume(struct edma_chan *echan)
256{
257 /* Pause/Resume only allowed with cyclic mode */
258 if (!echan->edesc->cyclic)
259 return -EINVAL;
260
261 edma_resume(echan->ch_num);
262 return 0;
263}
264
245static int edma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, 265static int edma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
246 unsigned long arg) 266 unsigned long arg)
247{ 267{
@@ -257,6 +277,14 @@ static int edma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
257 config = (struct dma_slave_config *)arg; 277 config = (struct dma_slave_config *)arg;
258 ret = edma_slave_config(echan, config); 278 ret = edma_slave_config(echan, config);
259 break; 279 break;
280 case DMA_PAUSE:
281 ret = edma_dma_pause(echan);
282 break;
283
284 case DMA_RESUME:
285 ret = edma_dma_resume(echan);
286 break;
287
260 default: 288 default:
261 ret = -ENOSYS; 289 ret = -ENOSYS;
262 } 290 }