[ALSA] Fix ALC658D support
authorTakashi Iwai <tiwai@suse.de>
Fri, 2 Sep 2005 12:03:05 +0000 (14:03 +0200)
committerJaroslav Kysela <perex@suse.cz>
Mon, 12 Sep 2005 08:41:01 +0000 (10:41 +0200)
AC97 Codec
Fix the internal speaker problem (e.g. Targa Traveller 826)
with ALC658D codec.  The info is taken from Cyberlink/realtek-modified code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/ac97/ac97_codec.c
sound/pci/ac97/ac97_id.h
sound/pci/ac97/ac97_patch.c

index 5501f4440c9223439f476788ecfe6211052d948b..3b66fa6893668b98362ec5f984ea56e6a008dd15 100644 (file)
@@ -112,6 +112,7 @@ static const ac97_codec_id_t snd_ac97_codec_ids[] = {
 { 0x414c4723, 0xffffffff, "ALC650F",           NULL,   NULL }, /* already patched */
 { 0x414c4720, 0xfffffff0, "ALC650",            patch_alc650,   NULL },
 { 0x414c4760, 0xfffffff0, "ALC655",            patch_alc655,   NULL },
+{ 0x414c4781, 0xffffffff, "ALC658D",           NULL,   NULL }, /* already patched */
 { 0x414c4780, 0xfffffff0, "ALC658",            patch_alc655,   NULL },
 { 0x414c4790, 0xfffffff0, "ALC850",            patch_alc850,   NULL },
 { 0x414c4730, 0xffffffff, "ALC101",            NULL,           NULL },
index dadf387ad0b8a2b69b6a742e4ed73868dd75222c..6d73514dc49e040dd92310e6057618db8cd5b26b 100644 (file)
@@ -52,6 +52,7 @@
 #define AC97_ID_ALC650F                0x414c4723
 #define AC97_ID_ALC655         0x414c4760
 #define AC97_ID_ALC658         0x414c4780
+#define AC97_ID_ALC658D                0x414c4781
 #define AC97_ID_ALC850         0x414c4790
 #define AC97_ID_YMF753         0x594d4803
 #define AC97_ID_VT1616         0x49434551
index 0acf51dd44786db53c7d671b5634537c8b95953a..045ddc743edcae9beca7674112e0688bda4ce14f 100644 (file)
@@ -2134,7 +2134,13 @@ int patch_alc655(ac97_t * ac97)
 {
        unsigned int val;
 
-       ac97->spec.dev_flags = (ac97->id == 0x414c4780); /* ALC658 */
+       if (ac97->id == AC97_ID_ALC658) {
+               ac97->spec.dev_flags = 1; /* ALC658 */
+               if ((snd_ac97_read(ac97, AC97_ALC650_REVISION) & 0x3f) == 2) {
+                       ac97->id = AC97_ID_ALC658D;
+                       ac97->spec.dev_flags = 2;
+               }
+       }
 
        ac97->build_ops = &patch_alc655_ops;
 
@@ -2143,7 +2149,7 @@ int patch_alc655(ac97_t * ac97)
 
        /* adjust default values */
        val = snd_ac97_read(ac97, 0x7a); /* misc control */
-       if (ac97->id == 0x414c4780) /* ALC658 */
+       if (ac97->spec.dev_flags) /* ALC658 */
                val &= ~(1 << 1); /* Pin 47 is spdif input pin */
        else { /* ALC655 */
                if (ac97->subsystem_vendor == 0x1462 &&
@@ -2164,6 +2170,11 @@ int patch_alc655(ac97_t * ac97)
        /* full DAC volume */
        snd_ac97_write_cache(ac97, AC97_ALC650_SURR_DAC_VOL, 0x0808);
        snd_ac97_write_cache(ac97, AC97_ALC650_LFE_DAC_VOL, 0x0808);
+
+       /* update undocumented bit... */
+       if (ac97->id == AC97_ID_ALC658D)
+               snd_ac97_update_bits(ac97, 0x74, 0x0800, 0x0800);
+
        return 0;
 }