aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2009-12-10 07:57:01 -0500
committerJaroslav Kysela <perex@perex.cz>2009-12-15 03:33:32 -0500
commit5e26dfd0615868872cb44842f1e1428c7b414ab0 (patch)
tree75472db826d948edde152969045a819653ac54b3 /sound/pci/hda
parent9e3fd8719f624a43575b56a4777b1552399a8be8 (diff)
ALSA: hda - simplify usage of HDA_SUBDEV_AMP_FLAG
The HDA_SUBDEV_NID_FLAG is duplicate for amplifier control elements. Move get_amp_nid_() call to the snd_hda_ctl_add() function. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/hda_codec.c7
-rw-r--r--sound/pci/hda/hda_local.h6
-rw-r--r--sound/pci/hda/patch_analog.c16
-rw-r--r--sound/pci/hda/patch_cirrus.c4
-rw-r--r--sound/pci/hda/patch_conexant.c2
-rw-r--r--sound/pci/hda/patch_realtek.c21
-rw-r--r--sound/pci/hda/patch_sigmatel.c8
-rw-r--r--sound/pci/hda/patch_via.c4
8 files changed, 30 insertions, 38 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index c9af15ed7f10..c848ec0f085e 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1733,11 +1733,14 @@ int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid,
1733 unsigned short flags = 0; 1733 unsigned short flags = 0;
1734 struct hda_nid_item *item; 1734 struct hda_nid_item *item;
1735 1735
1736 if (kctl->id.subdevice & HDA_SUBDEV_AMP_FLAG) 1736 if (kctl->id.subdevice & HDA_SUBDEV_AMP_FLAG) {
1737 flags |= HDA_NID_ITEM_AMP; 1737 flags |= HDA_NID_ITEM_AMP;
1738 if (nid == 0)
1739 nid = get_amp_nid_(kctl->private_value);
1740 }
1738 if ((kctl->id.subdevice & HDA_SUBDEV_NID_FLAG) != 0 && nid == 0) 1741 if ((kctl->id.subdevice & HDA_SUBDEV_NID_FLAG) != 0 && nid == 0)
1739 nid = kctl->id.subdevice & 0xffff; 1742 nid = kctl->id.subdevice & 0xffff;
1740 if (kctl->id.subdevice & 0xf0000000) 1743 if (kctl->id.subdevice & (HDA_SUBDEV_NID_FLAG|HDA_SUBDEV_AMP_FLAG))
1741 kctl->id.subdevice = 0; 1744 kctl->id.subdevice = 0;
1742 err = snd_ctl_add(codec->bus->card, kctl); 1745 err = snd_ctl_add(codec->bus->card, kctl);
1743 if (err < 0) 1746 if (err < 0)
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index 0a256471f812..d505d052972e 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -43,7 +43,7 @@
43/* mono volume with index (index=0,1,...) (channel=1,2) */ 43/* mono volume with index (index=0,1,...) (channel=1,2) */
44#define HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ 44#define HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \
45 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ 45 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \
46 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | (nid), \ 46 .subdevice = HDA_SUBDEV_AMP_FLAG, \
47 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \ 47 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \
48 SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 48 SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
49 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, \ 49 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, \
@@ -64,7 +64,7 @@
64/* mono mute switch with index (index=0,1,...) (channel=1,2) */ 64/* mono mute switch with index (index=0,1,...) (channel=1,2) */
65#define HDA_CODEC_MUTE_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ 65#define HDA_CODEC_MUTE_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \
66 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ 66 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \
67 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | (nid), \ 67 .subdevice = HDA_SUBDEV_AMP_FLAG, \
68 .info = snd_hda_mixer_amp_switch_info, \ 68 .info = snd_hda_mixer_amp_switch_info, \
69 .get = snd_hda_mixer_amp_switch_get, \ 69 .get = snd_hda_mixer_amp_switch_get, \
70 .put = snd_hda_mixer_amp_switch_put, \ 70 .put = snd_hda_mixer_amp_switch_put, \
@@ -82,7 +82,7 @@
82/* special beep mono mute switch with index (index=0,1,...) (channel=1,2) */ 82/* special beep mono mute switch with index (index=0,1,...) (channel=1,2) */
83#define HDA_CODEC_MUTE_BEEP_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ 83#define HDA_CODEC_MUTE_BEEP_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \
84 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ 84 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \
85 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | (nid), \ 85 .subdevice = HDA_SUBDEV_AMP_FLAG, \
86 .info = snd_hda_mixer_amp_switch_info, \ 86 .info = snd_hda_mixer_amp_switch_info, \
87 .get = snd_hda_mixer_amp_switch_get, \ 87 .get = snd_hda_mixer_amp_switch_get, \
88 .put = snd_hda_mixer_amp_switch_put_beep, \ 88 .put = snd_hda_mixer_amp_switch_put_beep, \
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 5e2bb181a149..e75b5e5a1d55 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -209,9 +209,7 @@ static int ad198x_build_controls(struct hda_codec *codec)
209 if (!kctl) 209 if (!kctl)
210 return -ENOMEM; 210 return -ENOMEM;
211 kctl->private_value = spec->beep_amp; 211 kctl->private_value = spec->beep_amp;
212 err = snd_hda_ctl_add(codec, 212 err = snd_hda_ctl_add(codec, 0, kctl);
213 get_amp_nid_(spec->beep_amp),
214 kctl);
215 if (err < 0) 213 if (err < 0)
216 return err; 214 return err;
217 } 215 }
@@ -832,7 +830,7 @@ static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = {
832 { 830 {
833 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 831 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
834 .name = "Master Playback Switch", 832 .name = "Master Playback Switch",
835 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x1a, 833 .subdevice = HDA_SUBDEV_AMP_FLAG,
836 .info = snd_hda_mixer_amp_switch_info, 834 .info = snd_hda_mixer_amp_switch_info,
837 .get = snd_hda_mixer_amp_switch_get, 835 .get = snd_hda_mixer_amp_switch_get,
838 .put = ad1986a_hp_master_sw_put, 836 .put = ad1986a_hp_master_sw_put,
@@ -2602,9 +2600,7 @@ static int add_control(struct ad198x_spec *spec, int type, const char *name,
2602 if (! knew->name) 2600 if (! knew->name)
2603 return -ENOMEM; 2601 return -ENOMEM;
2604 if (get_amp_nid_(val)) 2602 if (get_amp_nid_(val))
2605 knew->subdevice = HDA_SUBDEV_NID_FLAG | 2603 knew->subdevice = HDA_SUBDEV_AMP_FLAG;
2606 HDA_SUBDEV_AMP_FLAG |
2607 get_amp_nid_(val);
2608 knew->private_value = val; 2604 knew->private_value = val;
2609 return 0; 2605 return 0;
2610} 2606}
@@ -3758,7 +3754,7 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = {
3758 { 3754 {
3759 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3755 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3760 .name = "Master Playback Switch", 3756 .name = "Master Playback Switch",
3761 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x21, 3757 .subdevice = HDA_SUBDEV_AMP_FLAG,
3762 .info = snd_hda_mixer_amp_switch_info, 3758 .info = snd_hda_mixer_amp_switch_info,
3763 .get = snd_hda_mixer_amp_switch_get, 3759 .get = snd_hda_mixer_amp_switch_get,
3764 .put = ad1884a_mobile_master_sw_put, 3760 .put = ad1884a_mobile_master_sw_put,
@@ -3787,7 +3783,7 @@ static struct snd_kcontrol_new ad1884a_mobile_mixers[] = {
3787 { 3783 {
3788 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3784 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3789 .name = "Master Playback Switch", 3785 .name = "Master Playback Switch",
3790 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x21, 3786 .subdevice = HDA_SUBDEV_AMP_FLAG,
3791 .info = snd_hda_mixer_amp_switch_info, 3787 .info = snd_hda_mixer_amp_switch_info,
3792 .get = snd_hda_mixer_amp_switch_get, 3788 .get = snd_hda_mixer_amp_switch_get,
3793 .put = ad1884a_mobile_master_sw_put, 3789 .put = ad1884a_mobile_master_sw_put,
@@ -4129,7 +4125,7 @@ static struct snd_kcontrol_new ad1984a_touchsmart_mixers[] = {
4129/* HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ 4125/* HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/
4130 { 4126 {
4131 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 4127 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
4132 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x21, 4128 .subdevice = HDA_SUBDEV_AMP_FLAG,
4133 .name = "Master Playback Switch", 4129 .name = "Master Playback Switch",
4134 .info = snd_hda_mixer_amp_switch_info, 4130 .info = snd_hda_mixer_amp_switch_info,
4135 .get = snd_hda_mixer_amp_switch_get, 4131 .get = snd_hda_mixer_amp_switch_get,
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index e51f6658aa2c..eeb91f6a06c2 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -501,7 +501,7 @@ static int add_mute(struct hda_codec *codec, const char *name, int index,
501 snprintf(tmp, sizeof(tmp), "%s %s Switch", name, dir_sfx[dir]); 501 snprintf(tmp, sizeof(tmp), "%s %s Switch", name, dir_sfx[dir]);
502 *kctlp = snd_ctl_new1(&knew, codec); 502 *kctlp = snd_ctl_new1(&knew, codec);
503 (*kctlp)->id.subdevice = HDA_SUBDEV_AMP_FLAG; 503 (*kctlp)->id.subdevice = HDA_SUBDEV_AMP_FLAG;
504 return snd_hda_ctl_add(codec, get_amp_nid_(pval), *kctlp); 504 return snd_hda_ctl_add(codec, 0, *kctlp);
505} 505}
506 506
507static int add_volume(struct hda_codec *codec, const char *name, 507static int add_volume(struct hda_codec *codec, const char *name,
@@ -515,7 +515,7 @@ static int add_volume(struct hda_codec *codec, const char *name,
515 snprintf(tmp, sizeof(tmp), "%s %s Volume", name, dir_sfx[dir]); 515 snprintf(tmp, sizeof(tmp), "%s %s Volume", name, dir_sfx[dir]);
516 *kctlp = snd_ctl_new1(&knew, codec); 516 *kctlp = snd_ctl_new1(&knew, codec);
517 (*kctlp)->id.subdevice = HDA_SUBDEV_AMP_FLAG; 517 (*kctlp)->id.subdevice = HDA_SUBDEV_AMP_FLAG;
518 return snd_hda_ctl_add(codec, get_amp_nid_(pval), *kctlp); 518 return snd_hda_ctl_add(codec, 0, *kctlp);
519} 519}
520 520
521static void fix_volume_caps(struct hda_codec *codec, hda_nid_t dac) 521static void fix_volume_caps(struct hda_codec *codec, hda_nid_t dac)
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index b68650af40a9..1ab2958a290b 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -2178,7 +2178,7 @@ static struct snd_kcontrol_new cxt5066_mixer_master_olpc[] = {
2178 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | 2178 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
2179 SNDRV_CTL_ELEM_ACCESS_TLV_READ | 2179 SNDRV_CTL_ELEM_ACCESS_TLV_READ |
2180 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, 2180 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK,
2181 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x10, 2181 .subdevice = HDA_SUBDEV_AMP_FLAG,
2182 .info = snd_hda_mixer_amp_volume_info, 2182 .info = snd_hda_mixer_amp_volume_info,
2183 .get = snd_hda_mixer_amp_volume_get, 2183 .get = snd_hda_mixer_amp_volume_get,
2184 .put = snd_hda_mixer_amp_volume_put, 2184 .put = snd_hda_mixer_amp_volume_put,
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 87bf7bd6292a..cb7679551bdc 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2482,8 +2482,7 @@ static int alc_build_controls(struct hda_codec *codec)
2482 if (!kctl) 2482 if (!kctl)
2483 return -ENOMEM; 2483 return -ENOMEM;
2484 kctl->private_value = spec->beep_amp; 2484 kctl->private_value = spec->beep_amp;
2485 err = snd_hda_ctl_add(codec, 2485 err = snd_hda_ctl_add(codec, 0, kctl);
2486 get_amp_nid_(spec->beep_amp), kctl);
2487 if (err < 0) 2486 if (err < 0)
2488 return err; 2487 return err;
2489 } 2488 }
@@ -4414,9 +4413,7 @@ static int add_control(struct alc_spec *spec, int type, const char *name,
4414 if (!knew->name) 4413 if (!knew->name)
4415 return -ENOMEM; 4414 return -ENOMEM;
4416 if (get_amp_nid_(val)) 4415 if (get_amp_nid_(val))
4417 knew->subdevice = HDA_SUBDEV_NID_FLAG | 4416 knew->subdevice = HDA_SUBDEV_AMP_FLAG;
4418 HDA_SUBDEV_AMP_FLAG |
4419 get_amp_nid_(val);
4420 knew->private_value = val; 4417 knew->private_value = val;
4421 return 0; 4418 return 0;
4422} 4419}
@@ -10921,7 +10918,7 @@ static struct snd_kcontrol_new alc262_fujitsu_mixer[] = {
10921 { 10918 {
10922 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 10919 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
10923 .name = "Master Playback Switch", 10920 .name = "Master Playback Switch",
10924 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x14, 10921 .subdevice = HDA_SUBDEV_AMP_FLAG,
10925 .info = snd_hda_mixer_amp_switch_info, 10922 .info = snd_hda_mixer_amp_switch_info,
10926 .get = snd_hda_mixer_amp_switch_get, 10923 .get = snd_hda_mixer_amp_switch_get,
10927 .put = alc262_fujitsu_master_sw_put, 10924 .put = alc262_fujitsu_master_sw_put,
@@ -10962,7 +10959,7 @@ static struct snd_kcontrol_new alc262_lenovo_3000_mixer[] = {
10962 { 10959 {
10963 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 10960 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
10964 .name = "Master Playback Switch", 10961 .name = "Master Playback Switch",
10965 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x1b, 10962 .subdevice = HDA_SUBDEV_AMP_FLAG,
10966 .info = snd_hda_mixer_amp_switch_info, 10963 .info = snd_hda_mixer_amp_switch_info,
10967 .get = snd_hda_mixer_amp_switch_get, 10964 .get = snd_hda_mixer_amp_switch_get,
10968 .put = alc262_lenovo_3000_master_sw_put, 10965 .put = alc262_lenovo_3000_master_sw_put,
@@ -12139,7 +12136,7 @@ static struct snd_kcontrol_new alc268_acer_aspire_one_mixer[] = {
12139 { 12136 {
12140 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 12137 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12141 .name = "Master Playback Switch", 12138 .name = "Master Playback Switch",
12142 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x14, 12139 .subdevice = HDA_SUBDEV_AMP_FLAG,
12143 .info = snd_hda_mixer_amp_switch_info, 12140 .info = snd_hda_mixer_amp_switch_info,
12144 .get = snd_hda_mixer_amp_switch_get, 12141 .get = snd_hda_mixer_amp_switch_get,
12145 .put = alc268_acer_master_sw_put, 12142 .put = alc268_acer_master_sw_put,
@@ -12155,7 +12152,7 @@ static struct snd_kcontrol_new alc268_acer_mixer[] = {
12155 { 12152 {
12156 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 12153 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12157 .name = "Master Playback Switch", 12154 .name = "Master Playback Switch",
12158 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x14, 12155 .subdevice = HDA_SUBDEV_AMP_FLAG,
12159 .info = snd_hda_mixer_amp_switch_info, 12156 .info = snd_hda_mixer_amp_switch_info,
12160 .get = snd_hda_mixer_amp_switch_get, 12157 .get = snd_hda_mixer_amp_switch_get,
12161 .put = alc268_acer_master_sw_put, 12158 .put = alc268_acer_master_sw_put,
@@ -12173,7 +12170,7 @@ static struct snd_kcontrol_new alc268_acer_dmic_mixer[] = {
12173 { 12170 {
12174 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 12171 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
12175 .name = "Master Playback Switch", 12172 .name = "Master Playback Switch",
12176 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x14, 12173 .subdevice = HDA_SUBDEV_AMP_FLAG,
12177 .info = snd_hda_mixer_amp_switch_info, 12174 .info = snd_hda_mixer_amp_switch_info,
12178 .get = snd_hda_mixer_amp_switch_get, 12175 .get = snd_hda_mixer_amp_switch_get,
12179 .put = alc268_acer_master_sw_put, 12176 .put = alc268_acer_master_sw_put,
@@ -13126,7 +13123,7 @@ static struct snd_kcontrol_new alc269_quanta_fl1_mixer[] = {
13126 { 13123 {
13127 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 13124 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
13128 .name = "Master Playback Switch", 13125 .name = "Master Playback Switch",
13129 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x14, 13126 .subdevice = HDA_SUBDEV_AMP_FLAG,
13130 .info = snd_hda_mixer_amp_switch_info, 13127 .info = snd_hda_mixer_amp_switch_info,
13131 .get = snd_hda_mixer_amp_switch_get, 13128 .get = snd_hda_mixer_amp_switch_get,
13132 .put = alc268_acer_master_sw_put, 13129 .put = alc268_acer_master_sw_put,
@@ -13147,7 +13144,7 @@ static struct snd_kcontrol_new alc269_lifebook_mixer[] = {
13147 { 13144 {
13148 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 13145 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
13149 .name = "Master Playback Switch", 13146 .name = "Master Playback Switch",
13150 .subdevice = HDA_SUBDEV_NID_FLAG | HDA_SUBDEV_AMP_FLAG | 0x14, 13147 .subdevice = HDA_SUBDEV_AMP_FLAG,
13151 .info = snd_hda_mixer_amp_switch_info, 13148 .info = snd_hda_mixer_amp_switch_info,
13152 .get = snd_hda_mixer_amp_switch_get, 13149 .get = snd_hda_mixer_amp_switch_get,
13153 .put = alc268_acer_master_sw_put, 13150 .put = alc268_acer_master_sw_put,
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 1ee586b65b63..0bafea9d5106 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -2685,7 +2685,7 @@ static struct snd_kcontrol_new *
2685stac_control_new(struct sigmatel_spec *spec, 2685stac_control_new(struct sigmatel_spec *spec,
2686 struct snd_kcontrol_new *ktemp, 2686 struct snd_kcontrol_new *ktemp,
2687 const char *name, 2687 const char *name,
2688 hda_nid_t nid) 2688 unsigned int subdev)
2689{ 2689{
2690 struct snd_kcontrol_new *knew; 2690 struct snd_kcontrol_new *knew;
2691 2691
@@ -2701,9 +2701,7 @@ stac_control_new(struct sigmatel_spec *spec,
2701 spec->kctls.alloced--; 2701 spec->kctls.alloced--;
2702 return NULL; 2702 return NULL;
2703 } 2703 }
2704 if (nid) 2704 knew->subdevice = subdev;
2705 knew->subdevice = HDA_SUBDEV_NID_FLAG |
2706 HDA_SUBDEV_AMP_FLAG | nid;
2707 return knew; 2705 return knew;
2708} 2706}
2709 2707
@@ -2713,7 +2711,7 @@ static int stac92xx_add_control_temp(struct sigmatel_spec *spec,
2713 unsigned long val) 2711 unsigned long val)
2714{ 2712{
2715 struct snd_kcontrol_new *knew = stac_control_new(spec, ktemp, name, 2713 struct snd_kcontrol_new *knew = stac_control_new(spec, ktemp, name,
2716 get_amp_nid_(val)); 2714 HDA_SUBDEV_AMP_FLAG);
2717 if (!knew) 2715 if (!knew)
2718 return -ENOMEM; 2716 return -ENOMEM;
2719 knew->index = idx; 2717 knew->index = idx;
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index b94cdee5eb53..de4839e46762 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -458,9 +458,7 @@ static int via_add_control(struct via_spec *spec, int type, const char *name,
458 if (!knew->name) 458 if (!knew->name)
459 return -ENOMEM; 459 return -ENOMEM;
460 if (get_amp_nid_(val)) 460 if (get_amp_nid_(val))
461 knew->subdevice = HDA_SUBDEV_NID_FLAG | 461 knew->subdevice = HDA_SUBDEV_AMP_FLAG;
462 HDA_SUBDEV_AMP_FLAG |
463 get_amp_nid_(val);
464 knew->private_value = val; 462 knew->private_value = val;
465 return 0; 463 return 0;
466} 464}