ASoC: Only register AC97 bus if it's not done already
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 12 Feb 2009 19:33:19 +0000 (19:33 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 13 Feb 2009 13:50:22 +0000 (13:50 +0000)
ASoC supports both explicit codec drivers for AC97 devices and a simple
driver which uses the standard ALSA AC97 framework for codec support.
When used with the generic AC97 codec support that will provide the
ad hoc AC97 device for drivers like touchscreens to attach to so the
core shouldn't do so.

Reported-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/soc-core.c

index 55fdb4abb1796dc728dfedd147dc09eaf01298fc..ec3f8bb4b51d9805d827279e8b025aeeb12d657a 100644 (file)
@@ -1385,7 +1385,10 @@ int snd_soc_init_card(struct snd_soc_device *socdev)
 
        mutex_lock(&codec->mutex);
 #ifdef CONFIG_SND_SOC_AC97_BUS
-       if (ac97) {
+       /* Only instantiate AC97 if not already done by the adaptor
+        * for the generic AC97 subsystem.
+        */
+       if (ac97 && strcmp(codec->name, "AC97") != 0) {
                ret = soc_ac97_dev_register(codec);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: AC97 device register failed\n");