diff options
| author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-09-24 03:58:04 -0400 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2012-09-24 12:35:29 -0400 |
| commit | e7736cdea223f3a5b867c359fb35cf08250dd771 (patch) | |
| tree | 9ec9873c35e67cd5389202cddc3157ca06e631f3 | |
| parent | 9d069dc00b02b886abe3cab5e369140f7cd78965 (diff) | |
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: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
| -rw-r--r-- | include/linux/dmaengine.h | 3 | ||||
| -rw-r--r-- | sound/soc/soc-dmaengine-pcm.c | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 09da4e565297..d3201e438d16 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -653,7 +653,8 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_rio_sg( | |||
| 653 | 653 | ||
| 654 | static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic( | 654 | static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic( |
| 655 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, | 655 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, |
| 656 | size_t period_len, enum dma_transfer_direction dir) | 656 | size_t period_len, enum dma_transfer_direction dir, |
| 657 | unsigned long flags) | ||
| 657 | { | 658 | { |
| 658 | return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len, | 659 | return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len, |
| 659 | period_len, dir, flags, NULL); | 660 | period_len, dir, flags, NULL); |
diff --git a/sound/soc/soc-dmaengine-pcm.c b/sound/soc/soc-dmaengine-pcm.c index 5df529eda251..bbc125748a38 100644 --- a/sound/soc/soc-dmaengine-pcm.c +++ b/sound/soc/soc-dmaengine-pcm.c | |||
| @@ -140,14 +140,18 @@ static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream *substream) | |||
| 140 | struct dma_chan *chan = prtd->dma_chan; | 140 | struct dma_chan *chan = prtd->dma_chan; |
| 141 | struct dma_async_tx_descriptor *desc; | 141 | struct dma_async_tx_descriptor *desc; |
| 142 | enum dma_transfer_direction direction; | 142 | enum dma_transfer_direction direction; |
| 143 | unsigned long flags = DMA_CTRL_ACK; | ||
| 143 | 144 | ||
| 144 | direction = snd_pcm_substream_to_dma_direction(substream); | 145 | direction = snd_pcm_substream_to_dma_direction(substream); |
| 145 | 146 | ||
| 147 | if (!substream->runtime->no_period_wakeup) | ||
| 148 | flags |= DMA_PREP_INTERRUPT; | ||
| 149 | |||
| 146 | prtd->pos = 0; | 150 | prtd->pos = 0; |
| 147 | desc = dmaengine_prep_dma_cyclic(chan, | 151 | desc = dmaengine_prep_dma_cyclic(chan, |
| 148 | substream->runtime->dma_addr, | 152 | substream->runtime->dma_addr, |
| 149 | snd_pcm_lib_buffer_bytes(substream), | 153 | snd_pcm_lib_buffer_bytes(substream), |
| 150 | snd_pcm_lib_period_bytes(substream), direction); | 154 | snd_pcm_lib_period_bytes(substream), direction, flags); |
| 151 | 155 | ||
| 152 | if (!desc) | 156 | if (!desc) |
| 153 | return -ENOMEM; | 157 | return -ENOMEM; |
