aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-11-18 06:36:33 -0500
committerTakashi Iwai <tiwai@suse.de>2008-11-18 06:36:33 -0500
commitcd896c331dd442c43cd9e23de3f1a4f3c111c292 (patch)
treefd435f917bc96891e0074b9ef28f4cb2233c6da1 /sound
parenta581780aa17f9027c422cb2d10f0bd88135c36f5 (diff)
ALSA: hda - Allow multiple imux for matrix-type mixers of ALC codecs
Allow the multiple imux instances for matrix-type mixers like ALC882. So far, only ALC260 used this feature, but other codecs may need a similar stuff. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 04e153a77db..b7d34390eff 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -382,11 +382,15 @@ static int alc_mux_enum_put(struct snd_kcontrol *kcontrol,
382{ 382{
383 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 383 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
384 struct alc_spec *spec = codec->spec; 384 struct alc_spec *spec = codec->spec;
385 const struct hda_input_mux *imux = spec->input_mux; 385 const struct hda_input_mux *imux;
386 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 386 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
387 unsigned int mux_idx;
387 hda_nid_t nid = spec->capsrc_nids ? 388 hda_nid_t nid = spec->capsrc_nids ?
388 spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx]; 389 spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx];
389 390
391 mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx;
392 imux = &spec->input_mux[mux_idx];
393
390 if (spec->is_mix_capture) { 394 if (spec->is_mix_capture) {
391 /* Matrix-mixer style (e.g. ALC882) */ 395 /* Matrix-mixer style (e.g. ALC882) */
392 unsigned int *cur_val = &spec->cur_mux[adc_idx]; 396 unsigned int *cur_val = &spec->cur_mux[adc_idx];
@@ -407,10 +411,7 @@ static int alc_mux_enum_put(struct snd_kcontrol *kcontrol,
407 return 1; 411 return 1;
408 } else { 412 } else {
409 /* MUX style (e.g. ALC880) */ 413 /* MUX style (e.g. ALC880) */
410 unsigned int mux_idx; 414 return snd_hda_input_mux_put(codec, imux, ucontrol, nid,
411 mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx;
412 return snd_hda_input_mux_put(codec, &spec->input_mux[mux_idx],
413 ucontrol, nid,
414 &spec->cur_mux[adc_idx]); 415 &spec->cur_mux[adc_idx]);
415 } 416 }
416} 417}