Lines Matching refs:nid

81 	for (; seq->nid; seq++)  in snd_hda_sequence_write()
82 snd_hda_codec_write(codec, seq->nid, 0, seq->verb, seq->param); in snd_hda_sequence_write()
90 hda_nid_t nid; member
96 lookup_conn_list(struct hda_codec *codec, hda_nid_t nid) in lookup_conn_list() argument
100 if (p->nid == nid) in lookup_conn_list()
106 static int add_conn_list(struct hda_codec *codec, hda_nid_t nid, int len, in add_conn_list() argument
115 p->nid = nid; in add_conn_list()
132 static int read_and_add_raw_conns(struct hda_codec *codec, hda_nid_t nid) in read_and_add_raw_conns() argument
138 len = snd_hda_get_raw_connections(codec, nid, list, ARRAY_SIZE(list)); in read_and_add_raw_conns()
140 len = snd_hda_get_num_raw_conns(codec, nid); in read_and_add_raw_conns()
144 len = snd_hda_get_raw_connections(codec, nid, result, len); in read_and_add_raw_conns()
147 len = snd_hda_override_conn_list(codec, nid, len, result); in read_and_add_raw_conns()
168 int snd_hda_get_conn_list(struct hda_codec *codec, hda_nid_t nid, in snd_hda_get_conn_list() argument
178 p = lookup_conn_list(codec, nid); in snd_hda_get_conn_list()
187 err = read_and_add_raw_conns(codec, nid); in snd_hda_get_conn_list()
207 int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid, in snd_hda_get_connections() argument
211 int len = snd_hda_get_conn_list(codec, nid, &list); in snd_hda_get_connections()
216 len, nid); in snd_hda_get_connections()
238 int snd_hda_override_conn_list(struct hda_codec *codec, hda_nid_t nid, int len, in snd_hda_override_conn_list() argument
243 p = lookup_conn_list(codec, nid); in snd_hda_override_conn_list()
249 return add_conn_list(codec, nid, len, list); in snd_hda_override_conn_list()
265 hda_nid_t nid, int recursive) in snd_hda_get_conn_index() argument
272 if (conn[i] == nid) in snd_hda_get_conn_index()
277 codec_dbg(codec, "too deep connection for 0x%x\n", nid); in snd_hda_get_conn_index()
285 if (snd_hda_get_conn_index(codec, conn[i], nid, recursive) >= 0) in snd_hda_get_conn_index()
300 unsigned int snd_hda_get_num_devices(struct hda_codec *codec, hda_nid_t nid) in snd_hda_get_num_devices() argument
302 unsigned int wcaps = get_wcaps(codec, nid); in snd_hda_get_num_devices()
309 parm = snd_hdac_read_parm_uncached(&codec->core, nid, AC_PAR_DEVLIST_LEN); in snd_hda_get_num_devices()
326 int snd_hda_get_devices(struct hda_codec *codec, hda_nid_t nid, in snd_hda_get_devices() argument
332 parm = snd_hda_get_num_devices(codec, nid); in snd_hda_get_devices()
341 if (snd_hdac_read(&codec->core, nid, in snd_hda_get_devices()
365 int snd_hda_get_dev_select(struct hda_codec *codec, hda_nid_t nid) in snd_hda_get_dev_select() argument
371 return snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_DEVICE_SEL, 0); in snd_hda_get_dev_select()
383 int snd_hda_set_dev_select(struct hda_codec *codec, hda_nid_t nid, int dev_id) in snd_hda_set_dev_select() argument
392 num_devices = snd_hda_get_num_devices(codec, nid) + 1; in snd_hda_set_dev_select()
406 ret = snd_hda_codec_write(codec, nid, 0, in snd_hda_set_dev_select()
419 hda_nid_t nid; in read_widget_caps() local
424 nid = codec->core.start_nid; in read_widget_caps()
425 for (i = 0; i < codec->core.num_nodes; i++, nid++) in read_widget_caps()
427 nid, AC_PAR_AUDIO_WIDGET_CAP); in read_widget_caps()
434 hda_nid_t nid; in read_pin_defaults() local
436 for_each_hda_codec_node(nid, codec) { in read_pin_defaults()
438 unsigned int wcaps = get_wcaps(codec, nid); in read_pin_defaults()
445 pin->nid = nid; in read_pin_defaults()
446 pin->cfg = snd_hda_codec_read(codec, nid, 0, in read_pin_defaults()
452 pin->ctrl = snd_hda_codec_read(codec, nid, 0, in read_pin_defaults()
462 hda_nid_t nid) in look_up_pincfg() argument
468 if (pin->nid == nid) in look_up_pincfg()
478 hda_nid_t nid, unsigned int cfg) in snd_hda_add_pincfg() argument
491 pin = look_up_pincfg(codec, list, nid); in snd_hda_add_pincfg()
496 pin->nid = nid; in snd_hda_add_pincfg()
513 hda_nid_t nid, unsigned int cfg) in snd_hda_codec_set_pincfg() argument
515 return snd_hda_add_pincfg(codec, &codec->driver_pins, nid, cfg); in snd_hda_codec_set_pincfg()
528 unsigned int snd_hda_codec_get_pincfg(struct hda_codec *codec, hda_nid_t nid) in snd_hda_codec_get_pincfg() argument
536 pin = look_up_pincfg(codec, &codec->user_pins, nid); in snd_hda_codec_get_pincfg()
544 pin = look_up_pincfg(codec, &codec->driver_pins, nid); in snd_hda_codec_get_pincfg()
547 pin = look_up_pincfg(codec, &codec->init_pins, nid); in snd_hda_codec_get_pincfg()
564 int snd_hda_codec_set_pin_target(struct hda_codec *codec, hda_nid_t nid, in snd_hda_codec_set_pin_target() argument
569 pin = look_up_pincfg(codec, &codec->init_pins, nid); in snd_hda_codec_set_pin_target()
582 int snd_hda_codec_get_pin_target(struct hda_codec *codec, hda_nid_t nid) in snd_hda_codec_get_pin_target() argument
586 pin = look_up_pincfg(codec, &codec->init_pins, nid); in snd_hda_codec_get_pin_target()
612 snd_hda_codec_read(codec, pin->nid, 0, in snd_hda_shutup_pins()
631 snd_hda_codec_write(codec, pin->nid, 0, in restore_shutup_pins()
678 hda_nid_t nid; member
688 get_hda_cvt_setup(struct hda_codec *codec, hda_nid_t nid) in get_hda_cvt_setup() argument
694 if (p->nid == nid) in get_hda_cvt_setup()
699 p->nid = nid; in get_hda_cvt_setup()
1049 struct hda_cvt_setup *p, hda_nid_t nid, in update_pcm_stream_id() argument
1055 oldval = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0); in update_pcm_stream_id()
1058 snd_hda_codec_write(codec, nid, 0, in update_pcm_stream_id()
1068 hda_nid_t nid, int format) in update_pcm_format() argument
1073 oldval = snd_hda_codec_read(codec, nid, 0, in update_pcm_format()
1077 snd_hda_codec_write(codec, nid, 0, in update_pcm_format()
1093 void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, in snd_hda_codec_setup_stream() argument
1102 if (!nid) in snd_hda_codec_setup_stream()
1107 nid, stream_tag, channel_id, format); in snd_hda_codec_setup_stream()
1108 p = get_hda_cvt_setup(codec, nid); in snd_hda_codec_setup_stream()
1113 codec->patch_ops.stream_pm(codec, nid, true); in snd_hda_codec_setup_stream()
1115 update_pcm_format(codec, p, nid, format); in snd_hda_codec_setup_stream()
1116 update_pcm_stream_id(codec, p, nid, stream_tag, channel_id); in snd_hda_codec_setup_stream()
1118 update_pcm_format(codec, p, nid, format); in snd_hda_codec_setup_stream()
1124 type = get_wcaps_type(get_wcaps(codec, nid)); in snd_hda_codec_setup_stream()
1128 get_wcaps_type(get_wcaps(c, p->nid)) == type) in snd_hda_codec_setup_stream()
1144 void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid, in __snd_hda_codec_cleanup_stream() argument
1149 if (!nid) in __snd_hda_codec_cleanup_stream()
1155 codec_dbg(codec, "hda_codec_cleanup_stream: NID=0x%x\n", nid); in __snd_hda_codec_cleanup_stream()
1156 p = get_hda_cvt_setup(codec, nid); in __snd_hda_codec_cleanup_stream()
1173 hda_nid_t nid = q->nid; in really_cleanup_stream() local
1175 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CHANNEL_STREAMID, 0); in really_cleanup_stream()
1177 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, 0 in really_cleanup_stream()
1180 q->nid = nid; in really_cleanup_stream()
1182 codec->patch_ops.stream_pm(codec, nid, false); in really_cleanup_stream()
1230 u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction) in query_amp_caps() argument
1232 if (!(get_wcaps(codec, nid) & AC_WCAP_AMP_OVRD)) in query_amp_caps()
1233 nid = codec->core.afg; in query_amp_caps()
1234 return snd_hda_param_read(codec, nid, in query_amp_caps()
1249 bool snd_hda_check_amp_caps(struct hda_codec *codec, hda_nid_t nid, in snd_hda_check_amp_caps() argument
1252 if (!nid) in snd_hda_check_amp_caps()
1254 if (get_wcaps(codec, nid) & (1 << (dir + 1))) in snd_hda_check_amp_caps()
1255 if (query_amp_caps(codec, nid, dir) & bits) in snd_hda_check_amp_caps()
1274 int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, in snd_hda_override_amp_caps() argument
1279 snd_hda_override_wcaps(codec, nid, in snd_hda_override_amp_caps()
1280 get_wcaps(codec, nid) | AC_WCAP_AMP_OVRD); in snd_hda_override_amp_caps()
1282 return snd_hdac_override_parm(&codec->core, nid, parm, caps); in snd_hda_override_amp_caps()
1286 static unsigned int encode_amp(struct hda_codec *codec, hda_nid_t nid, in encode_amp() argument
1289 unsigned int cmd = snd_hdac_regmap_encode_amp(nid, ch, dir, idx); in encode_amp()
1292 if ((query_amp_caps(codec, nid, dir) & in encode_amp()
1310 int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, in snd_hda_codec_amp_update() argument
1313 unsigned int cmd = encode_amp(codec, nid, ch, dir, idx); in snd_hda_codec_amp_update()
1331 int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid, in snd_hda_codec_amp_stereo() argument
1339 ret |= snd_hda_codec_amp_update(codec, nid, ch, direction, in snd_hda_codec_amp_stereo()
1359 int snd_hda_codec_amp_init(struct hda_codec *codec, hda_nid_t nid, int ch, in snd_hda_codec_amp_init() argument
1362 unsigned int cmd = encode_amp(codec, nid, ch, dir, idx); in snd_hda_codec_amp_init()
1381 int snd_hda_codec_amp_init_stereo(struct hda_codec *codec, hda_nid_t nid, in snd_hda_codec_amp_init_stereo() argument
1389 ret |= snd_hda_codec_amp_init(codec, nid, ch, dir, in snd_hda_codec_amp_init_stereo()
1395 static u32 get_amp_max_value(struct hda_codec *codec, hda_nid_t nid, int dir, in get_amp_max_value() argument
1398 u32 caps = query_amp_caps(codec, nid, dir); in get_amp_max_value()
1418 u16 nid = get_amp_nid(kcontrol); in snd_hda_mixer_amp_volume_info() local
1426 uinfo->value.integer.max = get_amp_max_value(codec, nid, dir, ofs); in snd_hda_mixer_amp_volume_info()
1430 nid, kcontrol->id.name); in snd_hda_mixer_amp_volume_info()
1439 read_amp_value(struct hda_codec *codec, hda_nid_t nid, in read_amp_value() argument
1443 val = snd_hda_codec_amp_read(codec, nid, ch, dir, idx); in read_amp_value()
1453 update_amp_value(struct hda_codec *codec, hda_nid_t nid, in update_amp_value() argument
1462 maxval = get_amp_max_value(codec, nid, dir, 0); in update_amp_value()
1465 return snd_hda_codec_amp_update(codec, nid, ch, dir, idx, in update_amp_value()
1481 hda_nid_t nid = get_amp_nid(kcontrol); in snd_hda_mixer_amp_volume_get() local
1489 *valp++ = read_amp_value(codec, nid, 0, dir, idx, ofs); in snd_hda_mixer_amp_volume_get()
1491 *valp = read_amp_value(codec, nid, 1, dir, idx, ofs); in snd_hda_mixer_amp_volume_get()
1508 hda_nid_t nid = get_amp_nid(kcontrol); in snd_hda_mixer_amp_volume_put() local
1517 change = update_amp_value(codec, nid, 0, dir, idx, ofs, *valp); in snd_hda_mixer_amp_volume_put()
1521 change |= update_amp_value(codec, nid, 1, dir, idx, ofs, *valp); in snd_hda_mixer_amp_volume_put()
1530 hda_nid_t nid = get_amp_nid(kcontrol); in get_ctl_amp_tlv() local
1536 caps = query_amp_caps(codec, nid, dir); in get_ctl_amp_tlv()
1585 void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir, in snd_hda_set_vmaster_tlv() argument
1591 caps = query_amp_caps(codec, nid, dir); in snd_hda_set_vmaster_tlv()
1662 int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid, in snd_hda_ctl_add() argument
1671 if (nid == 0) in snd_hda_ctl_add()
1672 nid = get_amp_nid_(kctl->private_value); in snd_hda_ctl_add()
1674 if ((kctl->id.subdevice & HDA_SUBDEV_NID_FLAG) != 0 && nid == 0) in snd_hda_ctl_add()
1675 nid = kctl->id.subdevice & 0xffff; in snd_hda_ctl_add()
1685 item->nid = nid; in snd_hda_ctl_add()
1703 unsigned int index, hda_nid_t nid) in snd_hda_add_nid() argument
1707 if (nid > 0) { in snd_hda_add_nid()
1713 item->nid = nid; in snd_hda_add_nid()
2080 hda_nid_t nid = get_amp_nid(kcontrol); in snd_hda_mixer_amp_switch_get() local
2087 *valp++ = (snd_hda_codec_amp_read(codec, nid, 0, dir, idx) & in snd_hda_mixer_amp_switch_get()
2090 *valp = (snd_hda_codec_amp_read(codec, nid, 1, dir, idx) & in snd_hda_mixer_amp_switch_get()
2108 hda_nid_t nid = get_amp_nid(kcontrol); in snd_hda_mixer_amp_switch_put() local
2116 change = snd_hda_codec_amp_update(codec, nid, 0, dir, idx, in snd_hda_mixer_amp_switch_put()
2122 change |= snd_hda_codec_amp_update(codec, nid, 1, dir, idx, in snd_hda_mixer_amp_switch_put()
2125 hda_call_check_power_status(codec, nid); in snd_hda_mixer_amp_switch_put()
2237 static void set_dig_out(struct hda_codec *codec, hda_nid_t nid, in set_dig_out() argument
2242 snd_hdac_regmap_update(&codec->core, nid, AC_VERB_SET_DIGI_CONVERT_1, in set_dig_out()
2252 static inline void set_dig_out_convert(struct hda_codec *codec, hda_nid_t nid, in set_dig_out_convert() argument
2266 set_dig_out(codec, nid, mask, val); in set_dig_out_convert()
2275 hda_nid_t nid; in snd_hda_spdif_default_put() local
2283 nid = spdif->nid; in snd_hda_spdif_default_put()
2292 if (change && nid != (u16)-1) in snd_hda_spdif_default_put()
2293 set_dig_out_convert(codec, nid, val & 0xff, (val >> 8) & 0xff); in snd_hda_spdif_default_put()
2316 static inline void set_spdif_ctls(struct hda_codec *codec, hda_nid_t nid, in set_spdif_ctls() argument
2319 set_dig_out_convert(codec, nid, dig1, dig2); in set_spdif_ctls()
2321 if ((get_wcaps(codec, nid) & AC_WCAP_OUT_AMP) && in set_spdif_ctls()
2323 snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0, in set_spdif_ctls()
2333 hda_nid_t nid; in snd_hda_spdif_out_switch_put() local
2341 nid = spdif->nid; in snd_hda_spdif_out_switch_put()
2347 if (change && nid != (u16)-1) in snd_hda_spdif_out_switch_put()
2348 set_spdif_ctls(codec, nid, val & 0xff, -1); in snd_hda_spdif_out_switch_put()
2445 spdif->nid = cvt_nid; in snd_hda_create_dig_out_ctls()
2462 hda_nid_t nid) in snd_hda_spdif_out_of_nid() argument
2468 if (spdif->nid == nid) in snd_hda_spdif_out_of_nid()
2490 spdif->nid = (u16)-1; in snd_hda_spdif_ctls_unassign()
2503 void snd_hda_spdif_ctls_assign(struct hda_codec *codec, int idx, hda_nid_t nid) in snd_hda_spdif_ctls_assign() argument
2512 if (spdif->nid != nid) { in snd_hda_spdif_ctls_assign()
2513 spdif->nid = nid; in snd_hda_spdif_ctls_assign()
2515 set_spdif_ctls(codec, nid, val & 0xff, (val >> 8) & 0xff); in snd_hda_spdif_ctls_assign()
2588 hda_nid_t nid = kcontrol->private_value; in snd_hda_spdif_in_switch_put() local
2596 snd_hdac_regmap_write(&codec->core, nid, in snd_hda_spdif_in_switch_put()
2607 hda_nid_t nid = kcontrol->private_value; in snd_hda_spdif_in_status_get() local
2611 snd_hdac_regmap_read(&codec->core, nid, in snd_hda_spdif_in_status_get()
2649 int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid) in snd_hda_create_spdif_in_ctls() argument
2665 kctl->private_value = nid; in snd_hda_create_spdif_in_ctls()
2666 err = snd_hda_ctl_add(codec, nid, kctl); in snd_hda_create_spdif_in_ctls()
2671 snd_hda_codec_read(codec, nid, 0, in snd_hda_create_spdif_in_ctls()
2691 hda_nid_t nid; in snd_hda_codec_set_power_to_all() local
2693 for_each_hda_codec_node(nid, codec) { in snd_hda_codec_set_power_to_all()
2694 unsigned int wcaps = get_wcaps(codec, nid); in snd_hda_codec_set_power_to_all()
2699 state = codec->power_filter(codec, nid, power_state); in snd_hda_codec_set_power_to_all()
2703 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_POWER_STATE, in snd_hda_codec_set_power_to_all()
2719 hda_nid_t nid, in snd_hda_codec_eapd_power_filter() argument
2722 if (nid == codec->core.afg || nid == codec->core.mfg) in snd_hda_codec_eapd_power_filter()
2725 get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_PIN && in snd_hda_codec_eapd_power_filter()
2726 (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)) { in snd_hda_codec_eapd_power_filter()
2727 int eapd = snd_hda_codec_read(codec, nid, 0, in snd_hda_codec_eapd_power_filter()
2784 hda_nid_t nid; in sync_power_up_states() local
2790 for_each_hda_codec_node(nid, codec) { in sync_power_up_states()
2791 unsigned int wcaps = get_wcaps(codec, nid); in sync_power_up_states()
2795 target = codec->power_filter(codec, nid, AC_PWRST_D0); in sync_power_up_states()
2798 if (!snd_hda_check_power_state(codec, nid, target)) in sync_power_up_states()
2799 snd_hda_codec_write(codec, nid, 0, in sync_power_up_states()
3080 snd_hda_codec_setup_stream(codec, hinfo->nid, stream_tag, 0, format); in hda_pcm_default_prepare()
3088 snd_hda_codec_cleanup_stream(codec, hinfo->nid); in hda_pcm_default_cleanup()
3098 if (info->nid && (!info->rates || !info->formats)) { in set_pcm_default_values()
3099 err = snd_hda_query_supported_pcm(codec, info->nid, in set_pcm_default_values()
3111 if (snd_BUG_ON(!info->nid)) in set_pcm_default_values()
3116 if (snd_BUG_ON(!info->nid)) in set_pcm_default_values()
3407 hda_nid_t nid) in snd_hda_check_amp_list_power() argument
3414 for (p = check->amplist; p->nid; p++) { in snd_hda_check_amp_list_power()
3415 if (p->nid == nid) in snd_hda_check_amp_list_power()
3418 if (!p->nid) in snd_hda_check_amp_list_power()
3421 for (p = check->amplist; p->nid; p++) { in snd_hda_check_amp_list_power()
3423 v = snd_hda_codec_amp_read(codec, p->nid, ch, p->dir, in snd_hda_check_amp_list_power()
3481 hda_nid_t nid, in snd_hda_input_mux_put() argument
3493 snd_hda_codec_write_cache(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, in snd_hda_input_mux_put()
3533 static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid, in setup_dig_out_stream() argument
3540 spdif = snd_hda_spdif_out_of_nid(codec, nid); in setup_dig_out_stream()
3547 curr_fmt = snd_hda_codec_read(codec, nid, 0, in setup_dig_out_stream()
3556 set_dig_out_convert(codec, nid, in setup_dig_out_stream()
3559 snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format); in setup_dig_out_stream()
3568 set_dig_out_convert(codec, nid, in setup_dig_out_stream()
3572 static void cleanup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid) in cleanup_dig_out_stream() argument
3574 snd_hda_codec_cleanup_stream(codec, nid); in cleanup_dig_out_stream()