diff options
author | Tobin Davis <tdavis@dsl-only.net> | 2007-02-26 10:07:42 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-03-06 04:40:33 -0500 |
commit | dd87da1c5d3fd1d973d52e468f76fcc72ad69bd5 (patch) | |
tree | 15d22b9f597abbcae1838caa269eb9b7ec55d129 /sound/pci | |
parent | fe8970b47ae191d932f5bac9e225e74db6e188a3 (diff) |
[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 <tdavis@dsl-only.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | 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 23a1c75085b5..46e93c6b9a42 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, | |||
629 | static void cxt5045_hp_automute(struct hda_codec *codec) | 629 | static void cxt5045_hp_automute(struct hda_codec *codec) |
630 | { | 630 | { |
631 | struct conexant_spec *spec = codec->spec; | 631 | struct conexant_spec *spec = codec->spec; |
632 | unsigned int bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0; | 632 | unsigned int bits; |
633 | 633 | ||
634 | spec->hp_present = snd_hda_codec_read(codec, 0x11, 0, | 634 | spec->hp_present = snd_hda_codec_read(codec, 0x11, 0, |
635 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | 635 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; |
636 | |||
637 | bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0; | ||
636 | snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80, bits); | 638 | snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0, 0x80, bits); |
637 | snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80, bits); | 639 | snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0, 0x80, bits); |
638 | } | 640 | } |
@@ -979,10 +981,12 @@ static int cxt5047_hp_master_vol_put(struct snd_kcontrol *kcontrol, | |||
979 | static void cxt5047_hp_automute(struct hda_codec *codec) | 981 | static void cxt5047_hp_automute(struct hda_codec *codec) |
980 | { | 982 | { |
981 | struct conexant_spec *spec = codec->spec; | 983 | struct conexant_spec *spec = codec->spec; |
982 | unsigned int bits = spec->hp_present || !spec->cur_eapd ? 0x80 : 0; | 984 | unsigned int bits; |
983 | 985 | ||
984 | spec->hp_present = snd_hda_codec_read(codec, 0x13, 0, | 986 | spec->hp_present = snd_hda_codec_read(codec, 0x13, 0, |
985 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | 987 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; |
988 | |||
989 | bits = (spec->hp_present || !spec->cur_eapd) ? 0x80 : 0; | ||
986 | snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80, bits); | 990 | snd_hda_codec_amp_update(codec, 0x1d, 0, HDA_OUTPUT, 0, 0x80, bits); |
987 | snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80, bits); | 991 | snd_hda_codec_amp_update(codec, 0x1d, 1, HDA_OUTPUT, 0, 0x80, bits); |
988 | /* Mute/Unmute PCM 2 for good measure - some systems need this */ | 992 | /* Mute/Unmute PCM 2 for good measure - some systems need this */ |