mirror of https://gitee.com/openkylin/linux.git
ALSA: hda - Fix the wrong adc_idx for capture source
The patch "ALSA: hda - fix wrong adc_idx in generic parser" fixed the adc_idx for the capture volume and capture switch controls. But also modified the adc_idx retrieval for the capture source controls wrongly. As multiple capture source controls are created in a single shot with counts > 1, the id.index doesn't contain the real value. The real index has to be taken via snd_ctl_get_ioffidx() as in the original code. This patch reverts the fixes partially to recover from the regression. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
3f25dcf691
commit
2a8d53916b
|
@ -2675,7 +2675,8 @@ static int mux_enum_get(struct snd_kcontrol *kcontrol,
|
||||||
{
|
{
|
||||||
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||||
struct hda_gen_spec *spec = codec->spec;
|
struct hda_gen_spec *spec = codec->spec;
|
||||||
unsigned int adc_idx = kcontrol->id.index;
|
/* the ctls are created at once with multiple counts */
|
||||||
|
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
|
||||||
|
|
||||||
ucontrol->value.enumerated.item[0] = spec->cur_mux[adc_idx];
|
ucontrol->value.enumerated.item[0] = spec->cur_mux[adc_idx];
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2685,7 +2686,7 @@ static int mux_enum_put(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol)
|
struct snd_ctl_elem_value *ucontrol)
|
||||||
{
|
{
|
||||||
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||||
unsigned int adc_idx = kcontrol->id.index;
|
unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
|
||||||
return mux_select(codec, adc_idx,
|
return mux_select(codec, adc_idx,
|
||||||
ucontrol->value.enumerated.item[0]);
|
ucontrol->value.enumerated.item[0]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue