Lines Matching defs:nid
22 * @nid: pin NID
29 bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid)
33 if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT))
35 if (get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid)) &
38 if (!(get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP) &&
46 static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid, int dev_id)
52 pincap = snd_hda_query_pin_caps(codec, nid);
54 snd_hda_codec_read(codec, nid, 0,
57 val = snd_hda_codec_read(codec, nid, 0,
67 * @nid: pin NID to refer to
71 snd_hda_jack_tbl_get_mst(struct hda_codec *codec, hda_nid_t nid, int dev_id)
76 if (!nid || !jack)
79 if (jack->nid == nid && jack->dev_id == dev_id)
108 any_jack_tbl_get_from_nid(struct hda_codec *codec, hda_nid_t nid)
113 if (!nid || !jack)
116 if (jack->nid == nid)
124 * @nid: pin NID to assign
128 snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid, int dev_id)
131 snd_hda_jack_tbl_get_mst(codec, nid, dev_id);
133 any_jack_tbl_get_from_nid(codec, nid);
142 jack->nid = nid;
193 jack->pin_sense = read_pin_sense(codec, jack->nid,
228 if (jack->nid)
236 * @nid: the pin NID to sense
242 u32 snd_hda_jack_pin_sense(struct hda_codec *codec, hda_nid_t nid, int dev_id)
245 snd_hda_jack_tbl_get_mst(codec, nid, dev_id);
250 return read_pin_sense(codec, nid, dev_id);
257 * @nid: the pin NID to sense
264 hda_nid_t nid, int dev_id)
267 snd_hda_jack_tbl_get_mst(codec, nid, dev_id);
270 else if (snd_hda_jack_pin_sense(codec, nid, dev_id) &
298 * @nid: pin NID to enable
307 snd_hda_jack_detect_enable_callback_mst(struct hda_codec *codec, hda_nid_t nid,
314 jack = snd_hda_jack_tbl_new(codec, nid, dev_id);
325 callback->nid = jack->nid;
336 err = snd_hda_codec_write_cache(codec, nid, 0,
348 * @nid: pin NID to enable jack detection
354 int snd_hda_jack_detect_enable(struct hda_codec *codec, hda_nid_t nid,
358 nid,
403 if (jack->nid)
411 if (jack->nid) {
428 static int get_input_jack_type(struct hda_codec *codec, hda_nid_t nid)
430 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
450 jacks->nid = 0;
457 * @nid: pin NID to assign
467 int snd_hda_jack_add_kctl_mst(struct hda_codec *codec, hda_nid_t nid,
475 jack = snd_hda_jack_tbl_new(codec, nid, dev_id);
482 type = get_input_jack_type(codec, nid);
505 state = snd_hda_jack_detect_mst(codec, nid, dev_id);
512 static int add_jack_kctl(struct hda_codec *codec, hda_nid_t nid,
523 if (!nid)
525 def_conf = snd_hda_codec_get_pincfg(codec, nid);
530 !is_jack_detectable(codec, nid);
535 snd_hda_get_pin_label(codec, nid, cfg, name, sizeof(name), NULL);
539 err = snd_hda_jack_add_kctl(codec, nid, name, phantom_jack, 0, NULL);
544 return snd_hda_jack_detect_enable(codec, nid, 0);
675 if (!jack->nid || !jack->jack_dirty || jack->phantom_jack)