MLK-22340-5: ASoC: imx-pcm-rpmsg: enable ignore_suspend for LPA
authorShengjiu Wang <shengjiu.wang@nxp.com>
Mon, 29 Jul 2019 07:02:46 +0000 (15:02 +0800)
committerShengjiu Wang <shengjiu.wang@nxp.com>
Fri, 16 Aug 2019 05:45:06 +0000 (13:45 +0800)
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 <shengjiu.wang@nxp.com>
(cherry picked from commit f83787f252adb7cb0280c43ab0d428c66f9c63f9)

sound/soc/fsl/imx-pcm-rpmsg.c

index c39d368..2d12f97 100644 (file)
@@ -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;