diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2014-04-14 07:41:59 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2014-04-22 12:05:31 -0400 |
commit | 72c7b67affc3ee63fc3df6e4a28d452a4e82e332 (patch) | |
tree | 75be25a35ba848ca36377befdbc3b15cdd1757f4 | |
parent | b2b617de04081931cc10fd862b76b9fcaa9489e2 (diff) |
dmaengine: edma: Add support for DMA_PAUSE/RESUME operation
Pause/Resume can be used by the audio stack when the stream is paused/resumed
The edma platform code has support for this and the legacy audio stack used
this.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Joel Fernandes <joelf@ti.com>
Reviewed-and-Tested-by: Joel Fernandes <joelf@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | drivers/dma/edma.c | 28 |
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 | ||
245 | static 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 | |||
255 | static 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 | |||
245 | static int edma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, | 265 | static 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 | } |