All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: emu10k1: handle dock disconnects
@ 2015-04-11 12:34 Michael Gernoth
  2015-04-11 15:29 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Gernoth @ 2015-04-11 12:34 UTC (permalink / raw)
  To: alsa-devel

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>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: emu10k1: handle dock disconnects
  2015-04-11 12:34 [PATCH] ALSA: emu10k1: handle dock disconnects Michael Gernoth
@ 2015-04-11 15:29 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2015-04-11 15:29 UTC (permalink / raw)
  To: Michael Gernoth; +Cc: alsa-devel

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 <michael@gernoth.net>

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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-11 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-11 12:34 [PATCH] ALSA: emu10k1: handle dock disconnects Michael Gernoth
2015-04-11 15:29 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.