Skip to content

Commit

Permalink
ASoC: add snd_soc_disconnect_sync()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Nov 28, 2017
1 parent 4fbd8d1 commit ef2e817
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 10 additions & 0 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ef2e817

Please sign in to comment.