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;
204 jack->pin_sense = read_pin_sense(codec, jack->nid,
239 if (jack->nid)
247 * @nid: the pin NID to sense
253 u32 snd_hda_jack_pin_sense(struct hda_codec *codec, hda_nid_t nid, int dev_id)
256 snd_hda_jack_tbl_get_mst(codec, nid, dev_id);
261 return read_pin_sense(codec, nid, dev_id);
268 * @nid: the pin NID to sense
275 hda_nid_t nid, int dev_id)
278 snd_hda_jack_tbl_get_mst(codec, nid, dev_id);
281 else if (snd_hda_jack_pin_sense(codec, nid, dev_id) &
309 * @nid: pin NID to enable
318 snd_hda_jack_detect_enable_callback_mst(struct hda_codec *codec, hda_nid_t nid,
325 jack = snd_hda_jack_tbl_new(codec, nid, dev_id);
336 callback->nid = jack->nid;
347 err = snd_hda_codec_write_cache(codec, nid, 0,
359 * @nid: pin NID to enable jack detection
365 int snd_hda_jack_detect_enable(struct hda_codec *codec, hda_nid_t nid,
369 nid,
477 if (jack->nid)
485 if (jack->nid) {
502 static int get_input_jack_type(struct hda_codec *codec, hda_nid_t nid)
504 unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
524 jacks->nid = 0;
531 * @nid: pin NID to assign
541 int snd_hda_jack_add_kctl_mst(struct hda_codec *codec, hda_nid_t nid,
549 jack = snd_hda_jack_tbl_new(codec, nid, dev_id);
556 type = get_input_jack_type(codec, nid);
579 state = snd_hda_jack_detect_mst(codec, nid, dev_id);
586 static int add_jack_kctl(struct hda_codec *codec, hda_nid_t nid,
597 if (!nid)
599 def_conf = snd_hda_codec_get_pincfg(codec, nid);
604 !is_jack_detectable(codec, nid);
609 snd_hda_get_pin_label(codec, nid, cfg, name, sizeof(name), NULL);
613 err = snd_hda_jack_add_kctl(codec, nid, name, phantom_jack, 0, NULL);
618 return snd_hda_jack_detect_enable(codec, nid, 0);
757 if (!jack->nid || !jack->jack_dirty || jack->phantom_jack)