aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_analog.c
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2009-12-08 10:13:32 -0500
committerJaroslav Kysela <perex@perex.cz>2009-12-15 03:33:04 -0500
commit5b0cb1d850c26893b1468b3a519433a1b7a176be (patch)
treec6f4ab97db6de9230b02d6cfce8976b762f3b485 /sound/pci/hda/patch_analog.c
parentf40542532e96dda5506eb76badea322f2ae4731c (diff)
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_analog.c')
-rw-r--r--sound/pci/hda/patch_analog.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 447eda1f6770..d418842373fd 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[] = {
174static int ad198x_build_controls(struct hda_codec *codec) 174static 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
@@ -239,6 +240,28 @@ static int ad198x_build_controls(struct hda_codec *codec)
239 } 240 }
240 241
241 ad198x_free_kctls(codec); /* no longer needed */ 242 ad198x_free_kctls(codec); /* no longer needed */
243
244 /* assign Capture Source enums to NID */
245 kctl = snd_hda_find_mixer_ctl(codec, "Capture Source");
246 if (!kctl)
247 kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
248 for (i = 0; kctl && i < kctl->count; i++) {
249 err = snd_hda_add_nids(codec, kctl, i, spec->capsrc_nids,
250 spec->input_mux->num_items);
251 if (err < 0)
252 return err;
253 }
254
255 /* assign IEC958 enums to NID */
256 kctl = snd_hda_find_mixer_ctl(codec,
257 SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source");
258 if (kctl) {
259 err = snd_hda_add_nid(codec, kctl, 0,
260 spec->multiout.dig_out_nid);
261 if (err < 0)
262 return err;
263 }
264
242 return 0; 265 return 0;
243} 266}
244 267
@@ -701,6 +724,7 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
701 { 724 {
702 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 725 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
703 .name = "External Amplifier", 726 .name = "External Amplifier",
727 .subdevice = HDA_SUBDEV_NID_FLAG | 0x1b,
704 .info = ad198x_eapd_info, 728 .info = ad198x_eapd_info,
705 .get = ad198x_eapd_get, 729 .get = ad198x_eapd_get,
706 .put = ad198x_eapd_put, 730 .put = ad198x_eapd_put,
@@ -808,6 +832,7 @@ static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = {
808 { 832 {
809 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 833 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
810 .name = "Master Playback Switch", 834 .name = "Master Playback Switch",
835 .subdevice = HDA_SUBDEV_NID_FLAG | 0x1a,
811 .info = snd_hda_mixer_amp_switch_info, 836 .info = snd_hda_mixer_amp_switch_info,
812 .get = snd_hda_mixer_amp_switch_get, 837 .get = snd_hda_mixer_amp_switch_get,
813 .put = ad1986a_hp_master_sw_put, 838 .put = ad1986a_hp_master_sw_put,
@@ -1608,6 +1633,7 @@ static struct snd_kcontrol_new ad1981_hp_mixers[] = {
1608 HDA_BIND_VOL("Master Playback Volume", &ad1981_hp_bind_master_vol), 1633 HDA_BIND_VOL("Master Playback Volume", &ad1981_hp_bind_master_vol),
1609 { 1634 {
1610 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1635 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1636 .subdevice = HDA_SUBDEV_NID_FLAG | 0x05,
1611 .name = "Master Playback Switch", 1637 .name = "Master Playback Switch",
1612 .info = ad198x_eapd_info, 1638 .info = ad198x_eapd_info,
1613 .get = ad198x_eapd_get, 1639 .get = ad198x_eapd_get,
@@ -2121,6 +2147,7 @@ static struct snd_kcontrol_new ad1988_laptop_mixers[] = {
2121 { 2147 {
2122 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2148 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2123 .name = "External Amplifier", 2149 .name = "External Amplifier",
2150 .subdevice = HDA_SUBDEV_NID_FLAG | 0x12,
2124 .info = ad198x_eapd_info, 2151 .info = ad198x_eapd_info,
2125 .get = ad198x_eapd_get, 2152 .get = ad198x_eapd_get,
2126 .put = ad198x_eapd_put, 2153 .put = ad198x_eapd_put,
@@ -2242,6 +2269,7 @@ static struct snd_kcontrol_new ad1988_spdif_out_mixers[] = {
2242 { 2269 {
2243 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2270 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2244 .name = "IEC958 Playback Source", 2271 .name = "IEC958 Playback Source",
2272 .subdevice = HDA_SUBDEV_NID_FLAG | 0x1b,
2245 .info = ad1988_spdif_playback_source_info, 2273 .info = ad1988_spdif_playback_source_info,
2246 .get = ad1988_spdif_playback_source_get, 2274 .get = ad1988_spdif_playback_source_get,
2247 .put = ad1988_spdif_playback_source_put, 2275 .put = ad1988_spdif_playback_source_put,
@@ -3728,6 +3756,7 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = {
3728 { 3756 {
3729 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3757 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3730 .name = "Master Playback Switch", 3758 .name = "Master Playback Switch",
3759 .subdevice = HDA_SUBDEV_NID_FLAG | 0x21,
3731 .info = snd_hda_mixer_amp_switch_info, 3760 .info = snd_hda_mixer_amp_switch_info,
3732 .get = snd_hda_mixer_amp_switch_get, 3761 .get = snd_hda_mixer_amp_switch_get,
3733 .put = ad1884a_mobile_master_sw_put, 3762 .put = ad1884a_mobile_master_sw_put,
@@ -3756,6 +3785,7 @@ static struct snd_kcontrol_new ad1884a_mobile_mixers[] = {
3756 { 3785 {
3757 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3786 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3758 .name = "Master Playback Switch", 3787 .name = "Master Playback Switch",
3788 .subdevice = HDA_SUBDEV_NID_FLAG | 0x21,
3759 .info = snd_hda_mixer_amp_switch_info, 3789 .info = snd_hda_mixer_amp_switch_info,
3760 .get = snd_hda_mixer_amp_switch_get, 3790 .get = snd_hda_mixer_amp_switch_get,
3761 .put = ad1884a_mobile_master_sw_put, 3791 .put = ad1884a_mobile_master_sw_put,
@@ -4097,6 +4127,7 @@ static struct snd_kcontrol_new ad1984a_touchsmart_mixers[] = {
4097/* HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/ 4127/* HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/
4098 { 4128 {
4099 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 4129 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
4130 .subdevice = HDA_SUBDEV_NID_FLAG | 0x21,
4100 .name = "Master Playback Switch", 4131 .name = "Master Playback Switch",
4101 .info = snd_hda_mixer_amp_switch_info, 4132 .info = snd_hda_mixer_amp_switch_info,
4102 .get = snd_hda_mixer_amp_switch_get, 4133 .get = snd_hda_mixer_amp_switch_get,