From 52b723888c1a55d34551f9b0b9d9296e0e3e8d3c Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 30 Jun 2005 13:47:06 +0200 Subject: [ALSA] Fix resume of intel8x0 Intel8x0 driver,AC97 Codec Fix resume of intel8x0 driver. The ac97 codec didn't restore some registers properly, and the restore of ICH4 SPDIF and SDIN settings was missing. Signed-off-by: Takashi Iwai --- sound/pci/intel8x0.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'sound/pci/intel8x0.c') diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index cc16f95f9ce..c3c3b68b454 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -424,6 +424,7 @@ struct _snd_intel8x0 { unsigned xbox: 1; /* workaround for Xbox AC'97 detection */ int spdif_idx; /* SPDIF BAR index; *_SPBAR or -1 if use PCMOUT */ + unsigned int sdm_saved; /* SDM reg value */ ac97_bus_t *ac97_bus; ac97_t *ac97[3]; @@ -2373,6 +2374,8 @@ static int intel8x0_suspend(snd_card_t *card, pm_message_t state) for (i = 0; i < 3; i++) if (chip->ac97[i]) snd_ac97_suspend(chip->ac97[i]); + if (chip->device_type == DEVICE_INTEL_ICH4) + chip->sdm_saved = igetbyte(chip, ICHREG(SDM)); pci_disable_device(chip->pci); return 0; } @@ -2386,6 +2389,16 @@ static int intel8x0_resume(snd_card_t *card) pci_set_master(chip->pci); snd_intel8x0_chip_init(chip, 0); + /* re-initialize mixer stuff */ + if (chip->device_type == DEVICE_INTEL_ICH4) { + /* enable separate SDINs for ICH4 */ + iputbyte(chip, ICHREG(SDM), chip->sdm_saved); + /* use slot 10/11 for SPDIF */ + iputdword(chip, ICHREG(GLOB_CNT), + (igetdword(chip, ICHREG(GLOB_CNT)) & ~ICH_PCM_SPDIF_MASK) | + ICH_PCM_SPDIF_1011); + } + /* refill nocache */ if (chip->fix_nocache) fill_nocache(chip->bdbars.area, chip->bdbars.bytes, 1); -- cgit v1.2.3 From ef21ca24faf28df6d06939e77d5032a313490289 Mon Sep 17 00:00:00 2001 From: Nishanth Aravamudan Date: Sat, 9 Jul 2005 10:13:22 +0200 Subject: [ALSA] sound/pci: fix-up sleeping paths ENS1370/1+ driver,ES1968 driver,Intel8x0 driver,VIA82xx driver VIA82xx-modem driver,AC97 Codec,ALI5451 driver,CS46xx driver MIXART driver,RME HDSP driver,Trident driver,YMFPCI driver Description: Fix-up sleeping in sound/pci. These changes fall under the following two categories: 1) Replace schedule_timeout() with msleep() to guarantee the task delays as expected. This also involved replacing/removing custom sleep functions. 2) Do not assume jiffies will only increment by one if you request a 1 jiffy sleep, i.e. use time_after/time_before in while loops. Signed-off-by: Nishanth Aravamudan Signed-off-by: Jaroslav Kysela --- sound/pci/intel8x0.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sound/pci/intel8x0.c') diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index c3c3b68b454..7c806bd9cc9 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -2464,8 +2464,7 @@ static void __devinit intel8x0_measure_ac97_clock(intel8x0_t *chip) } do_gettimeofday(&start_time); spin_unlock_irq(&chip->reg_lock); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 20); + msleep(50); spin_lock_irq(&chip->reg_lock); /* check the position */ pos = ichdev->fragsize1; -- cgit v1.2.3