Merge branch 'fix/hda' into topic/hda
[pandora-kernel.git] / sound / pci / hda / patch_realtek.c
index 0f6b6a6..88a9da4 100644 (file)
@@ -6849,6 +6849,13 @@ static struct hda_verb alc882_base_init_verbs[] = {
        {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
        {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
 
+       /* mute analog input loopbacks */
+       {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+       {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
+       {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
+       {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
+       {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
+
        /* Front Pin: output 0 (0x0c) */
        {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
        {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
@@ -6915,9 +6922,6 @@ static struct hda_verb alc882_adc1_init_verbs[] = {
        { }
 };
 
-/* HACK - expand to two elements */
-#define alc882_init_verbs      alc882_base_init_verbs, alc882_adc1_init_verbs
-
 static struct hda_verb alc882_eapd_verbs[] = {
        /* change to EAPD mode */
        {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
@@ -7162,9 +7166,6 @@ static struct hda_verb alc882_targa_verbs[] = {
        {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
 
        {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
-       {0x01, AC_VERB_SET_GPIO_MASK, 0x03},
-       {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03},
-       {0x01, AC_VERB_SET_GPIO_DATA, 0x03},
        { } /* end */
 };
 
@@ -8418,6 +8419,7 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = {
        SND_PCI_QUIRK(0x1462, 0x3fc3, "MSI", ALC883_TARGA_DIG),
        SND_PCI_QUIRK(0x1462, 0x3fcc, "MSI", ALC883_TARGA_DIG),
        SND_PCI_QUIRK(0x1462, 0x3fdf, "MSI", ALC883_TARGA_DIG),
+       SND_PCI_QUIRK(0x1462, 0x42cd, "MSI", ALC883_TARGA_DIG),
        SND_PCI_QUIRK(0x1462, 0x4314, "MSI", ALC883_TARGA_DIG),
        SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG),
        SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG),
@@ -8431,6 +8433,7 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = {
        SND_PCI_QUIRK(0x1462, 0x7327, "MSI", ALC883_6ST_DIG),
        SND_PCI_QUIRK(0x1462, 0x7350, "MSI", ALC883_6ST_DIG),
        SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG),
+       SND_PCI_QUIRK(0x1462, 0xaa08, "MSI", ALC883_TARGA_2ch_DIG),
 
        SND_PCI_QUIRK(0x147b, 0x1083, "Abit IP35-PRO", ALC883_6ST_DIG),
        SND_PCI_QUIRK(0x1558, 0x0721, "Clevo laptop M720R", ALC883_CLEVO_M720),
@@ -8485,7 +8488,8 @@ static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
 static struct alc_config_preset alc882_presets[] = {
        [ALC882_3ST_DIG] = {
                .mixers = { alc882_base_mixer },
-               .init_verbs = { alc882_init_verbs },
+               .init_verbs = { alc882_base_init_verbs,
+                               alc882_adc1_init_verbs },
                .num_dacs = ARRAY_SIZE(alc882_dac_nids),
                .dac_nids = alc882_dac_nids,
                .dig_out_nid = ALC882_DIGOUT_NID,
@@ -8497,7 +8501,8 @@ static struct alc_config_preset alc882_presets[] = {
        },
        [ALC882_6ST_DIG] = {
                .mixers = { alc882_base_mixer, alc882_chmode_mixer },
-               .init_verbs = { alc882_init_verbs },
+               .init_verbs = { alc882_base_init_verbs,
+                               alc882_adc1_init_verbs },
                .num_dacs = ARRAY_SIZE(alc882_dac_nids),
                .dac_nids = alc882_dac_nids,
                .dig_out_nid = ALC882_DIGOUT_NID,
@@ -8508,7 +8513,8 @@ static struct alc_config_preset alc882_presets[] = {
        },
        [ALC882_ARIMA] = {
                .mixers = { alc882_base_mixer, alc882_chmode_mixer },
-               .init_verbs = { alc882_init_verbs, alc882_eapd_verbs },
+               .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
+                               alc882_eapd_verbs },
                .num_dacs = ARRAY_SIZE(alc882_dac_nids),
                .dac_nids = alc882_dac_nids,
                .num_channel_mode = ARRAY_SIZE(alc882_sixstack_modes),
@@ -8517,8 +8523,8 @@ static struct alc_config_preset alc882_presets[] = {
        },
        [ALC882_W2JC] = {
                .mixers = { alc882_w2jc_mixer, alc882_chmode_mixer },
-               .init_verbs = { alc882_init_verbs, alc882_eapd_verbs,
-                               alc880_gpio1_init_verbs },
+               .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
+                               alc882_eapd_verbs, alc880_gpio1_init_verbs },
                .num_dacs = ARRAY_SIZE(alc882_dac_nids),
                .dac_nids = alc882_dac_nids,
                .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
@@ -8580,7 +8586,8 @@ static struct alc_config_preset alc882_presets[] = {
        },
        [ALC882_TARGA] = {
                .mixers = { alc882_targa_mixer, alc882_chmode_mixer },
-               .init_verbs = { alc882_init_verbs, alc882_targa_verbs},
+               .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
+                               alc882_targa_verbs},
                .num_dacs = ARRAY_SIZE(alc882_dac_nids),
                .dac_nids = alc882_dac_nids,
                .dig_out_nid = ALC882_DIGOUT_NID,
@@ -8596,7 +8603,8 @@ static struct alc_config_preset alc882_presets[] = {
        },
        [ALC882_ASUS_A7J] = {
                .mixers = { alc882_asus_a7j_mixer, alc882_chmode_mixer },
-               .init_verbs = { alc882_init_verbs, alc882_asus_a7j_verbs},
+               .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
+                               alc882_asus_a7j_verbs},
                .num_dacs = ARRAY_SIZE(alc882_dac_nids),
                .dac_nids = alc882_dac_nids,
                .dig_out_nid = ALC882_DIGOUT_NID,
@@ -8610,8 +8618,8 @@ static struct alc_config_preset alc882_presets[] = {
        },
        [ALC882_ASUS_A7M] = {
                .mixers = { alc882_asus_a7m_mixer, alc882_chmode_mixer },
-               .init_verbs = { alc882_init_verbs, alc882_eapd_verbs,
-                               alc880_gpio1_init_verbs,
+               .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
+                               alc882_eapd_verbs, alc880_gpio1_init_verbs,
                                alc882_asus_a7m_verbs },
                .num_dacs = ARRAY_SIZE(alc882_dac_nids),
                .dac_nids = alc882_dac_nids,
@@ -8680,7 +8688,8 @@ static struct alc_config_preset alc882_presets[] = {
        },
        [ALC883_TARGA_DIG] = {
                .mixers = { alc883_targa_mixer, alc883_chmode_mixer },
-               .init_verbs = { alc883_init_verbs, alc883_targa_verbs},
+               .init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
+                               alc883_targa_verbs},
                .num_dacs = ARRAY_SIZE(alc883_dac_nids),
                .dac_nids = alc883_dac_nids,
                .dig_out_nid = ALC883_DIGOUT_NID,
@@ -8693,7 +8702,8 @@ static struct alc_config_preset alc882_presets[] = {
        },
        [ALC883_TARGA_2ch_DIG] = {
                .mixers = { alc883_targa_2ch_mixer},
-               .init_verbs = { alc883_init_verbs, alc883_targa_verbs},
+               .init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
+                               alc883_targa_verbs},
                .num_dacs = ARRAY_SIZE(alc883_dac_nids),
                .dac_nids = alc883_dac_nids,
                .adc_nids = alc883_adc_nids_alt,
@@ -12418,20 +12428,11 @@ static struct snd_kcontrol_new alc269_lifebook_mixer[] = {
        { }
 };
 
-/* bind volumes of both NID 0x0c and 0x0d */
-static struct hda_bind_ctls alc269_epc_bind_vol = {
-       .ops = &snd_hda_bind_vol,
-       .values = {
-               HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT),
-               HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT),
-               0
-       },
-};
-
 static struct snd_kcontrol_new alc269_eeepc_mixer[] = {
-       HDA_CODEC_MUTE("iSpeaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
-       HDA_BIND_VOL("LineOut Playback Volume", &alc269_epc_bind_vol),
-       HDA_CODEC_MUTE("LineOut Playback Switch", 0x15, 0x0, HDA_OUTPUT),
+       HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
+       HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
+       HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
+       HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
        { } /* end */
 };
 
@@ -12444,12 +12445,7 @@ static struct snd_kcontrol_new alc269_epc_capture_mixer[] = {
 };
 
 /* FSC amilo */
-static struct snd_kcontrol_new alc269_fujitsu_mixer[] = {
-       HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
-       HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
-       HDA_BIND_VOL("PCM Playback Volume", &alc269_epc_bind_vol),
-       { } /* end */
-};
+#define alc269_fujitsu_mixer   alc269_eeepc_mixer
 
 static struct hda_verb alc269_quanta_fl1_verbs[] = {
        {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},