diff -r b201c63fc4b3 pci/hda/patch_realtek.c --- a/pci/hda/patch_realtek.c Mon Dec 04 18:03:53 2006 +0100 +++ b/pci/hda/patch_realtek.c Thu Dec 07 15:37:34 2006 -0800 @@ -112,6 +112,7 @@ enum { ALC882_6ST_DIG, ALC882_ARIMA, ALC882_AUTO, + ALC885_MACPRO, ALC882_MODEL_LAST, }; @@ -4507,6 +4508,39 @@ static struct hda_verb alc882_eapd_verbs { } }; +/* Mac Pro test */ +static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted) +{ + unsigned int gpiostate, gpiomask, gpiodir; + + gpiostate = snd_hda_codec_read(codec, codec->afg, 0, + AC_VERB_GET_GPIO_DATA, 0); + + if (!muted) + gpiostate |= (1 << pin); + else + gpiostate &= ~(1 << pin); + + gpiomask = snd_hda_codec_read(codec, codec->afg, 0, + AC_VERB_GET_GPIO_MASK, 0); + gpiomask |= (1 << pin); + + gpiodir = snd_hda_codec_read(codec, codec->afg, 0, + AC_VERB_GET_GPIO_DIRECTION, 0); + gpiodir |= (1 << pin); + + + snd_hda_codec_write(codec, codec->afg, 0, + AC_VERB_SET_GPIO_MASK, gpiomask); + snd_hda_codec_write(codec, codec->afg, 0, + AC_VERB_SET_GPIO_DIRECTION, gpiodir); + + msleep(1); + + snd_hda_codec_write(codec, codec->afg, 0, + AC_VERB_SET_GPIO_DATA, gpiostate); +} + /* * generic initialization of ADC, input mixers and output mixers */ @@ -4633,6 +4667,7 @@ static const char *alc882_models[ALC882_ [ALC882_3ST_DIG] = "3stack-dig", [ALC882_6ST_DIG] = "6stack-dig", [ALC882_ARIMA] = "arima", + [ALC885_MACPRO] = "macpro", [ALC882_AUTO] = "auto", }; @@ -4675,6 +4710,17 @@ static struct alc_config_preset alc882_p .dac_nids = alc882_dac_nids, .num_channel_mode = ARRAY_SIZE(alc882_sixstack_modes), .channel_mode = alc882_sixstack_modes, + .input_mux = &alc882_capture_source, + }, + [ALC885_MACPRO] = { + .mixers = { alc882_base_mixer }, + .init_verbs = { alc882_init_verbs }, + .num_dacs = ARRAY_SIZE(alc882_dac_nids), + .dac_nids = alc882_dac_nids, + .dig_out_nid = ALC882_DIGOUT_NID, + .dig_in_nid = ALC882_DIGIN_NID, + .num_channel_mode = ARRAY_SIZE(alc882_ch_modes), + .channel_mode = alc882_ch_modes, .input_mux = &alc882_capture_source, }, }; @@ -4803,6 +4849,11 @@ static int patch_alc882(struct hda_codec if (board_config != ALC882_AUTO) setup_preset(spec, &alc882_presets[board_config]); + + if (board_config == ALC885_MACPRO) { + alc882_gpio_mute(codec, 0, 0); + alc882_gpio_mute(codec, 1, 0); + } spec->stream_name_analog = "ALC882 Analog"; spec->stream_analog_playback = &alc882_pcm_analog_playback;