Commit e7736cde authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Takashi Iwai

dmaengine: Add flags parameter to dmaengine_prep_dma_cyclic()

With this parameter added to dmaengine_prep_dma_cyclic() the API will be in
sync with other dmaengine_prep_*() functions.
The dmaengine_prep_dma_cyclic() function primarily used by audio for cyclic
transfer required by ALSA, we use the from audio to ask dma drivers to
suppress interrupts (if DMA_PREP_INTERRUPT is cleared) when it is supported
on the platform.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
CC: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarVinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 9d069dc0
...@@ -653,7 +653,8 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_rio_sg( ...@@ -653,7 +653,8 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_rio_sg(
static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic( static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic(
struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
size_t period_len, enum dma_transfer_direction dir) size_t period_len, enum dma_transfer_direction dir,
unsigned long flags)
{ {
return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len, return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len,
period_len, dir, flags, NULL); period_len, dir, flags, NULL);
......
...@@ -140,14 +140,18 @@ static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream *substream) ...@@ -140,14 +140,18 @@ static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream *substream)
struct dma_chan *chan = prtd->dma_chan; struct dma_chan *chan = prtd->dma_chan;
struct dma_async_tx_descriptor *desc; struct dma_async_tx_descriptor *desc;
enum dma_transfer_direction direction; enum dma_transfer_direction direction;
unsigned long flags = DMA_CTRL_ACK;
direction = snd_pcm_substream_to_dma_direction(substream); direction = snd_pcm_substream_to_dma_direction(substream);
if (!substream->runtime->no_period_wakeup)
flags |= DMA_PREP_INTERRUPT;
prtd->pos = 0; prtd->pos = 0;
desc = dmaengine_prep_dma_cyclic(chan, desc = dmaengine_prep_dma_cyclic(chan,
substream->runtime->dma_addr, substream->runtime->dma_addr,
snd_pcm_lib_buffer_bytes(substream), snd_pcm_lib_buffer_bytes(substream),
snd_pcm_lib_period_bytes(substream), direction); snd_pcm_lib_period_bytes(substream), direction, flags);
if (!desc) if (!desc)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment