diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-09-14 08:05:50 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-22 11:12:57 -0400 |
commit | e512589c17572e7498693a3e05eefa44e622f62b (patch) | |
tree | dd09673eda46ed03dbb4cf00394789e5a45852b4 /sound/soc/omap/omap-pcm.c | |
parent | dffb360e64968b95a0a0221ca52234a28cc049c9 (diff) |
ASoC: omap-pcm: Select sDMA synchronization based on packet_size
Since we only have element or packet synchronization we can use the
dma_data->packet_size to select the desired mode:
if packet_size is 0 we use ELEMENT mode
if packet_size is not 0 we use PACKET mode for sDMA synchronization.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/omap/omap-pcm.c')
-rw-r--r-- | sound/soc/omap/omap-pcm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index f0feb06615f8..02eeb2e7ceda 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c | |||
@@ -165,7 +165,12 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream) | |||
165 | memset(&dma_params, 0, sizeof(dma_params)); | 165 | memset(&dma_params, 0, sizeof(dma_params)); |
166 | dma_params.data_type = dma_data->data_type; | 166 | dma_params.data_type = dma_data->data_type; |
167 | dma_params.trigger = dma_data->dma_req; | 167 | dma_params.trigger = dma_data->dma_req; |
168 | dma_params.sync_mode = dma_data->sync_mode; | 168 | |
169 | if (dma_data->packet_size) | ||
170 | dma_params.sync_mode = OMAP_DMA_SYNC_PACKET; | ||
171 | else | ||
172 | dma_params.sync_mode = OMAP_DMA_SYNC_ELEMENT; | ||
173 | |||
169 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 174 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
170 | dma_params.src_amode = OMAP_DMA_AMODE_POST_INC; | 175 | dma_params.src_amode = OMAP_DMA_AMODE_POST_INC; |
171 | dma_params.dst_amode = OMAP_DMA_AMODE_CONSTANT; | 176 | dma_params.dst_amode = OMAP_DMA_AMODE_CONSTANT; |