diff options
Diffstat (limited to 'sound/soc/fsl/imx-pcm-rpmsg.c')
-rw-r--r-- | sound/soc/fsl/imx-pcm-rpmsg.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c index f492e009399d..440f0777e95e 100644 --- a/sound/soc/fsl/imx-pcm-rpmsg.c +++ b/sound/soc/fsl/imx-pcm-rpmsg.c @@ -282,6 +282,7 @@ static void imx_rpmsg_pcm_dma_complete(void *arg) { struct snd_pcm_substream *substream = arg; struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; struct fsl_rpmsg_i2s *rpmsg_i2s = dev_get_drvdata(cpu_dai->dev); struct i2s_info *i2s_info = &rpmsg_i2s->i2s_info; @@ -301,14 +302,20 @@ static void imx_rpmsg_pcm_dma_complete(void *arg) /* * With suspend state, which is not running state, M4 will trigger * system resume with PERIOD_DONE command, at this moment, the - * snd_pcm_period_elapsed can't update the hw ptr. so call - * snd_pcm_update_hw_ptr directly for this special case. + * snd_pcm_period_elapsed can't update the hw ptr. so change the + * state to be running and update timer * */ - if (!snd_pcm_running(substream) && rpmsg_i2s->force_lpa) - snd_pcm_update_hw_ptr(substream); - else - snd_pcm_period_elapsed(substream); + if (!snd_pcm_running(substream) && rpmsg_i2s->force_lpa) { + int time_msec; + + substream->runtime->status->state = SNDRV_PCM_STATE_RUNNING; + time_msec = min(500, + (int)(runtime->period_size*1000/runtime->rate)); + mod_timer(&i2s_info->stream_timer[substream->stream], + jiffies + msecs_to_jiffies(time_msec)); + } + snd_pcm_period_elapsed(substream); } static int imx_rpmsg_pcm_prepare_and_submit(struct snd_pcm_substream *substream) @@ -491,7 +498,6 @@ int imx_rpmsg_pcm_trigger(struct snd_pcm_substream *substream, int cmd) struct fsl_rpmsg_i2s *rpmsg_i2s = dev_get_drvdata(cpu_dai->dev); struct i2s_info *i2s_info = &rpmsg_i2s->i2s_info; int ret; - int time_msec; switch (cmd) { case SNDRV_PCM_TRIGGER_START: @@ -501,13 +507,8 @@ int imx_rpmsg_pcm_trigger(struct snd_pcm_substream *substream, int cmd) imx_rpmsg_async_issue_pending(substream); break; case SNDRV_PCM_TRIGGER_RESUME: - if (rpmsg_i2s->force_lpa) { - time_msec = min(500, - (int)(runtime->period_size*1000/runtime->rate)); - mod_timer(&i2s_info->stream_timer[substream->stream], - jiffies + msecs_to_jiffies(time_msec)); + if (rpmsg_i2s->force_lpa) break; - } case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: imx_rpmsg_restart(substream); break; |