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

Commit f7ba041b authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati
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>
parent fbac7bcc
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -680,6 +680,20 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
			codec_dai->rate = 0;
	}

	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);

@@ -695,20 +709,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);