aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-06-17 08:55:02 -0400
committerTakashi Iwai <tiwai@suse.de>2011-06-20 10:07:02 -0400
commit5f4b36d64d1f1ba1da46bee3ec4f0519dfaf68e6 (patch)
treeb7dc6fd280c5d71fc4384d04591b0b10eb2cee7f /sound
parentb13e552d374a9cbee20ba24635608289cc8a7c97 (diff)
ALSA: hda - Remove superfluous NID_MAPPING use for smart51 mixer
Just a minor clean up; nid-mapping can be set directly to the smart51 mixer element. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_via.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 89a0f2a3d269..995974d0b120 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -1003,19 +1003,13 @@ static int via_smart51_put(struct snd_kcontrol *kcontrol,
1003 return 1; 1003 return 1;
1004} 1004}
1005 1005
1006static const struct snd_kcontrol_new via_smart51_mixer[2] = { 1006static const struct snd_kcontrol_new via_smart51_mixer = {
1007 { 1007 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1008 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1008 .name = "Smart 5.1",
1009 .name = "Smart 5.1", 1009 .count = 1,
1010 .count = 1, 1010 .info = via_smart51_info,
1011 .info = via_smart51_info, 1011 .get = via_smart51_get,
1012 .get = via_smart51_get, 1012 .put = via_smart51_put,
1013 .put = via_smart51_put,
1014 },
1015 {
1016 .iface = NID_MAPPING,
1017 .name = "Smart 5.1",
1018 }
1019}; 1013};
1020 1014
1021static int via_smart51_build(struct via_spec *spec) 1015static int via_smart51_build(struct via_spec *spec)
@@ -1030,17 +1024,14 @@ static int via_smart51_build(struct via_spec *spec)
1030 if (cfg->line_outs > 2) 1024 if (cfg->line_outs > 2)
1031 return 0; 1025 return 0;
1032 1026
1033 knew = via_clone_control(spec, &via_smart51_mixer[0]); 1027 knew = via_clone_control(spec, &via_smart51_mixer);
1034 if (knew == NULL) 1028 if (knew == NULL)
1035 return -ENOMEM; 1029 return -ENOMEM;
1036 1030
1037 for (i = 0; i < cfg->num_inputs; i++) { 1031 for (i = 0; i < cfg->num_inputs; i++) {
1038 nid = cfg->inputs[i].pin; 1032 nid = cfg->inputs[i].pin;
1039 if (cfg->inputs[i].type <= AUTO_PIN_LINE_IN) { 1033 if (cfg->inputs[i].type <= AUTO_PIN_LINE_IN) {
1040 knew = via_clone_control(spec, &via_smart51_mixer[1]); 1034 knew->subdevice = HDA_SUBDEV_NID_FLAG | nid;
1041 if (knew == NULL)
1042 return -ENOMEM;
1043 knew->subdevice = nid;
1044 break; 1035 break;
1045 } 1036 }
1046 } 1037 }