diff options
author | Jaroslav Kysela <perex@perex.cz> | 2009-12-08 18:13:32 +0300 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2009-12-15 11:33:04 +0300 |
commit | 5b0cb1d850c26893b1468b3a519433a1b7a176be (patch) | |
tree | c6f4ab97db6de9230b02d6cfce8976b762f3b485 /sound/pci/hda/patch_cmedia.c | |
parent | f40542532e96dda5506eb76badea322f2ae4731c (diff) | |
download | linux-5b0cb1d850c26893b1468b3a519433a1b7a176be.tar.xz |
ALSA: hda - add more NID->Control mapping
This set of changes add missing NID values to some static control
elemenents. Also, it handles all "Capture Source" or "Input Source"
controls.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/hda/patch_cmedia.c')
-rw-r--r-- | sound/pci/hda/patch_cmedia.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c index a45c1169762b..cc1c22370a60 100644 --- a/sound/pci/hda/patch_cmedia.c +++ b/sound/pci/hda/patch_cmedia.c @@ -315,7 +315,8 @@ static struct hda_verb cmi9880_allout_init[] = { static int cmi9880_build_controls(struct hda_codec *codec) { struct cmi_spec *spec = codec->spec; - int err; + struct snd_kcontrol *kctl; + int i, err; err = snd_hda_add_new_ctls(codec, cmi9880_basic_mixer); if (err < 0) @@ -340,6 +341,15 @@ static int cmi9880_build_controls(struct hda_codec *codec) if (err < 0) return err; } + + /* assign Capture Source enums to NID */ + kctl = snd_hda_find_mixer_ctl(codec, "Capture Source"); + for (i = 0; kctl && i < kctl->count; i++) { + err = snd_hda_add_nids(codec, kctl, i, spec->adc_nids, + spec->input_mux->num_items); + if (err < 0) + return err; + } return 0; } |