Commit 08a1f5eb authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarRaymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 700cc5c9
...@@ -442,6 +442,8 @@ struct auto_pin_cfg { ...@@ -442,6 +442,8 @@ struct auto_pin_cfg {
(cfg & AC_DEFCFG_SEQUENCE) (cfg & AC_DEFCFG_SEQUENCE)
#define get_defcfg_device(cfg) \ #define get_defcfg_device(cfg) \
((cfg & AC_DEFCFG_DEVICE) >> AC_DEFCFG_DEVICE_SHIFT) ((cfg & AC_DEFCFG_DEVICE) >> AC_DEFCFG_DEVICE_SHIFT)
#define get_defcfg_misc(cfg) \
((cfg & AC_DEFCFG_MISC) >> AC_DEFCFG_MISC_SHIFT)
/* bit-flags for snd_hda_parse_pin_def_config() behavior */ /* bit-flags for snd_hda_parse_pin_def_config() behavior */
#define HDA_PINCFG_NO_HP_FIXUP (1 << 0) /* no HP-split */ #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); ...@@ -509,6 +511,8 @@ int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid);
static inline bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid) static inline bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid)
{ {
return (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT) && return (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT) &&
!(get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid) &
AC_DEFCFG_MISC_NO_PRESENCE)) &&
(get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP); (get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment