From: Takashi Iwai Subject: Re: [PATCH] ALSA: emu10k1: handle dock disconnects Date: Sat, 11 Apr 2015 17:29:31 +0200 Message-ID: References: <20150411123444.GA15194@zerfleddert.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 84A06266158 for ; Sat, 11 Apr 2015 17:29:31 +0200 (CEST) In-Reply-To: <20150411123444.GA15194@zerfleddert.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Michael Gernoth Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Sat, 11 Apr 2015 14:34:44 +0200, Michael Gernoth wrote: > > 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 Applied, thanks. Takashi > --- > sound/pci/emu10k1/emu10k1_main.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c > index b4458a6..ee50c1d 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; > -- > 2.1.4 > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >