aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorHerton Ronaldo Krzesinski <herton@mandriva.com>2008-03-18 04:27:08 -0400
committerTakashi Iwai <tiwai@suse.de>2008-04-24 06:00:26 -0400
commitf32a19e3e7e72cc896d02c3d104f58dc972d43ea (patch)
tree5121eab3c3e0a46e58ff82bea96e80e772676fe8 /sound/pci/hda
parent9ecaedae0de906f0b5f8dbc09cd610f7056ba975 (diff)
[ALSA] hda-codec - Fix DAC assignment order in ALC883
Actually clfe and surround DACs are inverted in alc883_dac_nids array (see ALC883 datasheet). I discovered this while testing multi-channel setup (using 3stack-6ch-dig model) on MSI 945GCM5 V2 motherboard that has an ALC883 codec. Simply Rear Left/Right and Center/LFE were swapped in 6 channel mode (also in 4 channel mode you didn't get rear left/right output). Other models also were affected by this bug, as can be seen by the mixer layouts that "workaround" this (the real bug was not noticed, and some other models simply played with mixer and initial verbs). Thus along with fixing the order of dac nids, also change the models that relied on previous dac ordering properly. Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/patch_realtek.c56
1 files changed, 22 insertions, 34 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index bf729f518f87..d55987479dd3 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6450,7 +6450,7 @@ static int patch_alc882(struct hda_codec *codec)
6450 6450
6451static hda_nid_t alc883_dac_nids[4] = { 6451static hda_nid_t alc883_dac_nids[4] = {
6452 /* front, rear, clfe, rear_surr */ 6452 /* front, rear, clfe, rear_surr */
6453 0x02, 0x04, 0x03, 0x05 6453 0x02, 0x03, 0x04, 0x05
6454}; 6454};
6455 6455
6456static hda_nid_t alc883_adc_nids[2] = { 6456static hda_nid_t alc883_adc_nids[2] = {
@@ -6958,12 +6958,12 @@ static struct snd_kcontrol_new alc883_medion_md2_mixer[] = {
6958static struct snd_kcontrol_new alc888_6st_hp_mixer[] = { 6958static struct snd_kcontrol_new alc888_6st_hp_mixer[] = {
6959 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 6959 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
6960 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 6960 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
6961 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0e, 0x0, HDA_OUTPUT), 6961 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
6962 HDA_BIND_MUTE("Surround Playback Switch", 0x0e, 2, HDA_INPUT), 6962 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
6963 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT), 6963 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
6964 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT), 6964 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
6965 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT), 6965 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
6966 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT), 6966 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
6967 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT), 6967 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
6968 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT), 6968 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
6969 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT), 6969 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
@@ -6998,12 +6998,12 @@ static struct snd_kcontrol_new alc888_6st_hp_mixer[] = {
6998static struct snd_kcontrol_new alc888_3st_hp_mixer[] = { 6998static struct snd_kcontrol_new alc888_3st_hp_mixer[] = {
6999 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 6999 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
7000 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 7000 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
7001 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0e, 0x0, HDA_OUTPUT), 7001 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
7002 HDA_BIND_MUTE("Surround Playback Switch", 0x0e, 2, HDA_INPUT), 7002 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
7003 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT), 7003 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
7004 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT), 7004 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
7005 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT), 7005 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
7006 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT), 7006 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
7007 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT), 7007 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
7008 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 7008 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
7009 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 7009 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
@@ -7036,12 +7036,12 @@ static struct snd_kcontrol_new alc888_3st_hp_mixer[] = {
7036static struct snd_kcontrol_new alc888_6st_dell_mixer[] = { 7036static struct snd_kcontrol_new alc888_6st_dell_mixer[] = {
7037 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 7037 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
7038 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 7038 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
7039 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0e, 0x0, HDA_OUTPUT), 7039 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
7040 HDA_BIND_MUTE("Surround Playback Switch", 0x0e, 2, HDA_INPUT), 7040 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
7041 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT), 7041 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
7042 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT), 7042 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
7043 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT), 7043 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
7044 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT), 7044 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
7045 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT), 7045 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
7046 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT), 7046 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
7047 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT), 7047 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
@@ -7332,26 +7332,14 @@ static struct hda_verb alc883_haier_w66_verbs[] = {
7332 { } /* end */ 7332 { } /* end */
7333}; 7333};
7334 7334
7335static struct hda_verb alc888_6st_hp_verbs[] = {
7336 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front: output 0 (0x0c) */
7337 {0x15, AC_VERB_SET_CONNECT_SEL, 0x02}, /* Rear : output 2 (0x0e) */
7338 {0x16, AC_VERB_SET_CONNECT_SEL, 0x01}, /* CLFE : output 1 (0x0d) */
7339 {0x17, AC_VERB_SET_CONNECT_SEL, 0x03}, /* Side : output 3 (0x0f) */
7340 { }
7341};
7342
7343static struct hda_verb alc888_3st_hp_verbs[] = { 7335static struct hda_verb alc888_3st_hp_verbs[] = {
7344 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front: output 0 (0x0c) */ 7336 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front: output 0 (0x0c) */
7345 {0x18, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Rear : output 1 (0x0d) */ 7337 {0x16, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Rear : output 1 (0x0d) */
7346 {0x16, AC_VERB_SET_CONNECT_SEL, 0x02}, /* CLFE : output 2 (0x0e) */ 7338 {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* CLFE : output 2 (0x0e) */
7347 { } 7339 { }
7348}; 7340};
7349 7341
7350static struct hda_verb alc888_6st_dell_verbs[] = { 7342static struct hda_verb alc888_6st_dell_verbs[] = {
7351 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front: output 0 (0x0c) */
7352 {0x15, AC_VERB_SET_CONNECT_SEL, 0x02}, /* Rear : output 1 (0x0e) */
7353 {0x16, AC_VERB_SET_CONNECT_SEL, 0x01}, /* CLFE : output 2 (0x0d) */
7354 {0x17, AC_VERB_SET_CONNECT_SEL, 0x03}, /* Side : output 3 (0x0f) */
7355 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 7343 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
7356 { } 7344 { }
7357}; 7345};
@@ -7985,7 +7973,7 @@ static struct alc_config_preset alc883_presets[] = {
7985 }, 7973 },
7986 [ALC888_6ST_HP] = { 7974 [ALC888_6ST_HP] = {
7987 .mixers = { alc888_6st_hp_mixer, alc883_chmode_mixer }, 7975 .mixers = { alc888_6st_hp_mixer, alc883_chmode_mixer },
7988 .init_verbs = { alc883_init_verbs, alc888_6st_hp_verbs }, 7976 .init_verbs = { alc883_init_verbs },
7989 .num_dacs = ARRAY_SIZE(alc883_dac_nids), 7977 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
7990 .dac_nids = alc883_dac_nids, 7978 .dac_nids = alc883_dac_nids,
7991 .dig_out_nid = ALC883_DIGOUT_NID, 7979 .dig_out_nid = ALC883_DIGOUT_NID,