From 5d0d4e1558fa0c235691436e1c5d26d9c8950775 Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Tue, 25 Mar 2014 11:46:35 +0800 Subject: [PATCH] ENGR00305624-2 ASoC: imx-hdmi-dma: Correct the appl pointer We might not be able to get appl_ptr, so we estimated it by using hw_ptr, while the distance between then should not be 2 * priv->period_bytes initially but 8 * priv->period_bytes as we pri-filled one entire buffer size at the beginning. The driver's memory access might be overlapped with ALSA's buffer updating. So this patch fixes this inaccurate distance. Acked-by: Wang Shengjiu Signed-off-by: Nicolin Chen --- sound/soc/fsl/imx-hdmi-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/fsl/imx-hdmi-dma.c b/sound/soc/fsl/imx-hdmi-dma.c index 8f3e79845fa6..d0e907a07790 100644 --- a/sound/soc/fsl/imx-hdmi-dma.c +++ b/sound/soc/fsl/imx-hdmi-dma.c @@ -447,7 +447,7 @@ static void hdmi_dma_data_copy(struct snd_pcm_substream *substream, appl_bytes = frames_to_bytes(runtime, runtime->status->hw_ptr); if (type == 'p') - appl_bytes += 2 * priv->period_bytes; + appl_bytes += 8 * priv->period_bytes; offset = appl_bytes % priv->buffer_bytes; switch (type) { -- 2.39.2