diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-09-19 05:31:34 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-09-19 05:31:34 -0400 |
commit | 8974bd51a77824d91010176f9a5da28513c2e1f5 (patch) | |
tree | b6da41d68881ae172a8340d6b21849c1f116c8b0 | |
parent | 763437a9e7737535b2fc72175ad4974048769be6 (diff) |
ALSA: hda/realtek - Fix auto-mute with HP+LO configuration
When the system has only the headphone and the line-out jacks without
speakers, the current auto-mute code doesn't work. It's because the
spec->automute_lines flag is wrongly referred in update_speakers().
This flag must be meaningless when spec->automute_hp_lo isn't set, thus
they should be always coupled.
The patch fixes the problem and add a comment to indicate the
relationship briefly.
BugLink: http://bugs.launchpad.net/bugs/851697
Reported-by: David Henningsson <david.henningsson@canonical.com>
Tested-By: Jayne Han <jayne.han@canonical.com>
Cc: stable@kernel.org (3.0)
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 7cabd7317163..0503c999e7d3 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -168,7 +168,7 @@ struct alc_spec { | |||
168 | unsigned int auto_mic_valid_imux:1; /* valid imux for auto-mic */ | 168 | unsigned int auto_mic_valid_imux:1; /* valid imux for auto-mic */ |
169 | unsigned int automute:1; /* HP automute enabled */ | 169 | unsigned int automute:1; /* HP automute enabled */ |
170 | unsigned int detect_line:1; /* Line-out detection enabled */ | 170 | unsigned int detect_line:1; /* Line-out detection enabled */ |
171 | unsigned int automute_lines:1; /* automute line-out as well */ | 171 | unsigned int automute_lines:1; /* automute line-out as well; NOP when automute_hp_lo isn't set */ |
172 | unsigned int automute_hp_lo:1; /* both HP and LO available */ | 172 | unsigned int automute_hp_lo:1; /* both HP and LO available */ |
173 | 173 | ||
174 | /* other flags */ | 174 | /* other flags */ |
@@ -551,7 +551,7 @@ static void update_speakers(struct hda_codec *codec) | |||
551 | if (spec->autocfg.line_out_pins[0] == spec->autocfg.hp_pins[0] || | 551 | if (spec->autocfg.line_out_pins[0] == spec->autocfg.hp_pins[0] || |
552 | spec->autocfg.line_out_pins[0] == spec->autocfg.speaker_pins[0]) | 552 | spec->autocfg.line_out_pins[0] == spec->autocfg.speaker_pins[0]) |
553 | return; | 553 | return; |
554 | if (!spec->automute_lines || !spec->automute) | 554 | if (!spec->automute || (spec->automute_hp_lo && !spec->automute_lines)) |
555 | on = 0; | 555 | on = 0; |
556 | else | 556 | else |
557 | on = spec->jack_present; | 557 | on = spec->jack_present; |
@@ -803,7 +803,7 @@ static int alc_automute_mode_get(struct snd_kcontrol *kcontrol, | |||
803 | unsigned int val; | 803 | unsigned int val; |
804 | if (!spec->automute) | 804 | if (!spec->automute) |
805 | val = 0; | 805 | val = 0; |
806 | else if (!spec->automute_lines) | 806 | else if (!spec->automute_hp_lo || !spec->automute_lines) |
807 | val = 1; | 807 | val = 1; |
808 | else | 808 | else |
809 | val = 2; | 809 | val = 2; |
@@ -824,7 +824,8 @@ static int alc_automute_mode_put(struct snd_kcontrol *kcontrol, | |||
824 | spec->automute = 0; | 824 | spec->automute = 0; |
825 | break; | 825 | break; |
826 | case 1: | 826 | case 1: |
827 | if (spec->automute && !spec->automute_lines) | 827 | if (spec->automute && |
828 | (!spec->automute_hp_lo || !spec->automute_lines)) | ||
828 | return 0; | 829 | return 0; |
829 | spec->automute = 1; | 830 | spec->automute = 1; |
830 | spec->automute_lines = 0; | 831 | spec->automute_lines = 0; |