Unverified Commit 45eb8666 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: soc-dapm: use snd_soc_dai_activate()/deactivate()



soc-dapm.c :: snd_soc_dai_link_event_pre_pmu() / snd_soc_dai_link_event()
are directly updating dai->active without caring about
stream_active / component->active.
It is breaking xxx_active count balance.
This patch uses snd_soc_dai_action() for it.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/878shu6n4n.wl-kuninori.morimoto.gx@renesas.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent dc829106
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -3835,7 +3835,7 @@ snd_soc_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w,
				"ASoC: startup() failed: %d\n", ret);
			goto out;
		}
		source->active++;
		snd_soc_dai_activate(source, substream->stream);
	}

	substream->stream = SNDRV_PCM_STREAM_PLAYBACK;
@@ -3848,7 +3848,7 @@ snd_soc_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w,
				"ASoC: startup() failed: %d\n", ret);
			goto out;
		}
		sink->active++;
		snd_soc_dai_activate(sink, substream->stream);
	}

	substream->hw_opened = 1;
@@ -3978,14 +3978,14 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
		substream->stream = SNDRV_PCM_STREAM_CAPTURE;
		snd_soc_dapm_widget_for_each_source_path(w, path) {
			source = path->source->priv;
			source->active--;
			snd_soc_dai_deactivate(source, substream->stream);
			snd_soc_dai_shutdown(source, substream);
		}

		substream->stream = SNDRV_PCM_STREAM_PLAYBACK;
		snd_soc_dapm_widget_for_each_sink_path(w, path) {
			sink = path->sink->priv;
			sink->active--;
			snd_soc_dai_deactivate(sink, substream->stream);
			snd_soc_dai_shutdown(sink, substream);
		}
		break;