aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorVitaliy Kulikov <Vitaliy.Kulikov@idt.com>2011-03-09 20:47:43 -0500
committerTakashi Iwai <tiwai@suse.de>2011-03-14 10:21:17 -0400
commit094a42452abd5564429045e210281c6d22e67fca (patch)
tree223419703fc0df8481864cecb3151c66796bf115 /sound/pci/hda
parentae0ebbf70afe2889b39f575e800e7292abd259d6 (diff)
ALSA: hda - fix digital mic selection in mixer on 92HD8X codecs
When the mux for digital mic is different from the mux for other mics, the current auto-parser doesn't handle them in a right way but provides only one mic. This patch fixes the issue. Signed-off-by: Vitaliy Kulikov <Vitaliy.Kulikov@idt.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/patch_sigmatel.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 8fe5608c5f29..32f744d47da7 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -748,7 +748,7 @@ static int stac92xx_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e
748 struct sigmatel_spec *spec = codec->spec; 748 struct sigmatel_spec *spec = codec->spec;
749 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 749 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
750 const struct hda_input_mux *imux = spec->input_mux; 750 const struct hda_input_mux *imux = spec->input_mux;
751 unsigned int idx, prev_idx; 751 unsigned int idx, prev_idx, didx;
752 752
753 idx = ucontrol->value.enumerated.item[0]; 753 idx = ucontrol->value.enumerated.item[0];
754 if (idx >= imux->num_items) 754 if (idx >= imux->num_items)
@@ -760,7 +760,8 @@ static int stac92xx_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e
760 snd_hda_codec_write_cache(codec, spec->mux_nids[adc_idx], 0, 760 snd_hda_codec_write_cache(codec, spec->mux_nids[adc_idx], 0,
761 AC_VERB_SET_CONNECT_SEL, 761 AC_VERB_SET_CONNECT_SEL,
762 imux->items[idx].index); 762 imux->items[idx].index);
763 if (prev_idx >= spec->num_analog_muxes) { 763 if (prev_idx >= spec->num_analog_muxes &&
764 spec->mux_nids[adc_idx] != spec->dmux_nids[adc_idx]) {
764 imux = spec->dinput_mux; 765 imux = spec->dinput_mux;
765 /* 0 = analog */ 766 /* 0 = analog */
766 snd_hda_codec_write_cache(codec, 767 snd_hda_codec_write_cache(codec,
@@ -770,9 +771,13 @@ static int stac92xx_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e
770 } 771 }
771 } else { 772 } else {
772 imux = spec->dinput_mux; 773 imux = spec->dinput_mux;
774 /* first dimux item is hardcoded to select analog imux,
775 * so lets skip it
776 */
777 didx = idx - spec->num_analog_muxes + 1;
773 snd_hda_codec_write_cache(codec, spec->dmux_nids[adc_idx], 0, 778 snd_hda_codec_write_cache(codec, spec->dmux_nids[adc_idx], 0,
774 AC_VERB_SET_CONNECT_SEL, 779 AC_VERB_SET_CONNECT_SEL,
775 imux->items[idx - 1].index); 780 imux->items[didx].index);
776 } 781 }
777 spec->cur_mux[adc_idx] = idx; 782 spec->cur_mux[adc_idx] = idx;
778 return 1; 783 return 1;