From 4f86f120d9d65b3a8f17e48dca1f991d861b5cd7 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 22 Nov 2012 17:18:49 +0100 Subject: ALSA: emu10k1: don't update firmware during suspend/resume Add a flag to suppress the update in emu1010_firmware_thread() during suspend/resume. Signed-off-by: Takashi Iwai --- sound/pci/emu10k1/emu10k1.c | 4 ++++ sound/pci/emu10k1/emu10k1_main.c | 2 ++ 2 files changed, 6 insertions(+) (limited to 'sound') diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c index b7c1875ba90e..a168138efc5e 100644 --- a/sound/pci/emu10k1/emu10k1.c +++ b/sound/pci/emu10k1/emu10k1.c @@ -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; } diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index 1dfb94d16b8b..cfd6cf952d44 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -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, ®); /* OPTIONS: Which cards are attached to the EMU */ if (reg & EMU_HANA_OPTION_DOCK_OFFLINE) { -- cgit v1.2.3