[PATCH] [UBUNTU:sound/pci/ac97/] Don't erroneously attempt to create AC97 controls again

crimsun at fungus.sh.nu crimsun at fungus.sh.nu
Thu Jun 15 20:51:23 UTC 2006


Subject: [PATCH] [UBUNTU:sound/pci/ac97/] Don't erroneously attempt to create AC97 controls again

UpstreamStatus: Added in upstream alsa-kernel hg changeset 8d313e752df1
                http://hg-mirror.alsa-project.org/alsa-kernel?cmd=changeset;node=8d313e752df1c78b700d0aa696fd67312409fb0e;style=raw

Patch from Marcelo Tosatti by way of Jaya Kumar
<jayakumar.alsa at gmail.com> fixes the case where the erroneous creation
of an AD18xx-specific control is attempted, causing
snd_ac97_mixer_build() to bail (personally experienced and further
confirmed by separate AD1985 Dapper user in freenode/#ubuntu).

Signed-off-by: Daniel T Chen <crimsun at ubuntu.com>

---

 sound/pci/ac97/ac97_codec.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

5490918b5daa949d62e775bb3c1b2e537a6adc7f
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index b942772..507ba2a 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -1254,7 +1254,8 @@ static int snd_ac97_mixer_build(ac97_t *
 	ac97->regs[AC97_CENTER_LFE_MASTER] = 0x8080;
 
 	/* build center controls */
-	if (snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER)) {
+	if ((snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER)) 
+		&& !(ac97->flags & AC97_AD_MULTI)) {
 		if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_center[0], ac97))) < 0)
 			return err;
 		if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_center[1], ac97))) < 0)
@@ -1266,7 +1267,8 @@ static int snd_ac97_mixer_build(ac97_t *
 	}
 
 	/* build LFE controls */
-	if (snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER+1)) {
+	if ((snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER+1))
+		&& !(ac97->flags & AC97_AD_MULTI)) {
 		if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_lfe[0], ac97))) < 0)
 			return err;
 		if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_lfe[1], ac97))) < 0)
@@ -1278,7 +1280,8 @@ static int snd_ac97_mixer_build(ac97_t *
 	}
 
 	/* build surround controls */
-	if (snd_ac97_try_volume_mix(ac97, AC97_SURROUND_MASTER)) {
+	if ((snd_ac97_try_volume_mix(ac97, AC97_SURROUND_MASTER)) 
+		&& !(ac97->flags & AC97_AD_MULTI)) {
 		/* Surround Master (0x38) is with stereo mutes */
 		if ((err = snd_ac97_cmix_new_stereo(card, "Surround Playback", AC97_SURROUND_MASTER, 1, ac97)) < 0)
 			return err;
-- 
1.1.3


-- 
Daniel T. Chen            crimsun at ubuntu.com
GPG key:   www.sh.nu/~crimsun/pubkey.gpg.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20060615/edef0dcb/attachment.pgp>


More information about the kernel-team mailing list