Hi,

I have spent some time to get ACPI S3 working on my Dell Latitude D800.
The remaining problem is that the soundcard does not work after resume.

I am running a patched 2.6.3 Kernel with Alsa 1.0.2c.

Without unloading the drivers before suspend I get lots of the following
messages after resume:

Mar 23 21:24:57 beja kernel: ALSA
/usr/src/modules/alsa-driver/kbuild/../pci/int
el8x0.c:606: codec_read 0: semaphore is not ready for register 0x2

I found a posting[1] on [EMAIL PROTECTED] which seemed to
describe a similar problem with the pci config space not being correctly
saved and restored by the driver.

I used a shell script to save and restore pci config space with
lspci/setpci before suspend and after resume. 
Using this script to restore the pci config space after resume and
calling  
alsactl power D3
alsactl power D0
after resume made the soundcard working again!

Although I have hardly any C skills I then tried to fix the driver code.
You can find my poor patch attached. But now it seems to me that
snd_intel8x0_suspend isn't even called before suspend and I am a bit at
a loss.

Any hints appreciated.

Christoph


[1]:http://sourceforge.net/mailarchive/message.php?msg_id=7591163



--- pci/intel8x0.c.orig Tue Mar 23 20:04:03 2004
+++ pci/intel8x0.c      Tue Mar 23 21:21:56 2004
@@ -426,6 +426,7 @@
        
 #ifdef CONFIG_PM
        int in_suspend;
+       u32 pm_state[16];
 #endif
 };
 
@@ -2182,13 +2183,25 @@
 static int snd_intel8x0_suspend(struct pci_dev *dev, u32 state)
 {
        intel8x0_t *chip = snd_magic_cast(intel8x0_t, pci_get_drvdata(dev), return 
-ENXIO);
+       snd_printk("IN SUSPEND0\n");
        intel8x0_suspend(chip);
+       
+       snd_printk("IN SUSPEND\n");
+       pci_save_state(dev, chip->pm_state);
+       pci_disable_device(dev);
+       pci_set_power_state(dev, state);
+       
        return 0;
 }
 static int snd_intel8x0_resume(struct pci_dev *dev)
 {
        intel8x0_t *chip = snd_magic_cast(intel8x0_t, pci_get_drvdata(dev), return 
-ENXIO);
        intel8x0_resume(chip);
+       
+       snd_printk("IN RESUME\n");
+       pci_set_power_state(dev, 0);
+       pci_restore_state(dev, chip->pm_state);
+       
        return 0;
 }
 #else

Reply via email to