diff options
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 1a36137e13ec..92b72d4f3984 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -174,6 +174,7 @@ static struct snd_kcontrol_new ad_beep_mixer[] = { | |||
174 | static int ad198x_build_controls(struct hda_codec *codec) | 174 | static int ad198x_build_controls(struct hda_codec *codec) |
175 | { | 175 | { |
176 | struct ad198x_spec *spec = codec->spec; | 176 | struct ad198x_spec *spec = codec->spec; |
177 | struct snd_kcontrol *kctl; | ||
177 | unsigned int i; | 178 | unsigned int i; |
178 | int err; | 179 | int err; |
179 | 180 | ||
@@ -208,9 +209,7 @@ static int ad198x_build_controls(struct hda_codec *codec) | |||
208 | if (!kctl) | 209 | if (!kctl) |
209 | return -ENOMEM; | 210 | return -ENOMEM; |
210 | kctl->private_value = spec->beep_amp; | 211 | kctl->private_value = spec->beep_amp; |
211 | err = snd_hda_ctl_add(codec, | 212 | err = snd_hda_ctl_add(codec, 0, kctl); |
212 | get_amp_nid_(spec->beep_amp), | ||
213 | kctl); | ||
214 | if (err < 0) | 213 | if (err < 0) |
215 | return err; | 214 | return err; |
216 | } | 215 | } |
@@ -239,6 +238,28 @@ static int ad198x_build_controls(struct hda_codec *codec) | |||
239 | } | 238 | } |
240 | 239 | ||
241 | ad198x_free_kctls(codec); /* no longer needed */ | 240 | ad198x_free_kctls(codec); /* no longer needed */ |
241 | |||
242 | /* assign Capture Source enums to NID */ | ||
243 | kctl = snd_hda_find_mixer_ctl(codec, "Capture Source"); | ||
244 | if (!kctl) | ||
245 | kctl = snd_hda_find_mixer_ctl(codec, "Input Source"); | ||
246 | for (i = 0; kctl && i < kctl->count; i++) { | ||
247 | err = snd_hda_add_nids(codec, kctl, i, spec->capsrc_nids, | ||
248 | spec->input_mux->num_items); | ||
249 | if (err < 0) | ||
250 | return err; | ||
251 | } | ||
252 | |||
253 | /* assign IEC958 enums to NID */ | ||
254 | kctl = snd_hda_find_mixer_ctl(codec, | ||
255 | SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source"); | ||
256 | if (kctl) { | ||
257 | err = snd_hda_add_nid(codec, kctl, 0, | ||
258 | spec->multiout.dig_out_nid); | ||
259 | if (err < 0) | ||
260 | return err; | ||
261 | } | ||
262 | |||
242 | return 0; | 263 | return 0; |
243 | } | 264 | } |
244 | 265 | ||
@@ -701,6 +722,7 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = { | |||
701 | { | 722 | { |
702 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 723 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
703 | .name = "External Amplifier", | 724 | .name = "External Amplifier", |
725 | .subdevice = HDA_SUBDEV_NID_FLAG | 0x1b, | ||
704 | .info = ad198x_eapd_info, | 726 | .info = ad198x_eapd_info, |
705 | .get = ad198x_eapd_get, | 727 | .get = ad198x_eapd_get, |
706 | .put = ad198x_eapd_put, | 728 | .put = ad198x_eapd_put, |
@@ -808,6 +830,7 @@ static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = { | |||
808 | { | 830 | { |
809 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 831 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
810 | .name = "Master Playback Switch", | 832 | .name = "Master Playback Switch", |
833 | .subdevice = HDA_SUBDEV_AMP_FLAG, | ||
811 | .info = snd_hda_mixer_amp_switch_info, | 834 | .info = snd_hda_mixer_amp_switch_info, |
812 | .get = snd_hda_mixer_amp_switch_get, | 835 | .get = snd_hda_mixer_amp_switch_get, |
813 | .put = ad1986a_hp_master_sw_put, | 836 | .put = ad1986a_hp_master_sw_put, |
@@ -1608,6 +1631,7 @@ static struct snd_kcontrol_new ad1981_hp_mixers[] = { | |||
1608 | HDA_BIND_VOL("Master Playback Volume", &ad1981_hp_bind_master_vol), | 1631 | HDA_BIND_VOL("Master Playback Volume", &ad1981_hp_bind_master_vol), |
1609 | { | 1632 | { |
1610 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1633 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1634 | .subdevice = HDA_SUBDEV_NID_FLAG | 0x05, | ||
1611 | .name = "Master Playback Switch", | 1635 | .name = "Master Playback Switch", |
1612 | .info = ad198x_eapd_info, | 1636 | .info = ad198x_eapd_info, |
1613 | .get = ad198x_eapd_get, | 1637 | .get = ad198x_eapd_get, |
@@ -2129,6 +2153,7 @@ static struct snd_kcontrol_new ad1988_laptop_mixers[] = { | |||
2129 | { | 2153 | { |
2130 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2154 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
2131 | .name = "External Amplifier", | 2155 | .name = "External Amplifier", |
2156 | .subdevice = HDA_SUBDEV_NID_FLAG | 0x12, | ||
2132 | .info = ad198x_eapd_info, | 2157 | .info = ad198x_eapd_info, |
2133 | .get = ad198x_eapd_get, | 2158 | .get = ad198x_eapd_get, |
2134 | .put = ad198x_eapd_put, | 2159 | .put = ad198x_eapd_put, |
@@ -2250,6 +2275,7 @@ static struct snd_kcontrol_new ad1988_spdif_out_mixers[] = { | |||
2250 | { | 2275 | { |
2251 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2276 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
2252 | .name = "IEC958 Playback Source", | 2277 | .name = "IEC958 Playback Source", |
2278 | .subdevice = HDA_SUBDEV_NID_FLAG | 0x1b, | ||
2253 | .info = ad1988_spdif_playback_source_info, | 2279 | .info = ad1988_spdif_playback_source_info, |
2254 | .get = ad1988_spdif_playback_source_get, | 2280 | .get = ad1988_spdif_playback_source_get, |
2255 | .put = ad1988_spdif_playback_source_put, | 2281 | .put = ad1988_spdif_playback_source_put, |
@@ -2582,7 +2608,7 @@ static int add_control(struct ad198x_spec *spec, int type, const char *name, | |||
2582 | if (! knew->name) | 2608 | if (! knew->name) |
2583 | return -ENOMEM; | 2609 | return -ENOMEM; |
2584 | if (get_amp_nid_(val)) | 2610 | if (get_amp_nid_(val)) |
2585 | knew->subdevice = HDA_SUBDEV_NID_FLAG | get_amp_nid_(val); | 2611 | knew->subdevice = HDA_SUBDEV_AMP_FLAG; |
2586 | knew->private_value = val; | 2612 | knew->private_value = val; |
2587 | return 0; | 2613 | return 0; |
2588 | } | 2614 | } |
@@ -3736,6 +3762,7 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = { | |||
3736 | { | 3762 | { |
3737 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 3763 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
3738 | .name = "Master Playback Switch", | 3764 | .name = "Master Playback Switch", |
3765 | .subdevice = HDA_SUBDEV_AMP_FLAG, | ||
3739 | .info = snd_hda_mixer_amp_switch_info, | 3766 | .info = snd_hda_mixer_amp_switch_info, |
3740 | .get = snd_hda_mixer_amp_switch_get, | 3767 | .get = snd_hda_mixer_amp_switch_get, |
3741 | .put = ad1884a_mobile_master_sw_put, | 3768 | .put = ad1884a_mobile_master_sw_put, |
@@ -3764,6 +3791,7 @@ static struct snd_kcontrol_new ad1884a_mobile_mixers[] = { | |||
3764 | { | 3791 | { |
3765 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 3792 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
3766 | .name = "Master Playback Switch", | 3793 | .name = "Master Playback Switch", |
3794 | .subdevice = HDA_SUBDEV_AMP_FLAG, | ||
3767 | .info = snd_hda_mixer_amp_switch_info, | 3795 | .info = snd_hda_mixer_amp_switch_info, |
3768 | .get = snd_hda_mixer_amp_switch_get, | 3796 | .get = snd_hda_mixer_amp_switch_get, |
3769 | .put = ad1884a_mobile_master_sw_put, | 3797 | .put = ad1884a_mobile_master_sw_put, |
@@ -4105,6 +4133,7 @@ static struct snd_kcontrol_new ad1984a_touchsmart_mixers[] = { | |||
4105 | /* HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ | 4133 | /* HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ |
4106 | { | 4134 | { |
4107 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 4135 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
4136 | .subdevice = HDA_SUBDEV_AMP_FLAG, | ||
4108 | .name = "Master Playback Switch", | 4137 | .name = "Master Playback Switch", |
4109 | .info = snd_hda_mixer_amp_switch_info, | 4138 | .info = snd_hda_mixer_amp_switch_info, |
4110 | .get = snd_hda_mixer_amp_switch_get, | 4139 | .get = snd_hda_mixer_amp_switch_get, |