All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: fmoraes@nc.rr.com
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: [PATCH] remove AC97 existing control
Date: Wed, 23 Mar 2005 15:58:37 +0100	[thread overview]
Message-ID: <s5hd5tqquhu.wl@alsa2.suse.de> (raw)
In-Reply-To: <cecf51cf0059.cf0059cecf51@southeast.rr.com>

[-- Attachment #1: Type: text/plain, Size: 464 bytes --]

At Tue, 22 Mar 2005 07:45:15 -0500,
fmoraes@nc.rr.com wrote:
> 
> This patch should fix bug report 752 by removing the existing control from the AC97.
> 
> 
> Sign off: Francisco Moraes

Right now I created a patch to prevent SPDIF controls on ac97 for
drivers which are known to work without AC97 spdif (conflicting with
the native SPDIF support).

The patch is below.  I guess this will do the same job as this patch.
Could you check whether it works?


Takashi

[-- Attachment #2: Type: text/plain, Size: 4378 bytes --]

Index: alsa-kernel/include/ac97_codec.h
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-kernel/include/ac97_codec.h,v
retrieving revision 1.63
diff -u -r1.63 ac97_codec.h
--- alsa-kernel/include/ac97_codec.h	10 Mar 2005 14:29:43 -0000	1.63
+++ alsa-kernel/include/ac97_codec.h	23 Mar 2005 14:09:04 -0000
@@ -356,6 +356,7 @@
 #define AC97_SCAP_INDEP_SDIN	(1<<6)	/* independent SDIN */
 #define AC97_SCAP_INV_EAPD	(1<<7)	/* inverted EAPD */
 #define AC97_SCAP_DETECT_BY_VENDOR (1<<8) /* use vendor registers for read tests */
+#define AC97_SCAP_NO_SPDIF	(1<<9)	/* don't build SPDIF controls */
 
 /* ac97->flags */
 #define AC97_HAS_PC_BEEP	(1<<0)	/* force PC Speaker usage */
Index: alsa-kernel/pci/atiixp.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-kernel/pci/atiixp.c,v
retrieving revision 1.34
diff -u -r1.34 atiixp.c
--- alsa-kernel/pci/atiixp.c	14 Mar 2005 17:21:25 -0000	1.34
+++ alsa-kernel/pci/atiixp.c	23 Mar 2005 14:09:04 -0000
@@ -1376,6 +1376,8 @@
 		ac97.pci = chip->pci;
 		ac97.num = i;
 		ac97.scaps = AC97_SCAP_SKIP_MODEM;
+		if (! chip->spdif_over_aclink)
+			ac97.scaps |= AC97_SCAP_NO_SPDIF;
 		if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0) {
 			chip->ac97[i] = NULL; /* to be sure */
 			snd_printdd("atiixp: codec %d not available for audio\n", i);
Index: alsa-kernel/pci/ac97/ac97_codec.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-kernel/pci/ac97/ac97_codec.c,v
retrieving revision 1.171
diff -u -r1.171 ac97_codec.c
--- alsa-kernel/pci/ac97/ac97_codec.c	18 Mar 2005 16:55:36 -0000	1.171
+++ alsa-kernel/pci/ac97/ac97_codec.c	23 Mar 2005 14:09:04 -0000
@@ -1486,7 +1486,7 @@
 	}
 
 	/* build S/PDIF controls */
-	if (ac97->ext_id & AC97_EI_SPDIF) {
+	if ((ac97->ext_id & AC97_EI_SPDIF) && !(ac97->scaps & AC97_SCAP_NO_SPDIF)) {
 		if (ac97->build_ops->build_spdif) {
 			if ((err = ac97->build_ops->build_spdif(ac97)) < 0)
 				return err;
Index: alsa-kernel/pci/au88x0/au88x0_mixer.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-kernel/pci/au88x0/au88x0_mixer.c,v
retrieving revision 1.4
diff -u -r1.4 au88x0_mixer.c
--- alsa-kernel/pci/au88x0/au88x0_mixer.c	8 Nov 2004 11:43:40 -0000	1.4
+++ alsa-kernel/pci/au88x0/au88x0_mixer.c	23 Mar 2005 14:09:04 -0000
@@ -26,6 +26,7 @@
 	memset(&ac97, 0, sizeof(ac97));
 	// Intialize AC97 codec stuff.
 	ac97.private_data = vortex;
+	ac97.scaps = AC97_SCAP_NO_SPDIF;
 	err = snd_ac97_mixer(pbus, &ac97, &vortex->codec);
 	vortex->isquad = ((vortex->codec == NULL) ?  0 : (vortex->codec->ext_id&0x80));
 	return err;
Index: alsa-kernel/pci/emu10k1/emu10k1x.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-kernel/pci/emu10k1/emu10k1x.c,v
retrieving revision 1.7
diff -u -r1.7 emu10k1x.c
--- alsa-kernel/pci/emu10k1/emu10k1x.c	21 Mar 2005 18:31:30 -0000	1.7
+++ alsa-kernel/pci/emu10k1/emu10k1x.c	23 Mar 2005 14:09:04 -0000
@@ -749,6 +749,7 @@
 
 	memset(&ac97, 0, sizeof(ac97));
 	ac97.private_data = chip;
+	ac97.scaps = AC97_SCAP_NO_SPDIF;
 	return snd_ac97_mixer(pbus, &ac97, &chip->ac97);
 }
 
Index: alsa-kernel/pci/emu10k1/emumixer.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-kernel/pci/emu10k1/emumixer.c,v
retrieving revision 1.31
diff -u -r1.31 emumixer.c
--- alsa-kernel/pci/emu10k1/emumixer.c	17 Mar 2005 15:58:58 -0000	1.31
+++ alsa-kernel/pci/emu10k1/emumixer.c	23 Mar 2005 14:09:04 -0000
@@ -806,6 +806,7 @@
 		memset(&ac97, 0, sizeof(ac97));
 		ac97.private_data = emu;
 		ac97.private_free = snd_emu10k1_mixer_free_ac97;
+		ac97.scaps = AC97_SCAP_NO_SPDIF;
 		if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0)
 			return err;
 		if (emu->audigy) {
@@ -923,11 +924,6 @@
 			return -ENOMEM;
 		if ((err = snd_ctl_add(card, kctl)))
 			return err;
-		if ((kctl = ctl_find(card, SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT))) != NULL) {
-			/* already defined by ac97, remove it */
-			/* FIXME: or do we need both controls? */
-			remove_ctl(card, SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT));
-		}
 		if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_control, emu)) == NULL)
 			return -ENOMEM;
 		if ((err = snd_ctl_add(card, kctl)))

  reply	other threads:[~2005-03-23 14:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-22 12:45 [PATCH] remove AC97 existing control fmoraes
2005-03-23 14:58 ` Takashi Iwai [this message]
2005-03-24 13:24   ` Francisco Moraes
2005-03-24 17:49     ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hd5tqquhu.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=fmoraes@nc.rr.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.