[ALSA] hda-intel - Don't do suspend if already powered down
authorTakashi Iwai <tiwai@suse.de>
Tue, 14 Aug 2007 13:18:26 +0000 (15:18 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 16 Oct 2007 13:58:55 +0000 (15:58 +0200)
In the power-saving mode, the suspend is done dynamically at power-down.
So we don't have to call suspend stuff explicitly if it's already
powered down.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_intel.c

index fc1ddf408b9ba7de6d42c56dfa0ffbc74afaeaf8..0e923f3f0a80a875e1e6d8ee449b133f1e35488e 100644 (file)
@@ -2771,6 +2771,10 @@ int snd_hda_suspend(struct hda_bus *bus, pm_message_t state)
        struct hda_codec *codec;
 
        list_for_each_entry(codec, &bus->codec_list, list) {
+#ifdef CONFIG_SND_HDA_POWER_SAVE
+               if (!codec->power_on)
+                       continue;
+#endif
                hda_call_codec_suspend(codec);
        }
        return 0;
index e20629a2d7d1cf064f281079a79c59c16d162859..ab698336563c561f1e167199fc5c3eff92342906 100644 (file)
@@ -1550,7 +1550,8 @@ static int azx_suspend(struct pci_dev *pci, pm_message_t state)
        snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
        for (i = 0; i < chip->pcm_devs; i++)
                snd_pcm_suspend_all(chip->pcm[i]);
-       snd_hda_suspend(chip->bus, state);
+       if (chip->initialized)
+               snd_hda_suspend(chip->bus, state);
        azx_stop_chip(chip);
        if (chip->irq >= 0) {
                synchronize_irq(chip->irq);