summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2018-10-11 19:28:28 +0300
committerMark Brown <broonie@kernel.org>2018-10-19 15:08:27 +0300
commit3c01b0e129e9486c8004e43eba3a70de7393f645 (patch)
treef8d61ad9d2ec3a754f912a1b1371a59d6f793be8 /sound
parent9ab2a1bd81f7eaef4b496168dd93e0f23e8906fe (diff)
downloadlinux-3c01b0e129e9486c8004e43eba3a70de7393f645.tar.xz
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: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-dapm.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 8c5b065c8880..a5178845065b 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3737,25 +3737,30 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
ret = 0;
}
+ substream.stream = SNDRV_PCM_STREAM_CAPTURE;
snd_soc_dapm_widget_for_each_source_path(w, path) {
source = path->source->priv;
+ if (source->driver->ops->hw_free)
+ source->driver->ops->hw_free(&substream,
+ source);
+
source->active--;
- if (source->driver->ops->shutdown) {
- substream.stream = SNDRV_PCM_STREAM_CAPTURE;
+ if (source->driver->ops->shutdown)
source->driver->ops->shutdown(&substream,
source);
- }
}
+ substream.stream = SNDRV_PCM_STREAM_PLAYBACK;
snd_soc_dapm_widget_for_each_sink_path(w, path) {
sink = path->sink->priv;
+ if (sink->driver->ops->hw_free)
+ sink->driver->ops->hw_free(&substream, sink);
+
sink->active--;
- if (sink->driver->ops->shutdown) {
- substream.stream = SNDRV_PCM_STREAM_PLAYBACK;
+ if (sink->driver->ops->shutdown)
sink->driver->ops->shutdown(&substream, sink);
- }
}
break;