Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dd87da1c5d3fd1d973d52e468f76fcc72ad69bd5
Commit:     dd87da1c5d3fd1d973d52e468f76fcc72ad69bd5
Parent:     fe8970b47ae191d932f5bac9e225e74db6e188a3
Author:     Tobin Davis <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 26 16:07:42 2007 +0100
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Tue Mar 6 10:40:33 2007 +0100

    [ALSA] hda-codec - Fix logic error in headphone mute for Conexant codecs
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 sound/pci/hda/patch_conexant.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 23a1c75..46e93c6 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -629,10 +629,12 @@ static int cxt5045_hp_master_vol_put(struct snd_kcontrol 
*kcontrol,
 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 int cxt5047_hp_master_vol_put(struct snd_kcontrol 
*kcontrol,
 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 */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to