Lines Matching defs:nid

90 	for (; seq->nid; seq++)
91 snd_hda_codec_write(codec, seq->nid, 0, seq->verb, seq->param);
99 hda_nid_t nid;
105 lookup_conn_list(struct hda_codec *codec, hda_nid_t nid)
109 if (p->nid == nid)
115 static int add_conn_list(struct hda_codec *codec, hda_nid_t nid, int len,
124 p->nid = nid;
141 static int read_and_add_raw_conns(struct hda_codec *codec, hda_nid_t nid)
147 len = snd_hda_get_raw_connections(codec, nid, list, ARRAY_SIZE(list));
149 len = snd_hda_get_num_raw_conns(codec, nid);
153 len = snd_hda_get_raw_connections(codec, nid, result, len);
156 len = snd_hda_override_conn_list(codec, nid, len, result);
165 * @nid: NID to parse
177 int snd_hda_get_conn_list(struct hda_codec *codec, hda_nid_t nid,
187 p = lookup_conn_list(codec, nid);
196 err = read_and_add_raw_conns(codec, nid);
207 * @nid: NID to parse
216 int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid,
220 int len = snd_hda_get_conn_list(codec, nid, &list);
225 len, nid);
238 * @nid: NID to parse
247 int snd_hda_override_conn_list(struct hda_codec *codec, hda_nid_t nid, int len,
252 p = lookup_conn_list(codec, nid);
258 return add_conn_list(codec, nid, len, list);
266 * @nid: NID to select
270 * widget @nid is present. If it is, return the connection index.
274 hda_nid_t nid, int recursive)
281 if (conn[i] == nid)
286 codec_dbg(codec, "too deep connection for 0x%x\n", nid);
294 if (snd_hda_get_conn_index(codec, conn[i], nid, recursive) >= 0)
304 * @nid: NID of the pin to parse
309 unsigned int snd_hda_get_num_devices(struct hda_codec *codec, hda_nid_t nid)
311 unsigned int wcaps = get_wcaps(codec, nid);
318 parm = snd_hdac_read_parm_uncached(&codec->core, nid, AC_PAR_DEVLIST_LEN);
328 * @nid: NID of the pin to parse
335 unsigned int snd_hda_get_devices(struct hda_codec *codec, hda_nid_t nid,
340 parm = snd_hda_get_num_devices(codec, nid);
348 if (snd_hdac_read(&codec->core, nid,
366 * @nid: NID of the pin to get device entry select
372 int snd_hda_get_dev_select(struct hda_codec *codec, hda_nid_t nid)
378 return snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_DEVICE_SEL, 0);
385 * @nid: NID of the pin to set device entry select
388 * Set the device entry select on the pin nid.
390 int snd_hda_set_dev_select(struct hda_codec *codec, hda_nid_t nid, int dev_id)
399 num_devices = snd_hda_get_num_devices(codec, nid) + 1;
413 ret = snd_hda_codec_write(codec, nid, 0,
426 hda_nid_t nid;
431 nid = codec->core.start_nid;
432 for (i = 0; i < codec->core.num_nodes; i++, nid++)
434 nid, AC_PAR_AUDIO_WIDGET_CAP);
441 hda_nid_t nid;
443 for_each_hda_codec_node(nid, codec) {
445 unsigned int wcaps = get_wcaps(codec, nid);
452 pin->nid = nid;
453 pin->cfg = snd_hda_codec_read(codec, nid, 0,
459 pin->ctrl = snd_hda_codec_read(codec, nid, 0,
469 hda_nid_t nid)
475 if (pin->nid == nid)
485 hda_nid_t nid, unsigned int cfg)
489 pin = look_up_pincfg(codec, list, nid);
494 pin->nid = nid;
503 * @nid: NID to set the pin config
511 hda_nid_t nid, unsigned int cfg)
513 return snd_hda_add_pincfg(codec, &codec->driver_pins, nid, cfg);
520 * @nid: NID to get the pin config
526 unsigned int snd_hda_codec_get_pincfg(struct hda_codec *codec, hda_nid_t nid)
534 pin = look_up_pincfg(codec, &codec->user_pins, nid);
542 pin = look_up_pincfg(codec, &codec->driver_pins, nid);
545 pin = look_up_pincfg(codec, &codec->init_pins, nid);
555 * @nid: pin NID
562 int snd_hda_codec_set_pin_target(struct hda_codec *codec, hda_nid_t nid,
567 pin = look_up_pincfg(codec, &codec->init_pins, nid);
578 * @nid: pin NID
580 int snd_hda_codec_get_pin_target(struct hda_codec *codec, hda_nid_t nid)
584 pin = look_up_pincfg(codec, &codec->init_pins, nid);
610 snd_hda_codec_read(codec, pin->nid, 0,
628 snd_hda_codec_write(codec, pin->nid, 0,
665 hda_nid_t nid;
675 get_hda_cvt_setup(struct hda_codec *codec, hda_nid_t nid)
681 if (p->nid == nid)
686 p->nid = nid;
1074 struct hda_cvt_setup *p, hda_nid_t nid,
1080 oldval = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0);
1083 snd_hda_codec_write(codec, nid, 0,
1093 hda_nid_t nid, int format)
1098 oldval = snd_hda_codec_read(codec, nid, 0,
1102 snd_hda_codec_write(codec, nid, 0,
1113 * @nid: the NID to set up
1118 void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
1128 if (!nid)
1133 nid, stream_tag, channel_id, format);
1134 p = get_hda_cvt_setup(codec, nid);
1139 driver->ops->stream_pm(codec, nid, true);
1141 update_pcm_format(codec, p, nid, format);
1142 update_pcm_stream_id(codec, p, nid, stream_tag, channel_id);
1144 update_pcm_format(codec, p, nid, format);
1150 type = get_wcaps_type(get_wcaps(codec, nid));
1154 get_wcaps_type(get_wcaps(c, p->nid)) == type)
1167 * @nid: the NID to clean up
1170 void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid,
1175 if (!nid)
1181 codec_dbg(codec, "hda_codec_cleanup_stream: NID=0x%x\n", nid);
1182 p = get_hda_cvt_setup(codec, nid);
1200 hda_nid_t nid = q->nid;
1203 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CHANNEL_STREAMID, 0);
1205 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, 0
1208 q->nid = nid;
1210 driver->ops->stream_pm(codec, nid, false);
1247 * @nid: the NID to query
1256 u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction)
1258 if (!(get_wcaps(codec, nid) & AC_WCAP_AMP_OVRD))
1259 nid = codec->core.afg;
1260 return snd_hda_param_read(codec, nid,
1269 * @nid: the NID to query
1275 bool snd_hda_check_amp_caps(struct hda_codec *codec, hda_nid_t nid,
1278 if (!nid)
1280 if (get_wcaps(codec, nid) & (1 << (dir + 1)))
1281 if (query_amp_caps(codec, nid, dir) & bits)
1290 * @nid: the NID to clean up
1300 int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
1305 snd_hda_override_wcaps(codec, nid,
1306 get_wcaps(codec, nid) | AC_WCAP_AMP_OVRD);
1308 return snd_hdac_override_parm(&codec->core, nid, parm, caps);
1312 static unsigned int encode_amp(struct hda_codec *codec, hda_nid_t nid,
1315 unsigned int cmd = snd_hdac_regmap_encode_amp(nid, ch, dir, idx);
1318 if ((query_amp_caps(codec, nid, dir) &
1327 * @nid: NID to read the AMP value
1336 int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid,
1339 unsigned int cmd = encode_amp(codec, nid, ch, dir, idx);
1348 * @nid: NID to read the AMP value
1357 int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid,
1365 ret |= snd_hda_codec_amp_update(codec, nid, ch, direction,
1374 * @nid: NID to read the AMP value
1385 int snd_hda_codec_amp_init(struct hda_codec *codec, hda_nid_t nid, int ch,
1388 unsigned int cmd = encode_amp(codec, nid, ch, dir, idx);
1399 * @nid: NID to read the AMP value
1407 int snd_hda_codec_amp_init_stereo(struct hda_codec *codec, hda_nid_t nid,
1415 ret |= snd_hda_codec_amp_init(codec, nid, ch, dir,
1421 static u32 get_amp_max_value(struct hda_codec *codec, hda_nid_t nid, int dir,
1424 u32 caps = query_amp_caps(codec, nid, dir);
1444 u16 nid = get_amp_nid(kcontrol);
1452 uinfo->value.integer.max = get_amp_max_value(codec, nid, dir, ofs);
1456 nid, kcontrol->id.name);
1465 read_amp_value(struct hda_codec *codec, hda_nid_t nid,
1469 val = snd_hda_codec_amp_read(codec, nid, ch, dir, idx);
1479 update_amp_value(struct hda_codec *codec, hda_nid_t nid,
1488 maxval = get_amp_max_value(codec, nid, dir, 0);
1491 return snd_hda_codec_amp_update(codec, nid, ch, dir, idx,
1507 hda_nid_t nid = get_amp_nid(kcontrol);
1515 *valp++ = read_amp_value(codec, nid, 0, dir, idx, ofs);
1517 *valp = read_amp_value(codec, nid, 1, dir, idx, ofs);
1534 hda_nid_t nid = get_amp_nid(kcontrol);
1544 err = update_amp_value(codec, nid, 0, dir, idx, ofs, *valp);
1551 err = update_amp_value(codec, nid, 1, dir, idx, ofs, *valp);
1564 hda_nid_t nid = get_amp_nid(kcontrol);
1570 caps = query_amp_caps(codec, nid, dir);
1611 * @nid: NID of a reference widget
1619 void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir,
1625 caps = query_amp_caps(codec, nid, dir);
1680 * @nid: corresponding NID (optional)
1688 * If non-zero @nid is passed, the NID is assigned to the control element.
1692 * #HDA_SUBDEV_NID_FLAG bit is set. If set (and @nid is zero), the lower
1696 int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid,
1705 if (nid == 0)
1706 nid = get_amp_nid_(kctl->private_value);
1708 if ((kctl->id.subdevice & HDA_SUBDEV_NID_FLAG) != 0 && nid == 0)
1709 nid = kctl->id.subdevice & 0xffff;
1719 item->nid = nid;
2080 hda_nid_t nid = get_amp_nid(kcontrol);
2087 *valp++ = (snd_hda_codec_amp_read(codec, nid, 0, dir, idx) &
2090 *valp = (snd_hda_codec_amp_read(codec, nid, 1, dir, idx) &
2108 hda_nid_t nid = get_amp_nid(kcontrol);
2118 change = snd_hda_codec_amp_update(codec, nid, 0, dir, idx,
2126 change |= snd_hda_codec_amp_update(codec, nid, 1, dir, idx,
2130 hda_call_check_power_status(codec, nid);
2241 static void set_dig_out(struct hda_codec *codec, hda_nid_t nid,
2246 snd_hdac_regmap_update(&codec->core, nid, AC_VERB_SET_DIGI_CONVERT_1,
2256 static inline void set_dig_out_convert(struct hda_codec *codec, hda_nid_t nid,
2270 set_dig_out(codec, nid, mask, val);
2279 hda_nid_t nid;
2287 nid = spdif->nid;
2296 if (change && nid != (u16)-1)
2297 set_dig_out_convert(codec, nid, val & 0xff, (val >> 8) & 0xff);
2318 static inline void set_spdif_ctls(struct hda_codec *codec, hda_nid_t nid,
2321 set_dig_out_convert(codec, nid, dig1, dig2);
2323 if ((get_wcaps(codec, nid) & AC_WCAP_OUT_AMP) &&
2325 snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
2335 hda_nid_t nid;
2343 nid = spdif->nid;
2349 if (change && nid != (u16)-1)
2350 set_spdif_ctls(codec, nid, val & 0xff, -1);
2452 spdif->nid = cvt_nid;
2464 * @nid: widget NID
2469 hda_nid_t nid)
2475 if (spdif->nid == nid)
2497 spdif->nid = (u16)-1;
2505 * @nid: widget NID
2509 void snd_hda_spdif_ctls_assign(struct hda_codec *codec, int idx, hda_nid_t nid)
2518 if (spdif->nid != nid) {
2519 spdif->nid = nid;
2521 set_spdif_ctls(codec, nid, val & 0xff, (val >> 8) & 0xff);
2593 hda_nid_t nid = kcontrol->private_value;
2601 snd_hdac_regmap_write(&codec->core, nid,
2611 hda_nid_t nid = kcontrol->private_value;
2615 snd_hdac_regmap_read(&codec->core, nid,
2646 * @nid: audio in widget NID
2653 int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid)
2669 kctl->private_value = nid;
2670 err = snd_hda_ctl_add(codec, nid, kctl);
2675 snd_hda_codec_read(codec, nid, 0,
2695 hda_nid_t nid;
2697 for_each_hda_codec_node(nid, codec) {
2698 unsigned int wcaps = get_wcaps(codec, nid);
2703 state = codec->power_filter(codec, nid, power_state);
2707 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_POWER_STATE,
2716 * @nid: widget NID
2723 hda_nid_t nid,
2726 if (nid == codec->core.afg || nid == codec->core.mfg)
2729 get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_PIN &&
2730 (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)) {
2731 int eapd = snd_hda_codec_read(codec, nid, 0,
2789 hda_nid_t nid;
2795 for_each_hda_codec_node(nid, codec) {
2796 unsigned int wcaps = get_wcaps(codec, nid);
2800 target = codec->power_filter(codec, nid, AC_PWRST_D0);
2803 if (!snd_hda_check_power_state(codec, nid, target))
2804 snd_hda_codec_write(codec, nid, 0,
3108 snd_hda_codec_setup_stream(codec, hinfo->nid, stream_tag, 0, format);
3116 snd_hda_codec_cleanup_stream(codec, hinfo->nid);
3126 if (info->nid && (!info->rates || !info->formats)) {
3127 err = snd_hda_query_supported_pcm(codec, info->nid,
3140 if (snd_BUG_ON(!info->nid))
3145 if (snd_BUG_ON(!info->nid))
3437 * @nid: NID to check / update
3448 hda_nid_t nid)
3455 for (p = check->amplist; p->nid; p++) {
3456 if (p->nid == nid)
3459 if (!p->nid)
3462 for (p = check->amplist; p->nid; p++) {
3464 v = snd_hda_codec_amp_read(codec, p->nid, ch, p->dir,
3515 * @nid: input mux NID
3521 hda_nid_t nid,
3533 snd_hda_codec_write_cache(codec, nid, 0, AC_VERB_SET_CONNECT_SEL,
3573 static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid,
3580 spdif = snd_hda_spdif_out_of_nid(codec, nid);
3587 curr_fmt = snd_hda_codec_read(codec, nid, 0,
3596 set_dig_out_convert(codec, nid,
3599 snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format);
3608 set_dig_out_convert(codec, nid,
3612 static void cleanup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid)
3614 snd_hda_codec_cleanup_stream(codec, nid);