summaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-11-02 16:38:21 +0100
committerTakashi Iwai <tiwai@suse.de>2016-11-15 08:01:14 +0100
commite8c44abeab76cc3b1d79242612b9a2d82ab11b6b (patch)
tree6621a43cee03b6ce0e36da7dff8961416b7fed61 /sound/pci/emu10k1
parent43e575fabbaa1cc9e25dd0bb31eb6657ac7092ec (diff)
downloadlinux-e8c44abeab76cc3b1d79242612b9a2d82ab11b6b.tar.bz2
ALSA: emu10k1: Fix emu1010 dock attach check
The emu1010_firmware_thread() checks the previous dock status, but a wrong register is recorded as the last status when the dock is plugged in. Usually this isn't a big issue since this value gets overwritten by the next loop after one second. But when a dock is unplugged immediately after plugging, it means essentially missing undock handling. This patch addresses it by remembering the correct register value. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/emu10k1')
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 891453451543..c1b603a8922c 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -762,19 +762,19 @@ static int emu1010_firmware_thread(void *data)
}
snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0);
- snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &reg);
+ snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &tmp);
dev_info(emu->card->dev,
"emu1010: EMU_HANA+DOCK_IRQ_STATUS = 0x%x\n",
- reg);
+ tmp);
/* ID, should read & 0x7f = 0x55 when FPGA programmed. */
- snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
+ snd_emu1010_fpga_read(emu, EMU_HANA_ID, &tmp);
dev_info(emu->card->dev,
- "emu1010: EMU_HANA+DOCK_ID = 0x%x\n", reg);
- if ((reg & 0x1f) != 0x15) {
+ "emu1010: EMU_HANA+DOCK_ID = 0x%x\n", tmp);
+ if ((tmp & 0x1f) != 0x15) {
/* FPGA failed to be programmed */
dev_info(emu->card->dev,
"emu1010: Loading Audio Dock Firmware file failed, reg = 0x%x\n",
- reg);
+ tmp);
continue;
}
dev_info(emu->card->dev,