aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2009-11-12 04:15:48 -0500
committerTakashi Iwai <tiwai@suse.de>2009-11-16 05:35:19 -0500
commit4d02d1b638af580ae3d69367248539a8b3893064 (patch)
tree2e3deb96c2fcd98e83644b816d1ae7294f67b05e /sound/pci/hda/patch_sigmatel.c
parent3911a4c19e927738766003839aa447becbdbaa27 (diff)
ALSA: hda - proc - add support for dynamic controls to mixer<->NID mapping
This patch adds support for dynamically created controls to proc codec file (Control: lines). Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index a3872b90d6ed..d2ddb959c290 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -2671,7 +2671,8 @@ static struct snd_kcontrol_new stac92xx_control_templates[] = {
2671static struct snd_kcontrol_new * 2671static struct snd_kcontrol_new *
2672stac_control_new(struct sigmatel_spec *spec, 2672stac_control_new(struct sigmatel_spec *spec,
2673 struct snd_kcontrol_new *ktemp, 2673 struct snd_kcontrol_new *ktemp,
2674 const char *name) 2674 const char *name,
2675 hda_nid_t nid)
2675{ 2676{
2676 struct snd_kcontrol_new *knew; 2677 struct snd_kcontrol_new *knew;
2677 2678
@@ -2687,6 +2688,8 @@ stac_control_new(struct sigmatel_spec *spec,
2687 spec->kctls.alloced--; 2688 spec->kctls.alloced--;
2688 return NULL; 2689 return NULL;
2689 } 2690 }
2691 if (nid)
2692 knew->subdevice = (1<<31)|nid;
2690 return knew; 2693 return knew;
2691} 2694}
2692 2695
@@ -2695,7 +2698,8 @@ static int stac92xx_add_control_temp(struct sigmatel_spec *spec,
2695 int idx, const char *name, 2698 int idx, const char *name,
2696 unsigned long val) 2699 unsigned long val)
2697{ 2700{
2698 struct snd_kcontrol_new *knew = stac_control_new(spec, ktemp, name); 2701 struct snd_kcontrol_new *knew = stac_control_new(spec, ktemp, name,
2702 get_amp_nid_(val));
2699 if (!knew) 2703 if (!knew)
2700 return -ENOMEM; 2704 return -ENOMEM;
2701 knew->index = idx; 2705 knew->index = idx;
@@ -2766,7 +2770,7 @@ static int stac92xx_add_input_source(struct sigmatel_spec *spec)
2766 if (!spec->num_adcs || imux->num_items <= 1) 2770 if (!spec->num_adcs || imux->num_items <= 1)
2767 return 0; /* no need for input source control */ 2771 return 0; /* no need for input source control */
2768 knew = stac_control_new(spec, &stac_input_src_temp, 2772 knew = stac_control_new(spec, &stac_input_src_temp,
2769 stac_input_src_temp.name); 2773 stac_input_src_temp.name, 0);
2770 if (!knew) 2774 if (!knew)
2771 return -ENOMEM; 2775 return -ENOMEM;
2772 knew->count = spec->num_adcs; 2776 knew->count = spec->num_adcs;