Lines Matching refs:nid
29 bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid) in is_jack_detectable() argument
33 if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT)) in is_jack_detectable()
35 if (get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid)) & in is_jack_detectable()
38 if (!(get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP) && in is_jack_detectable()
46 static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid, int dev_id) in read_pin_sense() argument
52 pincap = snd_hda_query_pin_caps(codec, nid); in read_pin_sense()
54 snd_hda_codec_read(codec, nid, 0, in read_pin_sense()
57 val = snd_hda_codec_read(codec, nid, 0, in read_pin_sense()
71 snd_hda_jack_tbl_get_mst(struct hda_codec *codec, hda_nid_t nid, int dev_id) in snd_hda_jack_tbl_get_mst() argument
76 if (!nid || !jack) in snd_hda_jack_tbl_get_mst()
79 if (jack->nid == nid && jack->dev_id == dev_id) in snd_hda_jack_tbl_get_mst()
108 any_jack_tbl_get_from_nid(struct hda_codec *codec, hda_nid_t nid) in any_jack_tbl_get_from_nid() argument
113 if (!nid || !jack) in any_jack_tbl_get_from_nid()
116 if (jack->nid == nid) in any_jack_tbl_get_from_nid()
128 snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid, int dev_id) in snd_hda_jack_tbl_new() argument
131 snd_hda_jack_tbl_get_mst(codec, nid, dev_id); in snd_hda_jack_tbl_new()
133 any_jack_tbl_get_from_nid(codec, nid); in snd_hda_jack_tbl_new()
142 jack->nid = nid; in snd_hda_jack_tbl_new()
204 jack->pin_sense = read_pin_sense(codec, jack->nid, in jack_detect_update()
239 if (jack->nid) in snd_hda_jack_set_dirty_all()
253 u32 snd_hda_jack_pin_sense(struct hda_codec *codec, hda_nid_t nid, int dev_id) in snd_hda_jack_pin_sense() argument
256 snd_hda_jack_tbl_get_mst(codec, nid, dev_id); in snd_hda_jack_pin_sense()
261 return read_pin_sense(codec, nid, dev_id); in snd_hda_jack_pin_sense()
275 hda_nid_t nid, int dev_id) in snd_hda_jack_detect_state_mst() argument
278 snd_hda_jack_tbl_get_mst(codec, nid, dev_id); in snd_hda_jack_detect_state_mst()
281 else if (snd_hda_jack_pin_sense(codec, nid, dev_id) & in snd_hda_jack_detect_state_mst()
318 snd_hda_jack_detect_enable_callback_mst(struct hda_codec *codec, hda_nid_t nid, in snd_hda_jack_detect_enable_callback_mst() argument
325 jack = snd_hda_jack_tbl_new(codec, nid, dev_id); in snd_hda_jack_detect_enable_callback_mst()
336 callback->nid = jack->nid; in snd_hda_jack_detect_enable_callback_mst()
347 err = snd_hda_codec_write_cache(codec, nid, 0, in snd_hda_jack_detect_enable_callback_mst()
365 int snd_hda_jack_detect_enable(struct hda_codec *codec, hda_nid_t nid, in snd_hda_jack_detect_enable() argument
369 nid, in snd_hda_jack_detect_enable()
477 if (jack->nid) in snd_hda_jack_report_sync()
485 if (jack->nid) { in snd_hda_jack_report_sync()
502 static int get_input_jack_type(struct hda_codec *codec, hda_nid_t nid) in get_input_jack_type() argument
504 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid); in get_input_jack_type()
524 jacks->nid = 0; in hda_free_jack_priv()
541 int snd_hda_jack_add_kctl_mst(struct hda_codec *codec, hda_nid_t nid, in snd_hda_jack_add_kctl_mst() argument
549 jack = snd_hda_jack_tbl_new(codec, nid, dev_id); in snd_hda_jack_add_kctl_mst()
556 type = get_input_jack_type(codec, nid); in snd_hda_jack_add_kctl_mst()
579 state = snd_hda_jack_detect_mst(codec, nid, dev_id); in snd_hda_jack_add_kctl_mst()
586 static int add_jack_kctl(struct hda_codec *codec, hda_nid_t nid, in add_jack_kctl() argument
597 if (!nid) in add_jack_kctl()
599 def_conf = snd_hda_codec_get_pincfg(codec, nid); in add_jack_kctl()
604 !is_jack_detectable(codec, nid); in add_jack_kctl()
609 snd_hda_get_pin_label(codec, nid, cfg, name, sizeof(name), NULL); in add_jack_kctl()
613 err = snd_hda_jack_add_kctl(codec, nid, name, phantom_jack, 0, NULL); in add_jack_kctl()
618 return snd_hda_jack_detect_enable(codec, nid, 0); in add_jack_kctl()
757 if (!jack->nid || !jack->jack_dirty || jack->phantom_jack) in snd_hda_jack_poll_all()