Commit fa863b2d authored by Michael Gernoth's avatar Michael Gernoth Committed by Takashi Iwai

ALSA: emu10k1: handle dock disconnects

When the dock on an E-mu 1010 card is disconnected, all outputs get
muted by the hardware. Add logic to detect a disconnect and unmute.
Signed-off-by: default avatarMichael Gernoth <michael@gernoth.net>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 3e21a19d
......@@ -707,6 +707,7 @@ static int emu1010_firmware_thread(void *data)
{
struct snd_emu10k1 *emu = data;
u32 tmp, tmp2, reg;
u32 last_reg = 0;
int err;
for (;;) {
......@@ -782,7 +783,15 @@ static int emu1010_firmware_thread(void *data)
msleep(10);
/* Unmute all. Default is muted after a firmware load */
snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
} else if (!reg && last_reg) {
/* Audio Dock removed */
dev_info(emu->card->dev,
"emu1010: Audio Dock detached\n");
/* Unmute all */
snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
}
last_reg = reg;
}
dev_info(emu->card->dev, "emu1010: firmware thread stopping\n");
return 0;
......
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