diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-04-09 11:32:23 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-04-09 11:35:42 -0400 |
commit | 7f311a46916a3be00a1a8e3f1bdf461d08f1d263 (patch) | |
tree | 9f1e407913f982757fd84948bf24c2511823eba9 /sound/pci | |
parent | 226b1ec8c18bcb6d1aa448a29b2c8aeae1946228 (diff) |
ALSA: hda - Fix initial capture source connections of ALC880/260
The widget connections of ADC of ALC880 and ALC2260 aren't initialized,
thus it might point to invalid pin. This can be a problem when mode=auto
and there is only one input pin. Then user can't change the connection
at all.
This patch adds the code to initialize the input pin connection of these
codecs.
Reference: Novell bnc#594363
https://bugzilla.novell.com/show_bug.cgi?id=594363
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 9b58f29833e6..8d60b1f25ce1 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -4809,6 +4809,25 @@ static void alc880_auto_init_analog_input(struct hda_codec *codec) | |||
4809 | } | 4809 | } |
4810 | } | 4810 | } |
4811 | 4811 | ||
4812 | static void alc880_auto_init_input_src(struct hda_codec *codec) | ||
4813 | { | ||
4814 | struct alc_spec *spec = codec->spec; | ||
4815 | int c; | ||
4816 | |||
4817 | for (c = 0; c < spec->num_adc_nids; c++) { | ||
4818 | unsigned int mux_idx; | ||
4819 | const struct hda_input_mux *imux; | ||
4820 | mux_idx = c >= spec->num_mux_defs ? 0 : c; | ||
4821 | imux = &spec->input_mux[mux_idx]; | ||
4822 | if (!imux->num_items && mux_idx > 0) | ||
4823 | imux = &spec->input_mux[0]; | ||
4824 | if (imux) | ||
4825 | snd_hda_codec_write(codec, spec->adc_nids[c], 0, | ||
4826 | AC_VERB_SET_CONNECT_SEL, | ||
4827 | imux->items[0].index); | ||
4828 | } | ||
4829 | } | ||
4830 | |||
4812 | /* parse the BIOS configuration and set up the alc_spec */ | 4831 | /* parse the BIOS configuration and set up the alc_spec */ |
4813 | /* return 1 if successful, 0 if the proper config is not found, | 4832 | /* return 1 if successful, 0 if the proper config is not found, |
4814 | * or a negative error code | 4833 | * or a negative error code |
@@ -4887,6 +4906,7 @@ static void alc880_auto_init(struct hda_codec *codec) | |||
4887 | alc880_auto_init_multi_out(codec); | 4906 | alc880_auto_init_multi_out(codec); |
4888 | alc880_auto_init_extra_out(codec); | 4907 | alc880_auto_init_extra_out(codec); |
4889 | alc880_auto_init_analog_input(codec); | 4908 | alc880_auto_init_analog_input(codec); |
4909 | alc880_auto_init_input_src(codec); | ||
4890 | if (spec->unsol_event) | 4910 | if (spec->unsol_event) |
4891 | alc_inithook(codec); | 4911 | alc_inithook(codec); |
4892 | } | 4912 | } |
@@ -6398,6 +6418,8 @@ static void alc260_auto_init_analog_input(struct hda_codec *codec) | |||
6398 | } | 6418 | } |
6399 | } | 6419 | } |
6400 | 6420 | ||
6421 | #define alc260_auto_init_input_src alc880_auto_init_input_src | ||
6422 | |||
6401 | /* | 6423 | /* |
6402 | * generic initialization of ADC, input mixers and output mixers | 6424 | * generic initialization of ADC, input mixers and output mixers |
6403 | */ | 6425 | */ |
@@ -6484,6 +6506,7 @@ static void alc260_auto_init(struct hda_codec *codec) | |||
6484 | struct alc_spec *spec = codec->spec; | 6506 | struct alc_spec *spec = codec->spec; |
6485 | alc260_auto_init_multi_out(codec); | 6507 | alc260_auto_init_multi_out(codec); |
6486 | alc260_auto_init_analog_input(codec); | 6508 | alc260_auto_init_analog_input(codec); |
6509 | alc260_auto_init_input_src(codec); | ||
6487 | if (spec->unsol_event) | 6510 | if (spec->unsol_event) |
6488 | alc_inithook(codec); | 6511 | alc_inithook(codec); |
6489 | } | 6512 | } |