mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-19 08:29:42 +01:00
ASoC: OMAP: fix OMAP1510 broken PCM pointer callback
This patch tries to work around the problem of broken OMAP1510 PCM playback pointer calculation by replacing DMA function call that incorrectly tries to read the value form DMA hardware with a value computed locally from an already maintained variable omap_runtime_data.period_index. Tested on OMAP5910 based Amstrad Delta (E3) using work in progress ASoC driver. Based on linux-2.6-asoc.git v2.6.31-rc1. Signed-off-by: Janusz Krzysztofik <[email protected]> Acked-by: Jarkko Nikula <[email protected]> Acked-by: Peter Ujfalusi <[email protected]> Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
1 parent
40d9ec14e7
commit
1bdd741991
1 file changed
+7
-4
@@ -216,12 +216,15 @@ static snd_pcm_uframes_t omap_pcm_pointer(struct snd_pcm_substream *substream)
|
||||
dma_addr_t ptr;
|
||||
snd_pcm_uframes_t offset;
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||
ptr = omap_get_dma_src_pos(prtd->dma_ch);
|
||||
else
|
||||
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
|
||||
ptr = omap_get_dma_dst_pos(prtd->dma_ch);
|
||||
offset = bytes_to_frames(runtime, ptr - runtime->dma_addr);
|
||||
} else if (!(cpu_is_omap1510())) {
|
||||
ptr = omap_get_dma_src_pos(prtd->dma_ch);
|
||||
offset = bytes_to_frames(runtime, ptr - runtime->dma_addr);
|
||||
} else
|
||||
offset = prtd->period_index * runtime->period_size;
|
||||
|
||||
offset = bytes_to_frames(runtime, ptr - runtime->dma_addr);
|
||||
if (offset >= runtime->buffer_size)
|
||||
offset = 0;
|
||||
|
||||
|
||||
Reference in new issue
Block a user