aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2011-12-09 05:27:42 -0500
committerTakashi Iwai <tiwai@suse.de>2011-12-12 06:21:30 -0500
commitfde48a1f808e2bb6aaad5709d2470d814a157c86 (patch)
tree79451e9318b60ff798b9769470963fd69b475a10 /sound
parentffe7e4063987678c00589717d7871f837c6e7300 (diff)
ALSA: HDA: Realtek: Take vmaster dac from multiout dac list
With the auto-parser we can choose the dac nid for vmaster from the DACs we already know, instead of hard-coding it. This is more future-proof and was actually wrong on one machine. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c37
1 files changed, 15 insertions, 22 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 8a74c1e8eedb..690f2a2a4595 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3039,6 +3039,8 @@ static int alc_auto_fill_extra_dacs(struct hda_codec *codec, int num_outs,
3039 3039
3040static int alc_auto_fill_multi_ios(struct hda_codec *codec, 3040static int alc_auto_fill_multi_ios(struct hda_codec *codec,
3041 unsigned int location, int offset); 3041 unsigned int location, int offset);
3042static hda_nid_t alc_look_for_out_vol_nid(struct hda_codec *codec,
3043 hda_nid_t pin, hda_nid_t dac);
3042 3044
3043/* fill in the dac_nids table from the parsed pin configuration */ 3045/* fill in the dac_nids table from the parsed pin configuration */
3044static int alc_auto_fill_dac_nids(struct hda_codec *codec) 3046static int alc_auto_fill_dac_nids(struct hda_codec *codec)
@@ -3153,6 +3155,10 @@ static int alc_auto_fill_dac_nids(struct hda_codec *codec)
3153 } 3155 }
3154 } 3156 }
3155 3157
3158 if (cfg->line_out_pins[0])
3159 spec->vmaster_nid =
3160 alc_look_for_out_vol_nid(codec, cfg->line_out_pins[0],
3161 spec->multiout.dac_nids[0]);
3156 return 0; 3162 return 0;
3157} 3163}
3158 3164
@@ -4175,8 +4181,10 @@ static int patch_alc880(struct hda_codec *codec)
4175#endif 4181#endif
4176 } 4182 }
4177 4183
4178 if (board_config != ALC_MODEL_AUTO) 4184 if (board_config != ALC_MODEL_AUTO) {
4185 spec->vmaster_nid = 0x0c;
4179 setup_preset(codec, &alc880_presets[board_config]); 4186 setup_preset(codec, &alc880_presets[board_config]);
4187 }
4180 4188
4181 if (!spec->no_analog && !spec->adc_nids) { 4189 if (!spec->no_analog && !spec->adc_nids) {
4182 alc_auto_fill_adc_caps(codec); 4190 alc_auto_fill_adc_caps(codec);
@@ -4196,8 +4204,6 @@ static int patch_alc880(struct hda_codec *codec)
4196 4204
4197 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 4205 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
4198 4206
4199 spec->vmaster_nid = 0x0c;
4200
4201 codec->patch_ops = alc_patch_ops; 4207 codec->patch_ops = alc_patch_ops;
4202 if (board_config == ALC_MODEL_AUTO) 4208 if (board_config == ALC_MODEL_AUTO)
4203 spec->init_hook = alc_auto_init_std; 4209 spec->init_hook = alc_auto_init_std;
@@ -4304,8 +4310,10 @@ static int patch_alc260(struct hda_codec *codec)
4304#endif 4310#endif
4305 } 4311 }
4306 4312
4307 if (board_config != ALC_MODEL_AUTO) 4313 if (board_config != ALC_MODEL_AUTO) {
4308 setup_preset(codec, &alc260_presets[board_config]); 4314 setup_preset(codec, &alc260_presets[board_config]);
4315 spec->vmaster_nid = 0x08;
4316 }
4309 4317
4310 if (!spec->no_analog && !spec->adc_nids) { 4318 if (!spec->no_analog && !spec->adc_nids) {
4311 alc_auto_fill_adc_caps(codec); 4319 alc_auto_fill_adc_caps(codec);
@@ -4325,8 +4333,6 @@ static int patch_alc260(struct hda_codec *codec)
4325 4333
4326 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 4334 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
4327 4335
4328 spec->vmaster_nid = 0x08;
4329
4330 codec->patch_ops = alc_patch_ops; 4336 codec->patch_ops = alc_patch_ops;
4331 if (board_config == ALC_MODEL_AUTO) 4337 if (board_config == ALC_MODEL_AUTO)
4332 spec->init_hook = alc_auto_init_std; 4338 spec->init_hook = alc_auto_init_std;
@@ -4698,8 +4704,10 @@ static int patch_alc882(struct hda_codec *codec)
4698 goto error; 4704 goto error;
4699 } 4705 }
4700 4706
4701 if (board_config != ALC_MODEL_AUTO) 4707 if (board_config != ALC_MODEL_AUTO) {
4702 setup_preset(codec, &alc882_presets[board_config]); 4708 setup_preset(codec, &alc882_presets[board_config]);
4709 spec->vmaster_nid = 0x0c;
4710 }
4703 4711
4704 if (!spec->no_analog && !spec->adc_nids) { 4712 if (!spec->no_analog && !spec->adc_nids) {
4705 alc_auto_fill_adc_caps(codec); 4713 alc_auto_fill_adc_caps(codec);
@@ -4719,8 +4727,6 @@ static int patch_alc882(struct hda_codec *codec)
4719 4727
4720 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 4728 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
4721 4729
4722 spec->vmaster_nid = 0x0c;
4723
4724 codec->patch_ops = alc_patch_ops; 4730 codec->patch_ops = alc_patch_ops;
4725 if (board_config == ALC_MODEL_AUTO) 4731 if (board_config == ALC_MODEL_AUTO)
4726 spec->init_hook = alc_auto_init_std; 4732 spec->init_hook = alc_auto_init_std;
@@ -4899,8 +4905,6 @@ static int patch_alc262(struct hda_codec *codec)
4899 4905
4900 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 4906 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
4901 4907
4902 spec->vmaster_nid = 0x0c;
4903
4904 codec->patch_ops = alc_patch_ops; 4908 codec->patch_ops = alc_patch_ops;
4905 spec->init_hook = alc_auto_init_std; 4909 spec->init_hook = alc_auto_init_std;
4906 spec->shutup = alc_eapd_shutup; 4910 spec->shutup = alc_eapd_shutup;
@@ -5012,8 +5016,6 @@ static int patch_alc268(struct hda_codec *codec)
5012 if (!spec->no_analog && !spec->cap_mixer) 5016 if (!spec->no_analog && !spec->cap_mixer)
5013 set_capture_mixer(codec); 5017 set_capture_mixer(codec);
5014 5018
5015 spec->vmaster_nid = 0x02;
5016
5017 codec->patch_ops = alc_patch_ops; 5019 codec->patch_ops = alc_patch_ops;
5018 spec->init_hook = alc_auto_init_std; 5020 spec->init_hook = alc_auto_init_std;
5019 spec->shutup = alc_eapd_shutup; 5021 spec->shutup = alc_eapd_shutup;
@@ -5568,8 +5570,6 @@ static int patch_alc269(struct hda_codec *codec)
5568 5570
5569 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 5571 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
5570 5572
5571 spec->vmaster_nid = 0x02;
5572
5573 codec->patch_ops = alc_patch_ops; 5573 codec->patch_ops = alc_patch_ops;
5574#ifdef CONFIG_PM 5574#ifdef CONFIG_PM
5575 codec->patch_ops.resume = alc269_resume; 5575 codec->patch_ops.resume = alc269_resume;
@@ -5674,8 +5674,6 @@ static int patch_alc861(struct hda_codec *codec)
5674 set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); 5674 set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
5675 } 5675 }
5676 5676
5677 spec->vmaster_nid = 0x03;
5678
5679 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 5677 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
5680 5678
5681 codec->patch_ops = alc_patch_ops; 5679 codec->patch_ops = alc_patch_ops;
@@ -5800,8 +5798,6 @@ static int patch_alc861vd(struct hda_codec *codec)
5800 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 5798 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
5801 } 5799 }
5802 5800
5803 spec->vmaster_nid = 0x02;
5804
5805 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 5801 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
5806 5802
5807 codec->patch_ops = alc_patch_ops; 5803 codec->patch_ops = alc_patch_ops;
@@ -6184,7 +6180,6 @@ static int patch_alc662(struct hda_codec *codec)
6184 break; 6180 break;
6185 } 6181 }
6186 } 6182 }
6187 spec->vmaster_nid = 0x02;
6188 6183
6189 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE); 6184 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
6190 6185
@@ -6240,8 +6235,6 @@ static int patch_alc680(struct hda_codec *codec)
6240 if (!spec->no_analog && !spec->cap_mixer) 6235 if (!spec->no_analog && !spec->cap_mixer)
6241 set_capture_mixer(codec); 6236 set_capture_mixer(codec);
6242 6237
6243 spec->vmaster_nid = 0x02;
6244
6245 codec->patch_ops = alc_patch_ops; 6238 codec->patch_ops = alc_patch_ops;
6246 spec->init_hook = alc_auto_init_std; 6239 spec->init_hook = alc_auto_init_std;
6247 6240