From 1f43ea4b9a4561e31186e52a017d58e5fa361a41 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 21 Dec 2012 15:31:41 +0100 Subject: [PATCH] --- yaml --- r: 353076 b: refs/heads/master c: 9cc159c6647f505be1205eb5e3fc3b1f84e1d4fd h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/hda_codec.h | 1 + trunk/sound/pci/hda/hda_jack.c | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 0152d231b721..4acfbdc2bb6a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ecac3ed174034755ebc0b29393fb501ffd0b2afc +refs/heads/master: 9cc159c6647f505be1205eb5e3fc3b1f84e1d4fd diff --git a/trunk/sound/pci/hda/hda_codec.h b/trunk/sound/pci/hda/hda_codec.h index 369ffafae8a9..9f241d1af38c 100644 --- a/trunk/sound/pci/hda/hda_codec.h +++ b/trunk/sound/pci/hda/hda_codec.h @@ -867,6 +867,7 @@ struct hda_codec { unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */ unsigned int no_jack_detect:1; /* Machine has no jack-detection */ unsigned int inv_eapd:1; /* broken h/w: inverted EAPD control */ + unsigned int inv_jack_detect:1; /* broken h/w: inverted detection bit */ unsigned int pcm_format_first:1; /* PCM format must be set first */ unsigned int epss:1; /* supporting EPSS? */ unsigned int cached_write:1; /* write only to caches */ diff --git a/trunk/sound/pci/hda/hda_jack.c b/trunk/sound/pci/hda/hda_jack.c index 6e9f57bbe667..6479b6501828 100644 --- a/trunk/sound/pci/hda/hda_jack.c +++ b/trunk/sound/pci/hda/hda_jack.c @@ -39,6 +39,7 @@ EXPORT_SYMBOL_HDA(is_jack_detectable); static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid) { u32 pincap; + u32 val; if (!codec->no_trigger_sense) { pincap = snd_hda_query_pin_caps(codec, nid); @@ -46,8 +47,11 @@ static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid) snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); } - return snd_hda_codec_read(codec, nid, 0, + val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0); + if (codec->inv_jack_detect) + val ^= AC_PINSENSE_PRESENCE; + return val; } /**