mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/6] ASoC: AMD: Always stop ch2 first
@ 2018-07-02 21:19 Daniel Kurtz
  2018-07-02 21:19 ` [PATCH 2/6] ASoC: AMD: Reset bytescount when starting transaction Daniel Kurtz
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Daniel Kurtz @ 2018-07-02 21:19 UTC (permalink / raw)
  Cc: Daniel Kurtz, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Mukunda, Vijendar, Alex Deucher, Akshu Agrawal,
	Guenter Roeck,
	moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...,
	open list

Commit 6b116dfb4633a ("ASoC: AMD: make channel 1 dma as circular") made
both channels circular, so this comment and logic no longer applies.  Always
stop ch2 (the channel closest to the output) before ch1.  This ensures
that the downstream circular DMA channel does not continue to play/capture
repeated samples after the upstream circular DMA channel has already
stopped.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
---
 sound/soc/amd/acp-pcm-dma.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index 3c3d398d0d0b1..4665ae12e74e4 100644
--- a/sound/soc/amd/acp-pcm-dma.c
+++ b/sound/soc/amd/acp-pcm-dma.c
@@ -1067,21 +1067,8 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd)
 	case SNDRV_PCM_TRIGGER_STOP:
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
 	case SNDRV_PCM_TRIGGER_SUSPEND:
-		/* For playback, non circular dma should be stopped first
-		 * i.e Sysram to acp dma transfer channel(rtd->ch1) should be
-		 * stopped before stopping cirular dma which is acp sram to i2s
-		 * fifo dma transfer channel(rtd->ch2). Where as in Capture
-		 * scenario, i2s fifo to acp sram dma channel(rtd->ch2) stopped
-		 * first before stopping acp sram to sysram which is circular
-		 * dma(rtd->ch1).
-		 */
-		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-			acp_dma_stop(rtd->acp_mmio, rtd->ch1);
-			ret =  acp_dma_stop(rtd->acp_mmio, rtd->ch2);
-		} else {
-			acp_dma_stop(rtd->acp_mmio, rtd->ch2);
-			ret = acp_dma_stop(rtd->acp_mmio, rtd->ch1);
-		}
+		acp_dma_stop(rtd->acp_mmio, rtd->ch2);
+		ret = acp_dma_stop(rtd->acp_mmio, rtd->ch1);
 		rtd->bytescount = 0;
 		break;
 	default:
-- 
2.18.0.399.gad0ab374a1-goog


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-07-03 15:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-02 21:19 [PATCH 1/6] ASoC: AMD: Always stop ch2 first Daniel Kurtz
2018-07-02 21:19 ` [PATCH 2/6] ASoC: AMD: Reset bytescount when starting transaction Daniel Kurtz
2018-07-03 15:34   ` Applied "ASoC: AMD: Reset bytescount when starting transaction" to the asoc tree Mark Brown
2018-07-02 21:19 ` [PATCH 3/6] ASoC: AMD: Always subtract bytescount Daniel Kurtz
2018-07-03 15:34   ` Applied "ASoC: AMD: Always subtract bytescount" to the asoc tree Mark Brown
2018-07-02 21:19 ` [PATCH 4/6] ASoC: AMD: Fix Capture DMA channel names Daniel Kurtz
2018-07-03 15:34   ` Applied "ASoC: AMD: Fix Capture DMA channel names" to the asoc tree Mark Brown
2018-07-02 21:19 ` [PATCH 5/6] ASoC: AMD: Do not generate interrups for every captured sample Daniel Kurtz
2018-07-03 15:34   ` Applied "ASoC: AMD: Do not generate interrups for every captured sample" to the asoc tree Mark Brown
2018-07-02 21:19 ` [PATCH 6/6] ASoC: AMD: Simplify trigger handler Daniel Kurtz
2018-07-03 15:34   ` Applied "ASoC: AMD: Simplify trigger handler" to the asoc tree Mark Brown
2018-07-03 15:34 ` Applied "ASoC: AMD: Always stop ch2 first" " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®