ASoC: Instantiate any forgotten DAPM widgets
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 14 Jun 2009 10:33:37 +0000 (11:33 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 14 Jun 2009 15:14:53 +0000 (16:14 +0100)
With the recent changes to the DAPM power checks it has become important
to explicitly instantiate all widgets but some drivers were forgetting
to do that.  Since everything needs to do it add a call to instantiate
them immediately before the card registration - it does no harm when it
is called repeatedly and saves work in drivers.

Tested-by: pHilipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/soc-core.c

index 3f44150d8e30b6a9d8f5920e497627b397c0f049..1d70829464ef3698c85df7918b9c0c4acfaf1239 100644 (file)
@@ -1389,6 +1389,9 @@ int snd_soc_init_card(struct snd_soc_device *socdev)
        snprintf(codec->card->longname, sizeof(codec->card->longname),
                 "%s (%s)", card->name, codec->name);
 
+       /* Make sure all DAPM widgets are instantiated */
+       snd_soc_dapm_new_widgets(codec);
+
        ret = snd_card_register(codec->card);
        if (ret < 0) {
                printk(KERN_ERR "asoc: failed to register soundcard for %s\n",