diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-12-15 07:43:59 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-12-15 07:46:08 -0500 |
commit | 74f14b36838a6f5406ff1a14fcfda935c190476c (patch) | |
tree | 5e5df6949e4427c084ba22c9cd65230abfb184d5 /sound | |
parent | 82d04e1088769c769c87ffa1d4df5e4a228f637a (diff) |
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/hda_generic.c | 8 | ||||
-rw-r--r-- | sound/pci/hda/hda_generic.h | 9 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 3 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/patch_via.c | 2 |
5 files changed, 16 insertions, 10 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 293af6b5ba3d..b680b4ec6331 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
@@ -3218,8 +3218,7 @@ static int create_input_ctls(struct hda_codec *codec) | |||
3218 | } | 3218 | } |
3219 | 3219 | ||
3220 | /* add stereo mix when explicitly enabled via hint */ | 3220 | /* add stereo mix when explicitly enabled via hint */ |
3221 | if (mixer && spec->add_stereo_mix_input && | 3221 | if (mixer && spec->add_stereo_mix_input == HDA_HINT_STEREO_MIX_ENABLE) { |
3222 | snd_hda_get_bool_hint(codec, "add_stereo_mix_input") > 0) { | ||
3223 | err = parse_capture_source(codec, mixer, CFG_IDX_MIX, num_adcs, | 3222 | err = parse_capture_source(codec, mixer, CFG_IDX_MIX, num_adcs, |
3224 | "Stereo Mix", 0); | 3223 | "Stereo Mix", 0); |
3225 | if (err < 0) | 3224 | if (err < 0) |
@@ -4544,9 +4543,8 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec, | |||
4544 | 4543 | ||
4545 | /* add stereo mix if available and not enabled yet */ | 4544 | /* add stereo mix if available and not enabled yet */ |
4546 | if (!spec->auto_mic && spec->mixer_nid && | 4545 | if (!spec->auto_mic && spec->mixer_nid && |
4547 | spec->add_stereo_mix_input && | 4546 | spec->add_stereo_mix_input == HDA_HINT_STEREO_MIX_AUTO && |
4548 | spec->input_mux.num_items > 1 && | 4547 | spec->input_mux.num_items > 1) { |
4549 | snd_hda_get_bool_hint(codec, "add_stereo_mix_input") < 0) { | ||
4550 | err = parse_capture_source(codec, spec->mixer_nid, | 4548 | err = parse_capture_source(codec, spec->mixer_nid, |
4551 | CFG_IDX_MIX, spec->num_all_adcs, | 4549 | CFG_IDX_MIX, spec->num_all_adcs, |
4552 | "Stereo Mix", 0); | 4550 | "Stereo Mix", 0); |
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h index 61dd5153f512..3d852660443a 100644 --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h | |||
@@ -222,7 +222,7 @@ struct hda_gen_spec { | |||
222 | unsigned int vmaster_mute_enum:1; /* add vmaster mute mode enum */ | 222 | unsigned int vmaster_mute_enum:1; /* add vmaster mute mode enum */ |
223 | unsigned int indep_hp:1; /* independent HP supported */ | 223 | unsigned int indep_hp:1; /* independent HP supported */ |
224 | unsigned int prefer_hp_amp:1; /* enable HP amp for speaker if any */ | 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 | unsigned int add_jack_modes:1; /* add i/o jack mode enum ctls */ | 226 | unsigned int add_jack_modes:1; /* add i/o jack mode enum ctls */ |
227 | unsigned int power_down_unused:1; /* power down unused widgets */ | 227 | unsigned int power_down_unused:1; /* power down unused widgets */ |
228 | unsigned int dac_min_mute:1; /* minimal = mute for DACs */ | 228 | unsigned int dac_min_mute:1; /* minimal = mute for DACs */ |
@@ -291,6 +291,13 @@ struct hda_gen_spec { | |||
291 | struct hda_jack_callback *cb); | 291 | struct hda_jack_callback *cb); |
292 | }; | 292 | }; |
293 | 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 */ | ||
299 | }; | ||
300 | |||
294 | int snd_hda_gen_spec_init(struct hda_gen_spec *spec); | 301 | int snd_hda_gen_spec_init(struct hda_gen_spec *spec); |
295 | 302 | ||
296 | int snd_hda_gen_init(struct hda_codec *codec); | 303 | int snd_hda_gen_init(struct hda_codec *codec); |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index c81b715d6c98..eb54da757407 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -195,7 +195,8 @@ static int ad198x_parse_auto_config(struct hda_codec *codec, bool indep_hp) | |||
195 | codec->no_sticky_stream = 1; | 195 | codec->no_sticky_stream = 1; |
196 | 196 | ||
197 | spec->gen.indep_hp = indep_hp; | 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 | err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0); | 201 | err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0); |
201 | if (err < 0) | 202 | if (err < 0) |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index e9ebc7bd752c..fd3ed18670e9 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -855,14 +855,14 @@ static int patch_conexant_auto(struct hda_codec *codec) | |||
855 | case 0x14f15045: | 855 | case 0x14f15045: |
856 | codec->single_adc_amp = 1; | 856 | codec->single_adc_amp = 1; |
857 | spec->gen.mixer_nid = 0x17; | 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 | snd_hda_pick_fixup(codec, cxt5045_fixup_models, | 859 | snd_hda_pick_fixup(codec, cxt5045_fixup_models, |
860 | cxt5045_fixups, cxt_fixups); | 860 | cxt5045_fixups, cxt_fixups); |
861 | break; | 861 | break; |
862 | case 0x14f15047: | 862 | case 0x14f15047: |
863 | codec->pin_amp_workaround = 1; | 863 | codec->pin_amp_workaround = 1; |
864 | spec->gen.mixer_nid = 0x19; | 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 | snd_hda_pick_fixup(codec, cxt5047_fixup_models, | 866 | snd_hda_pick_fixup(codec, cxt5047_fixup_models, |
867 | cxt5047_fixups, cxt_fixups); | 867 | cxt5047_fixups, cxt_fixups); |
868 | break; | 868 | break; |
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 6c206b6c8d65..3de6d3d779c9 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -137,7 +137,7 @@ static struct via_spec *via_new_spec(struct hda_codec *codec) | |||
137 | spec->gen.indep_hp = 1; | 137 | spec->gen.indep_hp = 1; |
138 | spec->gen.keep_eapd_on = 1; | 138 | spec->gen.keep_eapd_on = 1; |
139 | spec->gen.pcm_playback_hook = via_playback_pcm_hook; | 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 | return spec; | 141 | return spec; |
142 | } | 142 | } |
143 | 143 | ||