[PATCH] ASoC: Only register AC97 bus if it's not done already

Mark Brown broonie at opensource.wolfsonmicro.com
Thu Feb 12 20:33:19 CET 2009

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.

Signed-off-by: Mark Brown <broonie at opensource.wolfsonmicro.com>
 sound/soc/soc-core.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 580a1a5..ae1d7a9 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1382,7 +1382,9 @@ int snd_soc_init_card(struct snd_soc_device *socdev)
-	if (ac97) {
+	/* Only instantiate AC97 if not already done (normally only by
+	 * the adaptor for the generic AC97 subsystem). */
+	if (ac97 && !codec->ac97) {
 		ret = soc_ac97_dev_register(codec);
 		if (ret < 0) {
 			printk(KERN_ERR "asoc: AC97 device register failed\n");

More information about the Alsa-devel mailing list