blob: 9d4e1e65352e6e91a2d663c0dcf8bf8bb8d16fd4 [file] [log] [blame]
From a55be0f7c7d79a20a7ab1ab853d0eb2f4210e78d Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Tue, 28 Nov 2017 06:27:09 +0000
Subject: [PATCH 0558/1795] ASoC: add snd_soc_disconnect_sync()
Now, we have snd_card_disconnect_sync() on ALSA framework.
snd_soc_disconnect_sync() is ASoC version of it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit ef2e8175eb19011f756469d4d14f4207bf7f289c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
include/sound/soc.h | 2 ++
sound/soc/soc-core.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index c289e1b1ad84..8a7ca360b9af 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -489,6 +489,8 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num);
#endif
+void snd_soc_disconnect_sync(struct device *dev);
+
struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card,
const char *dai_link, int stream);
struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a9066320b672..88403ccdf18b 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1388,6 +1388,16 @@ static int soc_init_dai_link(struct snd_soc_card *card,
return 0;
}
+void snd_soc_disconnect_sync(struct device *dev)
+{
+ struct snd_soc_component *component = snd_soc_lookup_component(dev, NULL);
+
+ if (!component || !component->card)
+ return;
+
+ snd_card_disconnect_sync(component->card->snd_card);
+}
+
/**
* snd_soc_add_dai_link - Add a DAI link dynamically
* @card: The ASoC card to which the DAI link is added
--
2.19.0