[ALSA] hda-codec - Fix AD1986A Lenovo auto-mute
authorTakashi Iwai <tiwai@suse.de>
Wed, 17 Oct 2007 08:09:32 +0000 (10:09 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 23 Oct 2007 06:04:30 +0000 (08:04 +0200)
The jack detection bit on AD1986A Lenovo N100 seems inverse from
the standard definition.  Now fixed the detection properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/pci/hda/patch_analog.c

index 54cfd4526d209e9e58190a5f287378fd57793dd1..9bf38f92ba74ec1beaea1cb6611815ce66890fe4 100644 (file)
@@ -612,7 +612,8 @@ static void ad1986a_hp_automute(struct hda_codec *codec)
        unsigned int present;
 
        present = snd_hda_codec_read(codec, 0x1a, 0, AC_VERB_GET_PIN_SENSE, 0);
-       spec->jack_present = (present & 0x80000000) != 0;
+       /* Lenovo N100 seems to report the reversed bit for HP jack-sensing */
+       spec->jack_present = !(present & 0x80000000);
        ad1986a_update_hp(codec);
 }