summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_jack.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-23 08:34:12 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-23 08:34:12 +0100
commit2cf215bfaa01384374291a118c8152ab18a55a63 (patch)
treef0020c78288344f709596ede3a7e4195cfffdff7 /sound/pci/hda/hda_jack.c
parente152f18027552eb34006b35347e72bc805783027 (diff)
parent657e1b931d42882cb0a59b599247bef696c22406 (diff)
Merge branch 'topic/hda-gen-parser' into for-next
This is a merge of really big changes: the generic parser is heavily enhanced for handling all cases, based on the former Realtek codec driver code. And all codec drivers except for a few ones (CA0132, HDMI and modem) have been converted to use the new generic driver. Conflicts: sound/pci/hda/patch_realtek.c
Diffstat (limited to 'sound/pci/hda/hda_jack.c')
-rw-r--r--sound/pci/hda/hda_jack.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
index 6e9f57bbe667..1d035efeff4f 100644
--- a/sound/pci/hda/hda_jack.c
+++ b/sound/pci/hda/hda_jack.c
@@ -29,7 +29,8 @@ bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid)
if (get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid)) &
AC_DEFCFG_MISC_NO_PRESENCE)
return false;
- if (!(get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP))
+ if (!(get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP) &&
+ !codec->jackpoll_interval)
return false;
return true;
}
@@ -39,6 +40,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 +48,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;
}
/**