aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-08-16 09:01:03 -0400
committerJaroslav Kysela <perex@perex.cz>2007-10-16 09:59:04 -0400
commit7debbe51cc001a6deb549999f9d8f53d99c6fd9e (patch)
tree44eb65cbc760100d73007762bbf94b5215bbf40d /sound/pci/hda/patch_realtek.c
parentd273809e2e512d0638d443dce408ac0342ab73cf (diff)
[ALSA] hda-codec - Fix PM on ALC885 Intel Macs
Fix power-management on ALC885 Intel Macs. It fixes the problem with power-saving mode, too. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index b47934f87f8c..b63d185433f9 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5276,6 +5276,20 @@ static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted)
5276 AC_VERB_SET_GPIO_DATA, gpiostate); 5276 AC_VERB_SET_GPIO_DATA, gpiostate);
5277} 5277}
5278 5278
5279/* set up GPIO at initialization */
5280static void alc885_macpro_init_hook(struct hda_codec *codec)
5281{
5282 alc882_gpio_mute(codec, 0, 0);
5283 alc882_gpio_mute(codec, 1, 0);
5284}
5285
5286/* set up GPIO and update auto-muting at initialization */
5287static void alc885_imac24_init_hook(struct hda_codec *codec)
5288{
5289 alc885_macpro_init_hook(codec);
5290 alc885_imac24_automute(codec);
5291}
5292
5279/* 5293/*
5280 * generic initialization of ADC, input mixers and output mixers 5294 * generic initialization of ADC, input mixers and output mixers
5281 */ 5295 */
@@ -5480,6 +5494,7 @@ static struct alc_config_preset alc882_presets[] = {
5480 .num_channel_mode = ARRAY_SIZE(alc882_ch_modes), 5494 .num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
5481 .channel_mode = alc882_ch_modes, 5495 .channel_mode = alc882_ch_modes,
5482 .input_mux = &alc882_capture_source, 5496 .input_mux = &alc882_capture_source,
5497 .init_hook = alc885_macpro_init_hook,
5483 }, 5498 },
5484 [ALC885_IMAC24] = { 5499 [ALC885_IMAC24] = {
5485 .mixers = { alc885_imac24_mixer }, 5500 .mixers = { alc885_imac24_mixer },
@@ -5492,7 +5507,7 @@ static struct alc_config_preset alc882_presets[] = {
5492 .channel_mode = alc882_ch_modes, 5507 .channel_mode = alc882_ch_modes,
5493 .input_mux = &alc882_capture_source, 5508 .input_mux = &alc882_capture_source,
5494 .unsol_event = alc885_imac24_unsol_event, 5509 .unsol_event = alc885_imac24_unsol_event,
5495 .init_hook = alc885_imac24_automute, 5510 .init_hook = alc885_imac24_init_hook,
5496 }, 5511 },
5497 [ALC882_TARGA] = { 5512 [ALC882_TARGA] = {
5498 .mixers = { alc882_targa_mixer, alc882_chmode_mixer, 5513 .mixers = { alc882_targa_mixer, alc882_chmode_mixer,
@@ -5695,11 +5710,6 @@ static int patch_alc882(struct hda_codec *codec)
5695 if (board_config != ALC882_AUTO) 5710 if (board_config != ALC882_AUTO)
5696 setup_preset(spec, &alc882_presets[board_config]); 5711 setup_preset(spec, &alc882_presets[board_config]);
5697 5712
5698 if (board_config == ALC885_MACPRO || board_config == ALC885_IMAC24) {
5699 alc882_gpio_mute(codec, 0, 0);
5700 alc882_gpio_mute(codec, 1, 0);
5701 }
5702
5703 spec->stream_name_analog = "ALC882 Analog"; 5713 spec->stream_name_analog = "ALC882 Analog";
5704 spec->stream_analog_playback = &alc882_pcm_analog_playback; 5714 spec->stream_analog_playback = &alc882_pcm_analog_playback;
5705 spec->stream_analog_capture = &alc882_pcm_analog_capture; 5715 spec->stream_analog_capture = &alc882_pcm_analog_capture;