ASoC: add snd_soc_disconnect_sync()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 28 Nov 2017 06:27:09 +0000 (06:27 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 28 Nov 2017 15:21:39 +0000 (15:21 +0000)
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>
include/sound/soc.h
sound/soc/soc-core.c

index 1a7323238c495d7d51313f6ccd8780291ff3e9e5..22f479e1da0aa460c6271d328ec61f75ae232ace 100644 (file)
@@ -494,6 +494,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,
index c0edac80df34e683291cff5fb86c560ee8e22ffd..9047046c749ca9e99df6c9e1f0c634cc77e3369f 100644 (file)
@@ -1392,6 +1392,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