Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72a5f889 authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: pcm: Update RX shutdown sequence



Update RX shutdown sequence so that codec
path gets tear down first followed by cpu dai.
This will avoid slim port underflow/overflows
when slim data protocol is changed.

Change-Id: I6e3582fa010d18d4e0ccfde319dfc4d81af1351f
Signed-off-by: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: default avatarMeng Wang <mwang@codeaurora.org>
parent 5855f684
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -713,6 +713,20 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)

	snd_soc_dai_digital_mute(cpu_dai, 1, substream->stream);

	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
		if (snd_soc_runtime_ignore_pmdown_time(rtd)) {
			/* powered down playback stream now */
			snd_soc_dapm_stream_event(rtd,
						  SNDRV_PCM_STREAM_PLAYBACK,
						  SND_SOC_DAPM_STREAM_STOP);
		} else {
			/* start delayed pop wq here for playback streams */
			rtd->pop_wait = 1;
			queue_delayed_work(system_power_efficient_wq,
					   &rtd->delayed_work,
					   msecs_to_jiffies(rtd->pmdown_time));
		}
	}
	if (cpu_dai->driver->ops->shutdown)
		cpu_dai->driver->ops->shutdown(substream, cpu_dai);

@@ -728,20 +742,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
	if (platform->driver->ops && platform->driver->ops->close)
		platform->driver->ops->close(substream);

	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
		if (snd_soc_runtime_ignore_pmdown_time(rtd)) {
			/* powered down playback stream now */
			snd_soc_dapm_stream_event(rtd,
						  SNDRV_PCM_STREAM_PLAYBACK,
						  SND_SOC_DAPM_STREAM_STOP);
		} else {
			/* start delayed pop wq here for playback streams */
			rtd->pop_wait = 1;
			queue_delayed_work(system_power_efficient_wq,
					   &rtd->delayed_work,
					   msecs_to_jiffies(rtd->pmdown_time));
		}
	} else {
	if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) {
		/* capture streams can be powered down now */
		snd_soc_dapm_stream_event(rtd, SNDRV_PCM_STREAM_CAPTURE,
					  SND_SOC_DAPM_STREAM_STOP);