From 7bf6d313186390638204d04568254b3fc1fa136b Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Thu, 7 Mar 2019 11:09:17 +0800 Subject: [PATCH] MLK-21107-1: ASoC: Fix timer wake up system after suspend Fixes commit 4028bd0f76fd ("MLK-21002-2: ASoC: imx-pcm-rpmsg: don't remove timer at suspend") if the timer isn't removed at suspend, there will be interrupt from M4 side when the period size is small to wake up system quickly So we need to revert the previous fix and add timer in resume state Signed-off-by: Shengjiu Wang (cherry picked from commit a23d1df081f1ed33bc8dc7fffc42d1dfa3db2366) --- sound/soc/fsl/imx-pcm-rpmsg.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c index ef4e59cfbaa4..f5ef2694ae4f 100644 --- a/sound/soc/fsl/imx-pcm-rpmsg.c +++ b/sound/soc/fsl/imx-pcm-rpmsg.c @@ -534,8 +534,14 @@ int imx_rpmsg_pcm_trigger(struct snd_pcm_substream *substream, int cmd) ret = imx_rpmsg_async_issue_pending(substream); break; case SNDRV_PCM_TRIGGER_RESUME: - if (rpmsg_i2s->force_lpa) + if (rpmsg_i2s->force_lpa) { + int time_msec; + + time_msec = (int)(runtime->period_size*1000/runtime->rate); + mod_timer(&i2s_info->stream_timer[substream->stream], + jiffies + msecs_to_jiffies(time_msec)); break; + } case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ret = imx_rpmsg_restart(substream); break; -- 2.17.1