Commit 094a4245 authored by Vitaliy Kulikov's avatar Vitaliy Kulikov Committed by Takashi Iwai

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: default avatarVitaliy Kulikov <Vitaliy.Kulikov@idt.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ae0ebbf7
...@@ -748,7 +748,7 @@ static int stac92xx_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e ...@@ -748,7 +748,7 @@ static int stac92xx_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e
struct sigmatel_spec *spec = codec->spec; struct sigmatel_spec *spec = codec->spec;
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
const struct hda_input_mux *imux = spec->input_mux; const struct hda_input_mux *imux = spec->input_mux;
unsigned int idx, prev_idx; unsigned int idx, prev_idx, didx;
idx = ucontrol->value.enumerated.item[0]; idx = ucontrol->value.enumerated.item[0];
if (idx >= imux->num_items) if (idx >= imux->num_items)
...@@ -760,7 +760,8 @@ static int stac92xx_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e ...@@ -760,7 +760,8 @@ static int stac92xx_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e
snd_hda_codec_write_cache(codec, spec->mux_nids[adc_idx], 0, snd_hda_codec_write_cache(codec, spec->mux_nids[adc_idx], 0,
AC_VERB_SET_CONNECT_SEL, AC_VERB_SET_CONNECT_SEL,
imux->items[idx].index); imux->items[idx].index);
if (prev_idx >= spec->num_analog_muxes) { if (prev_idx >= spec->num_analog_muxes &&
spec->mux_nids[adc_idx] != spec->dmux_nids[adc_idx]) {
imux = spec->dinput_mux; imux = spec->dinput_mux;
/* 0 = analog */ /* 0 = analog */
snd_hda_codec_write_cache(codec, 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,9 +771,13 @@ static int stac92xx_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e
} }
} else { } else {
imux = spec->dinput_mux; imux = spec->dinput_mux;
/* first dimux item is hardcoded to select analog imux,
* so lets skip it
*/
didx = idx - spec->num_analog_muxes + 1;
snd_hda_codec_write_cache(codec, spec->dmux_nids[adc_idx], 0, snd_hda_codec_write_cache(codec, spec->dmux_nids[adc_idx], 0,
AC_VERB_SET_CONNECT_SEL, AC_VERB_SET_CONNECT_SEL,
imux->items[idx - 1].index); imux->items[didx].index);
} }
spec->cur_mux[adc_idx] = idx; spec->cur_mux[adc_idx] = idx;
return 1; return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment