Skip to content

Commit

Permalink
ASoC: omap-pcm: Select sDMA synchronization based on packet_size
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed Sep 22, 2012
1 parent dffb360 commit e512589
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sound/soc/omap/omap-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,12 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream)
memset(&dma_params, 0, sizeof(dma_params));
dma_params.data_type = dma_data->data_type;
dma_params.trigger = dma_data->dma_req;
dma_params.sync_mode = dma_data->sync_mode;

if (dma_data->packet_size)
dma_params.sync_mode = OMAP_DMA_SYNC_PACKET;
else
dma_params.sync_mode = OMAP_DMA_SYNC_ELEMENT;

if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
dma_params.src_amode = OMAP_DMA_AMODE_POST_INC;
dma_params.dst_amode = OMAP_DMA_AMODE_CONSTANT;
Expand Down

0 comments on commit e512589

Please sign in to comment.