From: Shengjiu Wang Date: Mon, 29 Jul 2019 07:02:46 +0000 (+0800) Subject: MLK-22340-5: ASoC: imx-pcm-rpmsg: enable ignore_suspend for LPA X-Git-Tag: rel_imx_4.19.35_1.1.0~116 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=31d5dfa44c209c778ba2bfaed82f552118554af5;p=linux.git MLK-22340-5: ASoC: imx-pcm-rpmsg: enable ignore_suspend for LPA In LPA drain state, if runtime->status->state is SUSPEND, after resume, ALSA would exit drain mode directly, that cause some data in end of song is missed. This patch is to enable ignore_suspend flags that the runtime->status->state will be not in SUSPEND always. Signed-off-by: Shengjiu Wang (cherry picked from commit f83787f252adb7cb0280c43ab0d428c66f9c63f9) --- diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c index c39d368afe75..2d12f97ab526 100644 --- a/sound/soc/fsl/imx-pcm-rpmsg.c +++ b/sound/soc/fsl/imx-pcm-rpmsg.c @@ -245,6 +245,8 @@ static int imx_rpmsg_pcm_close(struct snd_pcm_substream *substream) kfree(prtd); + rtd->dai_link->ignore_suspend = 0; + if (i2s_info->msg_drop_count[substream->stream]) dev_warn(rtd->dev, "Msg is dropped!, number is %d\n", i2s_info->msg_drop_count[substream->stream]); @@ -265,9 +267,10 @@ static int imx_rpmsg_pcm_prepare(struct snd_pcm_substream *substream) if ((runtime->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED || runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) && rpmsg_i2s->version == 2 && - rpmsg_i2s->enable_lpa) + rpmsg_i2s->enable_lpa) { + rtd->dai_link->ignore_suspend = 1; rpmsg_i2s->force_lpa = 1; - else + } else rpmsg_i2s->force_lpa = 0; return 0;