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()
193 jack->pin_sense = read_pin_sense(codec, jack->nid, in jack_detect_update()
228 if (jack->nid) in snd_hda_jack_set_dirty_all()
242 u32 snd_hda_jack_pin_sense(struct hda_codec *codec, hda_nid_t nid, int dev_id) in snd_hda_jack_pin_sense() argument
245 snd_hda_jack_tbl_get_mst(codec, nid, dev_id); in snd_hda_jack_pin_sense()
250 return read_pin_sense(codec, nid, dev_id); in snd_hda_jack_pin_sense()
264 hda_nid_t nid, int dev_id) in snd_hda_jack_detect_state_mst() argument
267 snd_hda_jack_tbl_get_mst(codec, nid, dev_id); in snd_hda_jack_detect_state_mst()
270 else if (snd_hda_jack_pin_sense(codec, nid, dev_id) & in snd_hda_jack_detect_state_mst()
307 snd_hda_jack_detect_enable_callback_mst(struct hda_codec *codec, hda_nid_t nid, in snd_hda_jack_detect_enable_callback_mst() argument
314 jack = snd_hda_jack_tbl_new(codec, nid, dev_id); in snd_hda_jack_detect_enable_callback_mst()
325 callback->nid = jack->nid; in snd_hda_jack_detect_enable_callback_mst()
336 err = snd_hda_codec_write_cache(codec, nid, 0, in snd_hda_jack_detect_enable_callback_mst()
354 int snd_hda_jack_detect_enable(struct hda_codec *codec, hda_nid_t nid, in snd_hda_jack_detect_enable() argument
358 nid, in snd_hda_jack_detect_enable()
466 if (jack->nid) in snd_hda_jack_report_sync()
474 if (jack->nid) { in snd_hda_jack_report_sync()
491 static int get_input_jack_type(struct hda_codec *codec, hda_nid_t nid) in get_input_jack_type() argument
493 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid); in get_input_jack_type()
513 jacks->nid = 0; in hda_free_jack_priv()
530 int snd_hda_jack_add_kctl_mst(struct hda_codec *codec, hda_nid_t nid, in snd_hda_jack_add_kctl_mst() argument
538 jack = snd_hda_jack_tbl_new(codec, nid, dev_id); in snd_hda_jack_add_kctl_mst()
545 type = get_input_jack_type(codec, nid); in snd_hda_jack_add_kctl_mst()
568 state = snd_hda_jack_detect_mst(codec, nid, dev_id); in snd_hda_jack_add_kctl_mst()
575 static int add_jack_kctl(struct hda_codec *codec, hda_nid_t nid, in add_jack_kctl() argument
586 if (!nid) in add_jack_kctl()
588 def_conf = snd_hda_codec_get_pincfg(codec, nid); in add_jack_kctl()
593 !is_jack_detectable(codec, nid); in add_jack_kctl()
598 snd_hda_get_pin_label(codec, nid, cfg, name, sizeof(name), NULL); in add_jack_kctl()
602 err = snd_hda_jack_add_kctl(codec, nid, name, phantom_jack, 0, NULL); in add_jack_kctl()
607 return snd_hda_jack_detect_enable(codec, nid, 0); in add_jack_kctl()
746 if (!jack->nid || !jack->jack_dirty || jack->phantom_jack) in snd_hda_jack_poll_all()