diff --git a/sound/soc/amlogic/auge/spdif.c b/sound/soc/amlogic/auge/spdif.c index b28d920a6e1f..6ba2473b4dba 100644 --- a/sound/soc/amlogic/auge/spdif.c +++ b/sound/soc/amlogic/auge/spdif.c @@ -1175,6 +1175,9 @@ static int aml_dai_spdif_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_PAUSE_PUSH: if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { dev_info(substream->pcm->card->dev, "S/PDIF Playback disable\n"); + memset(substream->runtime->dma_area, + 0, substream->runtime->dma_bytes); + mdelay(3); aml_frddr_enable(p_spdif->fddr, 0); } else { dev_info(substream->pcm->card->dev, "S/PDIF Capture disable\n"); diff --git a/sound/soc/amlogic/auge/tdm.c b/sound/soc/amlogic/auge/tdm.c index 9cefe9264f2c..45d01b1ba6f5 100644 --- a/sound/soc/amlogic/auge/tdm.c +++ b/sound/soc/amlogic/auge/tdm.c @@ -510,16 +510,6 @@ static int aml_dai_tdm_trigger(struct snd_pcm_substream *substream, int cmd, { struct aml_tdm *p_tdm = snd_soc_dai_get_drvdata(cpu_dai); - /* share buffer trigger */ - if ((substream->stream == SNDRV_PCM_STREAM_PLAYBACK) - && p_tdm->chipinfo - && p_tdm->chipinfo->same_src_fn - && (p_tdm->samesource_sel >= 0) - && (aml_check_sharebuffer_valid(p_tdm->fddr, - p_tdm->samesource_sel))) { - sharebuffer_trigger(cmd, p_tdm->samesource_sel); - } - switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: @@ -541,6 +531,14 @@ static int aml_dai_tdm_trigger(struct snd_pcm_substream *substream, int cmd, if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { dev_info(substream->pcm->card->dev, "tdm playback enable\n"); + /* share buffer trigger */ + if (p_tdm->chipinfo + && p_tdm->chipinfo->same_src_fn + && (p_tdm->samesource_sel >= 0) + && (aml_check_sharebuffer_valid(p_tdm->fddr, + p_tdm->samesource_sel))) { + sharebuffer_trigger(cmd, p_tdm->samesource_sel); + } aml_frddr_enable(p_tdm->fddr, 1); } else { dev_info(substream->pcm->card->dev, "tdm capture enable\n"); @@ -561,16 +559,26 @@ static int aml_dai_tdm_trigger(struct snd_pcm_substream *substream, int cmd, break; } - aml_tdm_enable(p_tdm->actrl, - substream->stream, p_tdm->id, false); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { dev_info(substream->pcm->card->dev, "tdm playback stop\n"); + memset(substream->runtime->dma_area, + 0, substream->runtime->dma_bytes); + mdelay(3); aml_frddr_enable(p_tdm->fddr, 0); + /* share buffer trigger */ + if (p_tdm->chipinfo + && p_tdm->chipinfo->same_src_fn + && (p_tdm->samesource_sel >= 0) + && (aml_check_sharebuffer_valid(p_tdm->fddr, + p_tdm->samesource_sel))) { + sharebuffer_trigger(cmd, p_tdm->samesource_sel); + } } else { dev_info(substream->pcm->card->dev, "tdm capture stop\n"); aml_toddr_enable(p_tdm->tddr, 0); } + aml_tdm_enable(p_tdm->actrl, + substream->stream, p_tdm->id, false); break; default: return -EINVAL;