ASoC: dapm: Power off all widgets in the snd_soc_dapm_shutdown
authorXiang Xiao <xiaoxiang@xiaomi.com>
Sat, 1 Mar 2014 16:04:02 +0000 (00:04 +0800)
committerMark Brown <broonie@linaro.org>
Mon, 3 Mar 2014 04:40:54 +0000 (12:40 +0800)
The widgets generated by the machine driver need to power off too.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/soc-dapm.c

index 4200f96a1483eb82dacc35b59704c5d0351ce1cc..d856e7c4c631ab36e4e79c5fe0d52910a4563b28 100644 (file)
@@ -4116,7 +4116,7 @@ void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm)
 }
 EXPORT_SYMBOL_GPL(snd_soc_dapm_free);
 
-static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm)
+static void soc_dapm_shutdown_dapm(struct snd_soc_dapm_context *dapm)
 {
        struct snd_soc_card *card = dapm->card;
        struct snd_soc_dapm_widget *w;
@@ -4156,12 +4156,12 @@ static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm)
  */
 void snd_soc_dapm_shutdown(struct snd_soc_card *card)
 {
-       struct snd_soc_codec *codec;
+       struct snd_soc_dapm_context *dapm;
 
-       list_for_each_entry(codec, &card->codec_dev_list, card_list) {
-               soc_dapm_shutdown_codec(&codec->dapm);
-               if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY)
-                       snd_soc_dapm_set_bias_level(&codec->dapm,
+       list_for_each_entry(dapm, &card->dapm_list, list) {
+               soc_dapm_shutdown_dapm(dapm);
+               if (dapm->bias_level == SND_SOC_BIAS_STANDBY)
+                       snd_soc_dapm_set_bias_level(dapm,
                                                    SND_SOC_BIAS_OFF);
        }
 }