aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_local.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-11-02 02:44:11 -0400
committerTakashi Iwai <tiwai@suse.de>2011-11-02 02:46:19 -0400
commit08a1f5eb435640741c7b7d10fb339425dff786bb (patch)
tree852cdc1f4094910bbd8c688e383efa8a95b05899 /sound/pci/hda/hda_local.h
parent700cc5c94fad6c3f15bacb0d99d9c474aed13c82 (diff)
ALSA: hda - Check NO_PRESENCE pincfg default bit
HD-audio spec defines a bit in pin default configuration for indicating that the pin isn't used for jack-detection although the codec is capable of it. Better to check this bit as well in jack_is_detectable() helper function. Reported-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_local.h')
-rw-r--r--sound/pci/hda/hda_local.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index 81e12c0ed0a2..79f49e2e8cbc 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -442,6 +442,8 @@ struct auto_pin_cfg {
442 (cfg & AC_DEFCFG_SEQUENCE) 442 (cfg & AC_DEFCFG_SEQUENCE)
443#define get_defcfg_device(cfg) \ 443#define get_defcfg_device(cfg) \
444 ((cfg & AC_DEFCFG_DEVICE) >> AC_DEFCFG_DEVICE_SHIFT) 444 ((cfg & AC_DEFCFG_DEVICE) >> AC_DEFCFG_DEVICE_SHIFT)
445#define get_defcfg_misc(cfg) \
446 ((cfg & AC_DEFCFG_MISC) >> AC_DEFCFG_MISC_SHIFT)
445 447
446/* bit-flags for snd_hda_parse_pin_def_config() behavior */ 448/* bit-flags for snd_hda_parse_pin_def_config() behavior */
447#define HDA_PINCFG_NO_HP_FIXUP (1 << 0) /* no HP-split */ 449#define HDA_PINCFG_NO_HP_FIXUP (1 << 0) /* no HP-split */
@@ -509,6 +511,8 @@ int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid);
509static inline bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid) 511static inline bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid)
510{ 512{
511 return (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT) && 513 return (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT) &&
514 !(get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid) &
515 AC_DEFCFG_MISC_NO_PRESENCE)) &&
512 (get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP); 516 (get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP);
513} 517}
514 518