提交 1c325f77 编写于 作者: L Lars-Peter Clausen 提交者: Mark Brown

ASoC: Shutdown DAPM contexts when removing a card

Currently when a ASoC sound card is unregistered we leave the individual
components in their current state, just call the remove() callback and leave
it to the drivers to do the proper shutdown/cleanup.

This patch introduces a call to snd_soc_dapm_shutdown() when removing the
card.  This will make sure that all DAPM widgets are properly powered down
and all DAPM contexts are put at the SND_SOC_BIAS_OFF level. This will
ensure that all components are properly powered down when the card is
removed.

Since a lot of drivers manually go to SND_SOC_BIAS_OFF in their remove
callback this will also allow us to remove a bit of duplicated code.
Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 01e0df66
...@@ -3812,6 +3812,7 @@ int snd_soc_unregister_card(struct snd_soc_card *card) ...@@ -3812,6 +3812,7 @@ int snd_soc_unregister_card(struct snd_soc_card *card)
{ {
if (card->instantiated) { if (card->instantiated) {
card->instantiated = false; card->instantiated = false;
snd_soc_dapm_shutdown(card);
soc_cleanup_card_resources(card); soc_cleanup_card_resources(card);
} }
dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name); dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册