All of lore.kernel.org
 help / color / mirror / Atom feed
* Fix logic error in headphone mute for Conexant codecs
@ 2007-02-23 21:22 Tobin Davis
  2007-02-26 15:08 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Tobin Davis @ 2007-02-23 21:22 UTC (permalink / raw)
  To: alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 326 bytes --]

This patch fixes a logic error introduced in the previous patch.
Without it, speaker automute mutes the speakers when headphones are
removed and unmutes when headphones are plugged in.

This was reported by Gregorio Guidi after getting the earlier patch off
this mailing list.

Signed off by Tobin Davis <tdavis@dsl-only.net>

[-- Attachment #1.2: Type: text/html, Size: 676 bytes --]

[-- Attachment #2: conexant-automute-fix.patch --]
[-- Type: text/x-patch, Size: 1250 bytes --]

--- patch_conexant.c.orig	2007-02-19 18:59:00.000000000 -0800
+++ patch_conexant.c	2007-02-23 10:57:32.000000000 -0800
@@ -629,10 +629,12 @@
 static void cxt5045_hp_automute(struct hda_codec *codec)
 {
 	struct conexant_spec *spec = codec->spec;
-	unsigned int bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0;
+	unsigned int bits;
 
 	spec->hp_present = snd_hda_codec_read(codec, 0x11, 0,
 				     AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
+
+	bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0;
 	snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80, bits);
 	snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80, bits);
 }
@@ -979,10 +981,12 @@
 static void cxt5047_hp_automute(struct hda_codec *codec)
 {
 	struct conexant_spec *spec = codec->spec;
-	unsigned int bits = spec->hp_present || !spec->cur_eapd ? 0x80 : 0;
+	unsigned int bits;
 
 	spec->hp_present = snd_hda_codec_read(codec, 0x13, 0,
 				     AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
+
+	bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0;
 	snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80, bits);
 	snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80, bits);
 	/* Mute/Unmute PCM 2 for good measure - some systems need this */

[-- Attachment #3: Type: text/plain, Size: 345 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 161 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

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

* Re: Fix logic error in headphone mute for Conexant codecs
  2007-02-23 21:22 Fix logic error in headphone mute for Conexant codecs Tobin Davis
@ 2007-02-26 15:08 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2007-02-26 15:08 UTC (permalink / raw)
  To: Tobin Davis; +Cc: alsa-devel

At Fri, 23 Feb 2007 13:22:31 -0800,
Tobin Davis wrote:
> 
> This patch fixes a logic error introduced in the previous patch.  Without it, speaker
> automute mutes the speakers when headphones are removed and unmutes when headphones
> are plugged in.
> 
> This was reported by Gregorio Guidi after getting the earlier patch off this mailing
> list.
>                                                                                       
> Signed off by Tobin Davis <tdavis@dsl-only.net>                                       

Thanks, applied to HG tree.  But unfortunately slipped from 1.0.14rc3...


Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

end of thread, other threads:[~2007-02-26 15:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-23 21:22 Fix logic error in headphone mute for Conexant codecs Tobin Davis
2007-02-26 15:08 ` 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.