Skip to content

Commit

Permalink
ALSA: emu10k1: handle dock disconnects
Browse files Browse the repository at this point in the history
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: Michael Gernoth <michael@gernoth.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Michael Gernoth authored and Takashi Iwai committed Apr 11, 2015
1 parent 3e21a19 commit fa863b2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sound/pci/emu10k1/emu10k1_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 (;;) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fa863b2

Please sign in to comment.