ChangeSet 1.2181.25.49, 2005/03/24 11:57:55+01:00, [EMAIL PROTECTED]
[ALSA] Add AC97_SCAP_NO_SPDIF flag
AC97 Codec,ATIIXP driver,au88x0 driver,EMU10K1/EMU10K2 driver
Added a new flag, AC97_SCAP_NO_SPDIF, to prevent to build the
SPDIF-related
controls on ac97 codec. This flag is used when the sound chip has its
native SPDIF support and it conflicts with the one of AC97 codec.
Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
include/sound/ac97_codec.h | 1 +
sound/pci/ac97/ac97_codec.c | 2 +-
sound/pci/atiixp.c | 2 ++
sound/pci/au88x0/au88x0_mixer.c | 1 +
sound/pci/emu10k1/emu10k1x.c | 1 +
sound/pci/emu10k1/emumixer.c | 6 +-----
6 files changed, 7 insertions(+), 6 deletions(-)
diff -Nru a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
--- a/include/sound/ac97_codec.h 2005-03-30 16:20:42 -08:00
+++ b/include/sound/ac97_codec.h 2005-03-30 16:20:42 -08:00
@@ -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 */
diff -Nru a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
--- a/sound/pci/ac97/ac97_codec.c 2005-03-30 16:20:42 -08:00
+++ b/sound/pci/ac97/ac97_codec.c 2005-03-30 16:20:42 -08:00
@@ -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;
diff -Nru a/sound/pci/atiixp.c b/sound/pci/atiixp.c
--- a/sound/pci/atiixp.c 2005-03-30 16:20:42 -08:00
+++ b/sound/pci/atiixp.c 2005-03-30 16:20:42 -08:00
@@ -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);
diff -Nru a/sound/pci/au88x0/au88x0_mixer.c b/sound/pci/au88x0/au88x0_mixer.c
--- a/sound/pci/au88x0/au88x0_mixer.c 2005-03-30 16:20:42 -08:00
+++ b/sound/pci/au88x0/au88x0_mixer.c 2005-03-30 16:20:42 -08:00
@@ -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;
diff -Nru a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
--- a/sound/pci/emu10k1/emu10k1x.c 2005-03-30 16:20:42 -08:00
+++ b/sound/pci/emu10k1/emu10k1x.c 2005-03-30 16:20:42 -08:00
@@ -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);
}
diff -Nru a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
--- a/sound/pci/emu10k1/emumixer.c 2005-03-30 16:20:42 -08:00
+++ b/sound/pci/emu10k1/emumixer.c 2005-03-30 16:20:42 -08:00
@@ -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)))
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html