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>
This commit is contained in:
parent
b2b617de04
commit
72c7b67aff
|
@ -242,6 +242,26 @@ static int edma_slave_config(struct edma_chan *echan,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int edma_dma_pause(struct edma_chan *echan)
|
||||||
|
{
|
||||||
|
/* Pause/Resume only allowed with cyclic mode */
|
||||||
|
if (!echan->edesc->cyclic)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
edma_pause(echan->ch_num);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int edma_dma_resume(struct edma_chan *echan)
|
||||||
|
{
|
||||||
|
/* Pause/Resume only allowed with cyclic mode */
|
||||||
|
if (!echan->edesc->cyclic)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
edma_resume(echan->ch_num);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int edma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
|
static int edma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
|
||||||
unsigned long arg)
|
unsigned long arg)
|
||||||
{
|
{
|
||||||
|
@ -257,6 +277,14 @@ static int edma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
|
||||||
config = (struct dma_slave_config *)arg;
|
config = (struct dma_slave_config *)arg;
|
||||||
ret = edma_slave_config(echan, config);
|
ret = edma_slave_config(echan, config);
|
||||||
break;
|
break;
|
||||||
|
case DMA_PAUSE:
|
||||||
|
ret = edma_dma_pause(echan);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DMA_RESUME:
|
||||||
|
ret = edma_dma_resume(echan);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ret = -ENOSYS;
|
ret = -ENOSYS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue