Commit 4f86f120 authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarTakashi Iwai <tiwai@suse.de>
parent b209c4df
...@@ -1796,6 +1796,7 @@ struct snd_emu10k1 { ...@@ -1796,6 +1796,7 @@ struct snd_emu10k1 {
unsigned int *saved_icode; unsigned int *saved_icode;
unsigned int *p16v_saved; unsigned int *p16v_saved;
unsigned int saved_a_iocfg, saved_hcfg; unsigned int saved_a_iocfg, saved_hcfg;
bool suspend;
#endif #endif
}; };
......
...@@ -215,6 +215,8 @@ static int snd_emu10k1_suspend(struct device *dev) ...@@ -215,6 +215,8 @@ static int snd_emu10k1_suspend(struct device *dev)
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
emu->suspend = 1;
snd_pcm_suspend_all(emu->pcm); snd_pcm_suspend_all(emu->pcm);
snd_pcm_suspend_all(emu->pcm_mic); snd_pcm_suspend_all(emu->pcm_mic);
snd_pcm_suspend_all(emu->pcm_efx); snd_pcm_suspend_all(emu->pcm_efx);
...@@ -260,6 +262,8 @@ static int snd_emu10k1_resume(struct device *dev) ...@@ -260,6 +262,8 @@ static int snd_emu10k1_resume(struct device *dev)
if (emu->card_capabilities->ca0151_chip) if (emu->card_capabilities->ca0151_chip)
snd_p16v_resume(emu); snd_p16v_resume(emu);
emu->suspend = 0;
snd_power_change_state(card, SNDRV_CTL_POWER_D0); snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0; return 0;
} }
......
...@@ -714,6 +714,8 @@ static int emu1010_firmware_thread(void *data) ...@@ -714,6 +714,8 @@ static int emu1010_firmware_thread(void *data)
msleep_interruptible(1000); msleep_interruptible(1000);
if (kthread_should_stop()) if (kthread_should_stop())
break; break;
if (emu->suspend)
continue;
snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &tmp); /* IRQ Status */ 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 */ 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) { if (reg & EMU_HANA_OPTION_DOCK_OFFLINE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment