• Home
  • Raw
  • Download

Lines Matching refs:idx

291 	ssize_t idx;  in snd_hda_get_path_idx()  local
295 idx = path - array; in snd_hda_get_path_idx()
296 if (idx < 0 || idx >= spec->paths.used) in snd_hda_get_path_idx()
298 return idx + 1; in snd_hda_get_path_idx()
308 struct nid_path *snd_hda_get_path_from_idx(struct hda_codec *codec, int idx) in snd_hda_get_path_from_idx() argument
312 if (idx <= 0 || idx > spec->paths.used) in snd_hda_get_path_from_idx()
314 return snd_array_elem(&spec->paths, idx - 1); in snd_hda_get_path_from_idx()
361 int dir, int idx, int type) in is_ctl_associated() argument
363 unsigned int val = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir); in is_ctl_associated()
428 path->idx[path->depth + 1] = i; in __parse_nid_path()
504 static void invalidate_nid_path(struct hda_codec *codec, int idx) in invalidate_nid_path() argument
506 struct nid_path *path = snd_hda_get_path_from_idx(codec, idx); in invalidate_nid_path()
602 static bool has_amp_in(struct hda_codec *codec, struct nid_path *path, int idx) in has_amp_in() argument
604 hda_nid_t nid = path->path[idx]; in has_amp_in()
610 if (type == AC_WID_PIN && idx > 0) /* only for input pins */ in has_amp_in()
616 static bool has_amp_out(struct hda_codec *codec, struct nid_path *path, int idx) in has_amp_out() argument
618 hda_nid_t nid = path->path[idx]; in has_amp_out()
624 if (type == AC_WID_PIN && !idx) /* only for output pins */ in has_amp_out()
631 unsigned int dir, unsigned int idx) in is_active_nid() argument
654 if (dir == HDA_OUTPUT || idx == -1 || in is_active_nid()
655 path->idx[i] == idx) in is_active_nid()
704 static void init_amp(struct hda_codec *codec, hda_nid_t nid, int dir, int idx) in init_amp() argument
710 snd_hda_codec_amp_init_stereo(codec, nid, dir, idx, 0xff, val); in init_amp()
712 snd_hda_codec_amp_init(codec, nid, 0, dir, idx, 0xff, val); in init_amp()
716 static int update_amp(struct hda_codec *codec, hda_nid_t nid, int dir, int idx, in update_amp() argument
720 return snd_hda_codec_amp_stereo(codec, nid, dir, idx, in update_amp()
723 return snd_hda_codec_amp_update(codec, nid, 0, dir, idx, in update_amp()
731 hda_nid_t nid, int dir, int idx, in get_amp_mask_to_modify() argument
737 if (is_ctl_associated(codec, nid, dir, idx, NID_PATH_MUTE_CTL)) in get_amp_mask_to_modify()
741 if (is_ctl_associated(codec, nid, dir, idx, NID_PATH_VOL_CTL) || in get_amp_mask_to_modify()
742 is_ctl_associated(codec, nid, dir, idx, NID_PATH_BOOST_CTL)) in get_amp_mask_to_modify()
749 int idx, int idx_to_check, bool enable) in activate_amp() argument
761 update_amp(codec, nid, dir, idx, mask, val); in activate_amp()
765 int dir, int idx, int idx_to_check, in check_and_activate_amp() argument
771 activate_amp(codec, nid, dir, idx, idx_to_check, enable); in check_and_activate_amp()
787 int n, nums, idx; in activate_amp_in() local
798 idx = 0; in activate_amp_in()
800 idx = path->idx[i]; in activate_amp_in()
809 if (n != idx) { in activate_amp_in()
818 check_and_activate_amp(codec, nid, HDA_INPUT, n, idx, enable); in activate_amp_in()
897 path->idx[i]); in snd_hda_activate_path()
1342 static hda_nid_t get_primary_out(struct hda_codec *codec, int idx) in get_primary_out() argument
1347 if (cfg->line_outs > idx) in get_primary_out()
1348 return spec->private_dac_nids[idx]; in get_primary_out()
1349 idx -= cfg->line_outs; in get_primary_out()
1350 if (spec->multi_ios > idx) in get_primary_out()
1351 return spec->multi_io[idx].dac; in get_primary_out()
1684 int i, idx; in indep_hp_possible() local
1687 idx = spec->out_paths[0]; in indep_hp_possible()
1689 idx = spec->hp_paths[0]; in indep_hp_possible()
1690 path = snd_hda_get_path_from_idx(codec, idx); in indep_hp_possible()
1700 if (spec->out_paths[i] == idx) in indep_hp_possible()
1899 const char *pfx, int idx) in print_nid_path_idx() argument
1903 path = snd_hda_get_path_from_idx(codec, idx); in print_nid_path_idx()
2178 int err, idx = 0; in create_extra_outs() local
2188 idx = i; in create_extra_outs()
2190 err = create_extra_out(codec, paths[i], name, idx); in create_extra_outs()
2351 get_multiio_path(struct hda_codec *codec, int idx) in get_multiio_path() argument
2355 spec->out_paths[spec->autocfg.line_outs + idx]); in get_multiio_path()
2368 static int set_multi_io(struct hda_codec *codec, int idx, bool output) in set_multi_io() argument
2371 hda_nid_t nid = spec->multi_io[idx].pin; in set_multi_io()
2374 path = get_multiio_path(codec, idx); in set_multi_io()
2388 set_pin_target(codec, nid, spec->multi_io[idx].ctl_in, true); in set_multi_io()
2701 static bool find_kctl_name(struct hda_codec *codec, const char *name, int idx) in find_kctl_name() argument
2708 if (!strcmp(kctl->name, name) && kctl->index == idx) in find_kctl_name()
2718 int idx = 0; in get_jack_mode_name() local
2720 snd_hda_get_pin_label(codec, pin, &spec->autocfg, name, name_len, &idx); in get_jack_mode_name()
2723 for (; find_kctl_name(codec, name, idx); idx++) in get_jack_mode_name()
2802 static int cvt_from_vref_idx(unsigned int vref_caps, unsigned int idx) in cvt_from_vref_idx() argument
2807 if (i == idx) in cvt_from_vref_idx()
2836 unsigned int idx; in in_jack_mode_get() local
2838 idx = snd_hda_codec_get_pin_target(codec, nid) & AC_PINCTL_VREFEN; in in_jack_mode_get()
2839 ucontrol->value.enumerated.item[0] = cvt_from_vref_idx(vref_caps, idx); in in_jack_mode_get()
2849 unsigned int val, idx; in in_jack_mode_put() local
2852 idx = cvt_from_vref_idx(vref_caps, val & AC_PINCTL_VREFEN); in in_jack_mode_put()
2853 if (idx == ucontrol->value.enumerated.item[0]) in in_jack_mode_put()
2916 int idx; in hp_mic_jack_mode_info() local
2923 idx = uinfo->value.enumerated.item; in hp_mic_jack_mode_info()
2924 if (idx < out_jacks) { in hp_mic_jack_mode_info()
2926 text = out_jack_texts[idx]; in hp_mic_jack_mode_info()
2930 idx -= out_jacks; in hp_mic_jack_mode_info()
2933 text = vref_texts[get_vref_idx(vref_caps, idx)]; in hp_mic_jack_mode_info()
2947 int idx = 0; in get_cur_hp_mic_jack_mode() local
2951 idx = 1; in get_cur_hp_mic_jack_mode()
2953 idx = out_jacks; in get_cur_hp_mic_jack_mode()
2957 idx += cvt_from_vref_idx(vref_caps, val); in get_cur_hp_mic_jack_mode()
2960 return idx; in get_cur_hp_mic_jack_mode()
2980 unsigned int val, oldval, idx; in hp_mic_jack_mode_put() local
2983 idx = ucontrol->value.enumerated.item[0]; in hp_mic_jack_mode_put()
2984 if (oldval == idx) in hp_mic_jack_mode_put()
2987 if (idx < out_jacks) { in hp_mic_jack_mode_put()
2989 val = idx ? PIN_HP : PIN_OUT; in hp_mic_jack_mode_put()
2993 idx -= out_jacks; in hp_mic_jack_mode_put()
2998 val |= get_vref_idx(vref_caps, idx) | PIN_IN; in hp_mic_jack_mode_put()
3034 static int add_loopback_list(struct hda_gen_spec *spec, hda_nid_t mix, int idx) in add_loopback_list() argument
3043 list->idx = idx; in add_loopback_list()
3055 int idx, num_conns; in look_for_mix_leaf_ctls() local
3059 idx = snd_hda_get_conn_index(codec, mix_nid, pin, true); in look_for_mix_leaf_ctls()
3060 if (idx < 0) in look_for_mix_leaf_ctls()
3065 *mix_val = HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT); in look_for_mix_leaf_ctls()
3067 *mute_val = HDA_COMPOSE_AMP_VAL(mix_nid, 3, idx, HDA_INPUT); in look_for_mix_leaf_ctls()
3073 if (num_conns < idx) in look_for_mix_leaf_ctls()
3075 nid = list[idx]; in look_for_mix_leaf_ctls()
3094 int err, idx; in new_analog_input() local
3105 idx = path->idx[path->depth - 1]; in new_analog_input()
3122 err = add_loopback_list(spec, mix_nid, idx); in new_analog_input()
3299 int j, idx; in fill_input_pin_labels() local
3305 idx = 0; in fill_input_pin_labels()
3309 idx = spec->input_label_idxs[j] + 1; in fill_input_pin_labels()
3315 spec->input_label_idxs[i] = idx; in fill_input_pin_labels()
3413 unsigned int idx);
3553 int idx = path->idx[i]; in parse_capvol_in_path() local
3555 idx = 0; in parse_capvol_in_path()
3557 HDA_COMPOSE_AMP_VAL(nid, 3, idx, HDA_INPUT); in parse_capvol_in_path()
3565 int idx = path->idx[i]; in parse_capvol_in_path() local
3567 idx = 0; in parse_capvol_in_path()
3569 HDA_COMPOSE_AMP_VAL(nid, 3, idx, HDA_INPUT); in parse_capvol_in_path()
3615 int idx, bool is_switch, unsigned int ctl, in add_single_cap_ctl() argument
3634 knew = add_control(spec, type, tmpname, idx, in add_single_cap_ctl()
3650 knew = add_control(spec, type, tmpname, idx, in add_single_cap_ctl()
3660 static int create_single_cap_vol_ctl(struct hda_codec *codec, int idx, in create_single_cap_vol_ctl() argument
3665 err = add_single_cap_ctl(codec, NULL, idx, false, vol_ctl, inv_dmic); in create_single_cap_vol_ctl()
3668 err = add_single_cap_ctl(codec, NULL, idx, true, sw_ctl, inv_dmic); in create_single_cap_vol_ctl()
3675 static int create_bind_cap_vol_ctl(struct hda_codec *codec, int idx, in create_bind_cap_vol_ctl() argument
3685 knew->index = idx; in create_bind_cap_vol_ctl()
3693 knew->index = idx; in create_bind_cap_vol_ctl()
3701 static unsigned int get_first_cap_ctl(struct hda_codec *codec, int idx, int type) in get_first_cap_ctl() argument
3707 path = get_input_path(codec, 0, idx); in get_first_cap_ctl()
3713 for (i = 0; i < idx - 1; i++) { in get_first_cap_ctl()
3730 int idx; in create_multi_cap_vol_ctl() local
3732 idx = imux->items[i].index; in create_multi_cap_vol_ctl()
3733 if (idx >= spec->autocfg.num_inputs) in create_multi_cap_vol_ctl()
3739 spec->input_labels[idx], in create_multi_cap_vol_ctl()
3740 spec->input_label_idxs[idx], in create_multi_cap_vol_ctl()
3825 int dir, int idx) in check_boost_vol() argument
3830 is_ctl_associated(codec, nid, dir, idx, NID_PATH_VOL_CTL) || in check_boost_vol()
3831 is_ctl_associated(codec, nid, dir, idx, NID_PATH_BOOST_CTL)) in check_boost_vol()
3857 path->idx[depth])) { in look_for_boost_amp()
3858 val = HDA_COMPOSE_AMP_VAL(nid, 3, path->idx[depth], in look_for_boost_amp()
3880 int idx; in parse_mic_boost() local
3883 idx = imux->items[i].index; in parse_mic_boost()
3884 if (idx >= imux->num_items) in parse_mic_boost()
3888 if (cfg->inputs[idx].type > AUTO_PIN_LINE_IN) in parse_mic_boost()
3901 "%s Boost Volume", spec->input_labels[idx]); in parse_mic_boost()
3903 spec->input_label_idxs[idx], val)) in parse_mic_boost()
3923 int idx = micmute ? LED_AUDIO_MICMUTE : LED_AUDIO_MUTE; in create_mute_led_cdev() local
3934 cdev->brightness = ledtrig_audio_get(idx); in create_mute_led_cdev()
3940 spec->led_cdevs[idx] = cdev; in create_mute_led_cdev()
4201 unsigned int idx) in mux_select() argument
4211 if (idx >= imux->num_items) in mux_select()
4212 idx = imux->num_items - 1; in mux_select()
4213 if (spec->cur_mux[adc_idx] == idx) in mux_select()
4222 spec->cur_mux[adc_idx] = idx; in mux_select()
4228 dyn_adc_pcm_resetup(codec, idx); in mux_select()
4230 path = get_input_path(codec, adc_idx, idx); in mux_select()
4695 mux_select(codec, 0, spec->am_entry[i].idx); in snd_hda_gen_mic_autoswitch()
4699 mux_select(codec, 0, spec->am_entry[0].idx); in snd_hda_gen_mic_autoswitch()
4917 spec->am_entry[i].idx = in auto_mic_check_imux()
4920 if (spec->am_entry[i].idx < 0) in auto_mic_check_imux()
5002 spec->cur_mux[0] = spec->am_entry[0].idx; in check_auto_mic_availability()