diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-03-08 06:13:07 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-01 19:01:10 -0400 |
commit | 9ba9ca73e6155efd4137e93796835b4377801893 (patch) | |
tree | c32db1bbddac39dd2ca077bcc3ebd896bb89f0b6 /sound | |
parent | f46a0cd9a472a3f3c2d10f99558ef5b70f88ee8c (diff) |
ALSA: hda - Fix input source elements of secondary ADCs on Realtek
commit 5311114d4867113c00f78829d4ce14be458ec925 upstream.
Since alc_auto_create_input_ctls() doesn't set the elements for the
secondary ADCs, "Input Source" elemtns for these also get empty, resulting
in buggy outputs of alsactl like:
control.14 {
comment.access 'read write'
comment.type ENUMERATED
comment.count 1
iface MIXER
name 'Input Source'
index 1
value 0
}
This patch fixes alc_mux_enum_*() (and others) to fall back to the
first entry if the secondary input mux is empty.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index da34095c707f..910fa27ff57a 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -407,6 +407,8 @@ static int alc_mux_enum_info(struct snd_kcontrol *kcontrol, | |||
407 | unsigned int mux_idx = snd_ctl_get_ioffidx(kcontrol, &uinfo->id); | 407 | unsigned int mux_idx = snd_ctl_get_ioffidx(kcontrol, &uinfo->id); |
408 | if (mux_idx >= spec->num_mux_defs) | 408 | if (mux_idx >= spec->num_mux_defs) |
409 | mux_idx = 0; | 409 | mux_idx = 0; |
410 | if (!spec->input_mux[mux_idx].num_items && mux_idx > 0) | ||
411 | mux_idx = 0; | ||
410 | return snd_hda_input_mux_info(&spec->input_mux[mux_idx], uinfo); | 412 | return snd_hda_input_mux_info(&spec->input_mux[mux_idx], uinfo); |
411 | } | 413 | } |
412 | 414 | ||
@@ -435,6 +437,8 @@ static int alc_mux_enum_put(struct snd_kcontrol *kcontrol, | |||
435 | 437 | ||
436 | mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx; | 438 | mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx; |
437 | imux = &spec->input_mux[mux_idx]; | 439 | imux = &spec->input_mux[mux_idx]; |
440 | if (!imux->num_items && mux_idx > 0) | ||
441 | imux = &spec->input_mux[0]; | ||
438 | 442 | ||
439 | type = get_wcaps_type(get_wcaps(codec, nid)); | 443 | type = get_wcaps_type(get_wcaps(codec, nid)); |
440 | if (type == AC_WID_AUD_MIX) { | 444 | if (type == AC_WID_AUD_MIX) { |
@@ -9941,6 +9945,8 @@ static void alc882_auto_init_input_src(struct hda_codec *codec) | |||
9941 | continue; | 9945 | continue; |
9942 | mux_idx = c >= spec->num_mux_defs ? 0 : c; | 9946 | mux_idx = c >= spec->num_mux_defs ? 0 : c; |
9943 | imux = &spec->input_mux[mux_idx]; | 9947 | imux = &spec->input_mux[mux_idx]; |
9948 | if (!imux->num_items && mux_idx > 0) | ||
9949 | imux = &spec->input_mux[0]; | ||
9944 | for (idx = 0; idx < conns; idx++) { | 9950 | for (idx = 0; idx < conns; idx++) { |
9945 | /* if the current connection is the selected one, | 9951 | /* if the current connection is the selected one, |
9946 | * unmute it as default - otherwise mute it | 9952 | * unmute it as default - otherwise mute it |