]> git.hungrycats.org Git - linux/commitdiff
[PATCH] [ALSA] Fix silent output on some machines with AD1981x codecs
authorTakashi Iwai <tiwai@suse.de>
Wed, 9 Feb 2005 23:34:04 +0000 (15:34 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 9 Feb 2005 23:34:04 +0000 (15:34 -0800)
Fixed the default state of 'Headphone Jack Sense' switch on AD1981x
codecs.  Setting this on affects the output of some machines (e.g.
Thindpads).

The default value is set on only hardwares which are known to work.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
sound/pci/ac97/ac97_patch.c

index 04f7a4f598141a5c95bf9abbfe3851d6a8e4a779..44c2253442361ddbb230a3279398f1ae3495e741 100644 (file)
@@ -1107,13 +1107,25 @@ static struct snd_ac97_build_ops patch_ad1981a_build_ops = {
 #endif
 };
 
+static void check_ad1981_hp_jack_sense(ac97_t *ac97)
+{
+       u32 subid = ((u32)ac97->subsystem_vendor << 16) | ac97->subsystem_device;
+       switch (subid) {
+       case 0x103c0890: /* HP nc6000 */
+       case 0x103c006d: /* HP nx9105 */
+               /* enable headphone jack sense */
+               snd_ac97_update_bits(ac97, AC97_AD_JACK_SPDIF, 1<<11, 1<<11);
+               break;
+       }
+}
+
 int patch_ad1981a(ac97_t *ac97)
 {
        patch_ad1881(ac97);
        ac97->build_ops = &patch_ad1981a_build_ops;
        snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD198X_MSPLT, AC97_AD198X_MSPLT);
        ac97->flags |= AC97_STEREO_MUTES;
-       snd_ac97_update_bits(ac97, AC97_AD_JACK_SPDIF, 1<<11, 1<<11); /* HP jack sense */
+       check_ad1981_hp_jack_sense(ac97);
        return 0;
 }
 
@@ -1144,7 +1156,7 @@ int patch_ad1981b(ac97_t *ac97)
        ac97->build_ops = &patch_ad1981b_build_ops;
        snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD198X_MSPLT, AC97_AD198X_MSPLT);
        ac97->flags |= AC97_STEREO_MUTES;
-       snd_ac97_update_bits(ac97, AC97_AD_JACK_SPDIF, 1<<11, 1<<11); /* HP jack sense */
+       check_ad1981_hp_jack_sense(ac97);
        return 0;
 }