Lines Matching defs:val

108 	int val;
110 val = snd_hda_get_bool_hint(codec, "jack_detect");
111 if (val >= 0)
112 codec->no_jack_detect = !val;
113 val = snd_hda_get_bool_hint(codec, "inv_jack_detect");
114 if (val >= 0)
115 codec->inv_jack_detect = !!val;
116 val = snd_hda_get_bool_hint(codec, "trigger_sense");
117 if (val >= 0)
118 codec->no_trigger_sense = !val;
119 val = snd_hda_get_bool_hint(codec, "inv_eapd");
120 if (val >= 0)
121 codec->inv_eapd = !!val;
122 val = snd_hda_get_bool_hint(codec, "pcm_format_first");
123 if (val >= 0)
124 codec->pcm_format_first = !!val;
125 val = snd_hda_get_bool_hint(codec, "sticky_stream");
126 if (val >= 0)
127 codec->no_sticky_stream = !val;
128 val = snd_hda_get_bool_hint(codec, "spdif_status_reset");
129 if (val >= 0)
130 codec->spdif_status_reset = !!val;
131 val = snd_hda_get_bool_hint(codec, "pin_amp_workaround");
132 if (val >= 0)
133 codec->pin_amp_workaround = !!val;
134 val = snd_hda_get_bool_hint(codec, "single_adc_amp");
135 if (val >= 0)
136 codec->single_adc_amp = !!val;
137 val = snd_hda_get_bool_hint(codec, "power_save_node");
138 if (val >= 0)
139 codec->power_save_node = !!val;
141 val = snd_hda_get_bool_hint(codec, "auto_mute");
142 if (val >= 0)
143 spec->suppress_auto_mute = !val;
144 val = snd_hda_get_bool_hint(codec, "auto_mic");
145 if (val >= 0)
146 spec->suppress_auto_mic = !val;
147 val = snd_hda_get_bool_hint(codec, "line_in_auto_switch");
148 if (val >= 0)
149 spec->line_in_auto_switch = !!val;
150 val = snd_hda_get_bool_hint(codec, "auto_mute_via_amp");
151 if (val >= 0)
152 spec->auto_mute_via_amp = !!val;
153 val = snd_hda_get_bool_hint(codec, "need_dac_fix");
154 if (val >= 0)
155 spec->need_dac_fix = !!val;
156 val = snd_hda_get_bool_hint(codec, "primary_hp");
157 if (val >= 0)
158 spec->no_primary_hp = !val;
159 val = snd_hda_get_bool_hint(codec, "multi_io");
160 if (val >= 0)
161 spec->no_multi_io = !val;
162 val = snd_hda_get_bool_hint(codec, "multi_cap_vol");
163 if (val >= 0)
164 spec->multi_cap_vol = !!val;
165 val = snd_hda_get_bool_hint(codec, "inv_dmic_split");
166 if (val >= 0)
167 spec->inv_dmic_split = !!val;
168 val = snd_hda_get_bool_hint(codec, "indep_hp");
169 if (val >= 0)
170 spec->indep_hp = !!val;
171 val = snd_hda_get_bool_hint(codec, "add_stereo_mix_input");
172 if (val >= 0)
173 spec->add_stereo_mix_input = !!val;
175 val = snd_hda_get_bool_hint(codec, "add_out_jack_modes");
176 if (val >= 0)
177 spec->add_jack_modes = !!val;
178 val = snd_hda_get_bool_hint(codec, "add_in_jack_modes");
179 if (val >= 0)
180 spec->add_jack_modes = !!val;
181 val = snd_hda_get_bool_hint(codec, "add_jack_modes");
182 if (val >= 0)
183 spec->add_jack_modes = !!val;
184 val = snd_hda_get_bool_hint(codec, "power_down_unused");
185 if (val >= 0)
186 spec->power_down_unused = !!val;
187 val = snd_hda_get_bool_hint(codec, "add_hp_mic");
188 if (val >= 0)
189 spec->hp_mic = !!val;
190 val = snd_hda_get_bool_hint(codec, "hp_mic_detect");
191 if (val >= 0)
192 spec->suppress_hp_mic_detect = !val;
193 val = snd_hda_get_bool_hint(codec, "vmaster");
194 if (val >= 0)
195 spec->suppress_vmaster = !val;
197 if (!snd_hda_get_int_hint(codec, "mixer_nid", &val))
198 spec->mixer_nid = val;
205 #define update_pin_ctl(codec, pin, val) \
207 AC_VERB_SET_PIN_WIDGET_CONTROL, val)
217 unsigned int val, bool do_write)
221 val = snd_hda_correct_pin_ctl(codec, pin, val);
222 snd_hda_codec_set_pin_target(codec, pin, val);
224 update_pin_ctl(codec, pin, val);
229 hda_nid_t *pins, unsigned int val)
233 set_pin_target(codec, pins[i], val, false);
345 static bool is_ctl_used(struct hda_codec *codec, unsigned int val, int type)
351 val &= AMP_VAL_COMPARE_MASK;
353 if ((path->ctls[type] & AMP_VAL_COMPARE_MASK) == val)
363 unsigned int val = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
364 return is_ctl_used(codec, val, type);
548 static unsigned int amp_val_replace_channels(unsigned int val, unsigned int chs)
550 val &= ~(0x3U << 16);
551 val |= chs << 16;
552 return val;
672 unsigned int val = 0;
677 val = (caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT;
681 val |= HDA_AMP_MUTE;
683 return val;
707 int val = get_amp_val_to_activate(codec, nid, dir, caps, false);
710 snd_hda_codec_amp_init_stereo(codec, nid, dir, idx, 0xff, val);
712 snd_hda_codec_amp_init(codec, nid, 0, dir, idx, 0xff, val);
717 unsigned int mask, unsigned int val)
721 mask, val);
724 mask, val);
752 unsigned int mask, val;
755 val = get_amp_val_to_activate(codec, nid, dir, caps, enable);
760 val &= mask;
761 update_amp(codec, nid, dir, idx, mask, val);
980 int cidx, unsigned long val)
988 if (get_amp_nid_(val))
992 knew->private_value = val;
998 const char *sfx, int cidx, unsigned long val)
1006 if (!add_control(spec, type, name, cidx, val))
1011 #define add_pb_vol_ctrl(spec, type, pfx, val) \
1012 add_control_with_pfx(spec, type, pfx, "Playback", "Volume", 0, val)
1013 #define add_pb_sw_ctrl(spec, type, pfx, val) \
1014 add_control_with_pfx(spec, type, pfx, "Playback", "Switch", 0, val)
1015 #define __add_pb_vol_ctrl(spec, type, pfx, cidx, val) \
1016 add_control_with_pfx(spec, type, pfx, "Playback", "Volume", cidx, val)
1017 #define __add_pb_sw_ctrl(spec, type, pfx, cidx, val) \
1018 add_control_with_pfx(spec, type, pfx, "Playback", "Switch", cidx, val)
1023 unsigned int val;
1026 val = path->ctls[NID_PATH_VOL_CTL];
1027 if (!val)
1029 val = amp_val_replace_channels(val, chs);
1030 return __add_pb_vol_ctrl(codec->spec, HDA_CTL_WIDGET_VOL, pfx, cidx, val);
1059 unsigned int val;
1064 val = path->ctls[NID_PATH_MUTE_CTL];
1065 if (!val)
1067 val = amp_val_replace_channels(val, chs);
1068 if (get_amp_direction_(val) == HDA_INPUT) {
1069 hda_nid_t nid = get_amp_nid_(val);
1073 val |= nums << 19;
1076 return __add_pb_sw_ctrl(codec->spec, type, pfx, cidx, val);
1289 unsigned int val;
1301 val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT);
1303 val |= HDA_AMP_VAL_MIN_MUTE;
1304 if (is_ctl_used(codec, val, NID_PATH_VOL_CTL))
1307 path->ctls[NID_PATH_VOL_CTL] = val;
1315 val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT);
1317 val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT);
1318 if (is_ctl_used(codec, val, NID_PATH_MUTE_CTL))
1321 path->ctls[NID_PATH_MUTE_CTL] = val;
1990 unsigned int val;
2085 val = PIN_HP;
2087 val = PIN_OUT;
2088 set_pin_targets(codec, cfg->line_outs, cfg->line_out_pins, val);
2092 val = spec->prefer_hp_amp ? PIN_HP : PIN_OUT;
2094 cfg->speaker_pins, val);
2512 unsigned int val = ucontrol->value.enumerated.item[0];
2514 if (val == spec->aamix_mode)
2516 spec->aamix_mode = val;
2518 update_aamix_paths(codec, val, spec->out_paths[0],
2521 update_aamix_paths(codec, val, spec->hp_paths[0],
2524 update_aamix_paths(codec, val, spec->speaker_paths[0],
2569 unsigned int val;
2576 val = snd_hda_codec_get_pin_target(codec, pin);
2578 if (val & PIN_IN)
2581 if (val & PIN_OUT)
2586 val = snd_hda_get_default_vref(codec, pin);
2590 if (val == AC_PINCTL_VREF_HIZ && spec->shared_mic_vref_pin) {
2600 val |= PIN_IN;
2602 val = PIN_HP;
2603 set_pin_target(codec, pin, val, true);
2691 unsigned int val;
2693 val = ucontrol->value.enumerated.item[0] ? PIN_HP : PIN_OUT;
2694 if (snd_hda_codec_get_pin_target(codec, nid) == val)
2696 snd_hda_set_pin_ctl_cache(codec, nid, val);
2855 unsigned int val, idx;
2857 val = snd_hda_codec_get_pin_target(codec, nid);
2858 idx = cvt_from_vref_idx(vref_caps, val & AC_PINCTL_VREFEN);
2862 val &= ~AC_PINCTL_VREFEN;
2863 val |= get_vref_idx(vref_caps, ucontrol->value.enumerated.item[0]);
2864 snd_hda_set_pin_ctl_cache(codec, nid, val);
2952 unsigned int val = snd_hda_codec_get_pin_target(codec, nid);
2955 if (val & PIN_OUT) {
2956 if (out_jacks > 1 && val == PIN_HP)
2958 } else if (val & PIN_IN) {
2962 val &= AC_PINCTL_VREFEN;
2963 idx += cvt_from_vref_idx(vref_caps, val);
2986 unsigned int val, oldval, idx;
2995 val = idx ? PIN_HP : PIN_OUT;
2997 val = PIN_HP;
3002 val = snd_hda_codec_get_pin_target(codec, nid);
3003 val &= ~(AC_PINCTL_VREFEN | PIN_HP);
3004 val |= get_vref_idx(vref_caps, idx) | PIN_IN;
3006 val = snd_hda_get_default_vref(codec, nid) | PIN_IN;
3008 snd_hda_set_pin_ctl_cache(codec, nid, val);
3336 unsigned int val;
3353 val = PIN_IN;
3355 val |= snd_hda_get_default_vref(codec, pin);
3358 set_pin_target(codec, pin, val, false);
3587 unsigned int val;
3597 val = snd_hda_codec_get_pincfg(codec, nid);
3598 return snd_hda_get_input_pin_attr(val) == INPUT_PIN_ATTR_INT;
3860 unsigned int val = 0;
3869 val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT);
3873 val = HDA_COMPOSE_AMP_VAL(nid, 3, path->idx[depth],
3879 return val;
3894 unsigned int val;
3910 val = look_for_boost_amp(codec, path);
3911 if (!val)
3918 spec->input_label_idxs[idx], val))
3921 path->ctls[NID_PATH_BOOST_CTL] = val;
4397 unsigned int val, oldval;
4425 val = oldval & ~PIN_HP;
4427 val = 0;
4429 val |= oldval;
4435 update_pin_ctl(codec, nid, val);
4653 unsigned int val = 0;
4655 val++;
4657 val++;
4659 ucontrol->value.enumerated.item[0] = val;