Commit 74f14b36838a6f5406ff1a14fcfda935c190476c

Authored by Takashi Iwai
1 parent 82d04e1088

ALSA: hda - Make add_stereo_mix_input flag tristate

... for distinguishing whether it's explicitly enabled via a user hint
or enabled by a driver as a fallback.  Now the former case corresponds
to HDA_HINT_STEREO_MIX_ENABLE while the latter to
HDA_HINT_STEREO_MIX_AUTO.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 5 changed files with 16 additions and 10 deletions Side-by-side Diff

sound/pci/hda/hda_generic.c
... ... @@ -3218,8 +3218,7 @@
3218 3218 }
3219 3219  
3220 3220 /* add stereo mix when explicitly enabled via hint */
3221   - if (mixer && spec->add_stereo_mix_input &&
3222   - snd_hda_get_bool_hint(codec, "add_stereo_mix_input") > 0) {
  3221 + if (mixer && spec->add_stereo_mix_input == HDA_HINT_STEREO_MIX_ENABLE) {
3223 3222 err = parse_capture_source(codec, mixer, CFG_IDX_MIX, num_adcs,
3224 3223 "Stereo Mix", 0);
3225 3224 if (err < 0)
... ... @@ -4544,9 +4543,8 @@
4544 4543  
4545 4544 /* add stereo mix if available and not enabled yet */
4546 4545 if (!spec->auto_mic && spec->mixer_nid &&
4547   - spec->add_stereo_mix_input &&
4548   - spec->input_mux.num_items > 1 &&
4549   - snd_hda_get_bool_hint(codec, "add_stereo_mix_input") < 0) {
  4546 + spec->add_stereo_mix_input == HDA_HINT_STEREO_MIX_AUTO &&
  4547 + spec->input_mux.num_items > 1) {
4550 4548 err = parse_capture_source(codec, spec->mixer_nid,
4551 4549 CFG_IDX_MIX, spec->num_all_adcs,
4552 4550 "Stereo Mix", 0);
sound/pci/hda/hda_generic.h
... ... @@ -222,7 +222,7 @@
222 222 unsigned int vmaster_mute_enum:1; /* add vmaster mute mode enum */
223 223 unsigned int indep_hp:1; /* independent HP supported */
224 224 unsigned int prefer_hp_amp:1; /* enable HP amp for speaker if any */
225   - unsigned int add_stereo_mix_input:1; /* add aamix as a capture src */
  225 + unsigned int add_stereo_mix_input:2; /* add aamix as a capture src */
226 226 unsigned int add_jack_modes:1; /* add i/o jack mode enum ctls */
227 227 unsigned int power_down_unused:1; /* power down unused widgets */
228 228 unsigned int dac_min_mute:1; /* minimal = mute for DACs */
... ... @@ -289,6 +289,13 @@
289 289 struct hda_jack_callback *cb);
290 290 void (*mic_autoswitch_hook)(struct hda_codec *codec,
291 291 struct hda_jack_callback *cb);
  292 +};
  293 +
  294 +/* values for add_stereo_mix_input flag */
  295 +enum {
  296 + HDA_HINT_STEREO_MIX_DISABLE, /* No stereo mix input */
  297 + HDA_HINT_STEREO_MIX_ENABLE, /* Add stereo mix input */
  298 + HDA_HINT_STEREO_MIX_AUTO, /* Add only if auto-mic is disabled */
292 299 };
293 300  
294 301 int snd_hda_gen_spec_init(struct hda_gen_spec *spec);
sound/pci/hda/patch_analog.c
... ... @@ -195,7 +195,8 @@
195 195 codec->no_sticky_stream = 1;
196 196  
197 197 spec->gen.indep_hp = indep_hp;
198   - spec->gen.add_stereo_mix_input = 1;
  198 + if (!spec->gen.add_stereo_mix_input)
  199 + spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
199 200  
200 201 err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0);
201 202 if (err < 0)
sound/pci/hda/patch_conexant.c
... ... @@ -855,14 +855,14 @@
855 855 case 0x14f15045:
856 856 codec->single_adc_amp = 1;
857 857 spec->gen.mixer_nid = 0x17;
858   - spec->gen.add_stereo_mix_input = 1;
  858 + spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
859 859 snd_hda_pick_fixup(codec, cxt5045_fixup_models,
860 860 cxt5045_fixups, cxt_fixups);
861 861 break;
862 862 case 0x14f15047:
863 863 codec->pin_amp_workaround = 1;
864 864 spec->gen.mixer_nid = 0x19;
865   - spec->gen.add_stereo_mix_input = 1;
  865 + spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
866 866 snd_hda_pick_fixup(codec, cxt5047_fixup_models,
867 867 cxt5047_fixups, cxt_fixups);
868 868 break;
sound/pci/hda/patch_via.c
... ... @@ -137,7 +137,7 @@
137 137 spec->gen.indep_hp = 1;
138 138 spec->gen.keep_eapd_on = 1;
139 139 spec->gen.pcm_playback_hook = via_playback_pcm_hook;
140   - spec->gen.add_stereo_mix_input = 1;
  140 + spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
141 141 return spec;
142 142 }
143 143