summaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emu10k1_main.c
diff options
context:
space:
mode:
authorMichael Gernoth <michael@gernoth.net>2015-04-11 14:34:44 +0200
committerTakashi Iwai <tiwai@suse.de>2015-04-11 17:29:19 +0200
commitfa863b2d5e62e2ea7d86ccfa9a888bd28dd79ebe (patch)
treed5e0b32cd80f676e4e995a44173c52a76239cfd1 /sound/pci/emu10k1/emu10k1_main.c
parent3e21a19d1d6775591415efd5617375ba42c41bbd (diff)
downloadop-kernel-dev-fa863b2d5e62e2ea7d86ccfa9a888bd28dd79ebe.zip
op-kernel-dev-fa863b2d5e62e2ea7d86ccfa9a888bd28dd79ebe.tar.gz
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: Michael Gernoth <michael@gernoth.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/emu10k1/emu10k1_main.c')
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 48872990..54079f5 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -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;
OpenPOWER on IntegriCloud