ALSA: emu10k1: don't update firmware during suspend/resume
authorTakashi Iwai <tiwai@suse.de>
Thu, 22 Nov 2012 16:18:49 +0000 (17:18 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 22 Nov 2012 16:48:11 +0000 (17:48 +0100)
Add a flag to suppress the update in emu1010_firmware_thread() during
suspend/resume.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/emu10k1.h
sound/pci/emu10k1/emu10k1.c
sound/pci/emu10k1/emu10k1_main.c

index 9dc94b559c7d7ee435e6a77021d8873c009601ba..f841ba4bacb81985f1a52257c8230a22de0333e2 100644 (file)
@@ -1796,6 +1796,7 @@ struct snd_emu10k1 {
        unsigned int *saved_icode;
        unsigned int *p16v_saved;
        unsigned int saved_a_iocfg, saved_hcfg;
+       bool suspend;
 #endif
 
 };
index b7c1875ba90ec2ad06518a1af310fd62d3f357cb..a168138efc5e7885271f6ad41c0560e49a19c5f7 100644 (file)
@@ -215,6 +215,8 @@ static int snd_emu10k1_suspend(struct device *dev)
 
        snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
 
+       emu->suspend = 1;
+
        snd_pcm_suspend_all(emu->pcm);
        snd_pcm_suspend_all(emu->pcm_mic);
        snd_pcm_suspend_all(emu->pcm_efx);
@@ -260,6 +262,8 @@ static int snd_emu10k1_resume(struct device *dev)
        if (emu->card_capabilities->ca0151_chip)
                snd_p16v_resume(emu);
 
+       emu->suspend = 0;
+
        snd_power_change_state(card, SNDRV_CTL_POWER_D0);
        return 0;
 }
index 1dfb94d16b8b0dbbf4eaef6a049a1796354db6e8..cfd6cf952d44ebbf0956d8b0c79a45c722e61332 100644 (file)
@@ -714,6 +714,8 @@ static int emu1010_firmware_thread(void *data)
                msleep_interruptible(1000);
                if (kthread_should_stop())
                        break;
+               if (emu->suspend)
+                       continue;
                snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &tmp); /* IRQ Status */
                snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg); /* OPTIONS: Which cards are attached to the EMU */
                if (reg & EMU_HANA_OPTION_DOCK_OFFLINE) {