Commit 3c01b0e1 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

ASoC: dapm: Add support for hw_free on CODEC to CODEC links

Currently, on power down for a CODEC to CODEC DAI link we only call
digital_mute and shutdown. Provide a little more flexibility for drivers
by adding a call to hw_free as well.
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9ab2a1bd
...@@ -3737,25 +3737,30 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, ...@@ -3737,25 +3737,30 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
ret = 0; ret = 0;
} }
substream.stream = SNDRV_PCM_STREAM_CAPTURE;
snd_soc_dapm_widget_for_each_source_path(w, path) { snd_soc_dapm_widget_for_each_source_path(w, path) {
source = path->source->priv; source = path->source->priv;
if (source->driver->ops->hw_free)
source->driver->ops->hw_free(&substream,
source);
source->active--; source->active--;
if (source->driver->ops->shutdown) { if (source->driver->ops->shutdown)
substream.stream = SNDRV_PCM_STREAM_CAPTURE;
source->driver->ops->shutdown(&substream, source->driver->ops->shutdown(&substream,
source); source);
}
} }
substream.stream = SNDRV_PCM_STREAM_PLAYBACK;
snd_soc_dapm_widget_for_each_sink_path(w, path) { snd_soc_dapm_widget_for_each_sink_path(w, path) {
sink = path->sink->priv; sink = path->sink->priv;
if (sink->driver->ops->hw_free)
sink->driver->ops->hw_free(&substream, sink);
sink->active--; sink->active--;
if (sink->driver->ops->shutdown) { if (sink->driver->ops->shutdown)
substream.stream = SNDRV_PCM_STREAM_PLAYBACK;
sink->driver->ops->shutdown(&substream, sink); sink->driver->ops->shutdown(&substream, sink);
}
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment