Commit 8974bd51 authored by Takashi Iwai's avatar Takashi Iwai

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/851697Reported-by: default avatarDavid Henningsson <david.henningsson@canonical.com>
Tested-By: default avatarJayne Han <jayne.han@canonical.com>
Cc: stable@kernel.org (3.0)
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 763437a9
...@@ -168,7 +168,7 @@ struct alc_spec { ...@@ -168,7 +168,7 @@ struct alc_spec {
unsigned int auto_mic_valid_imux:1; /* valid imux for auto-mic */ unsigned int auto_mic_valid_imux:1; /* valid imux for auto-mic */
unsigned int automute:1; /* HP automute enabled */ unsigned int automute:1; /* HP automute enabled */
unsigned int detect_line:1; /* Line-out detection enabled */ unsigned int detect_line:1; /* Line-out detection enabled */
unsigned int automute_lines:1; /* automute line-out as well */ unsigned int automute_lines:1; /* automute line-out as well; NOP when automute_hp_lo isn't set */
unsigned int automute_hp_lo:1; /* both HP and LO available */ unsigned int automute_hp_lo:1; /* both HP and LO available */
/* other flags */ /* other flags */
...@@ -551,7 +551,7 @@ static void update_speakers(struct hda_codec *codec) ...@@ -551,7 +551,7 @@ static void update_speakers(struct hda_codec *codec)
if (spec->autocfg.line_out_pins[0] == spec->autocfg.hp_pins[0] || if (spec->autocfg.line_out_pins[0] == spec->autocfg.hp_pins[0] ||
spec->autocfg.line_out_pins[0] == spec->autocfg.speaker_pins[0]) spec->autocfg.line_out_pins[0] == spec->autocfg.speaker_pins[0])
return; return;
if (!spec->automute_lines || !spec->automute) if (!spec->automute || (spec->automute_hp_lo && !spec->automute_lines))
on = 0; on = 0;
else else
on = spec->jack_present; on = spec->jack_present;
...@@ -803,7 +803,7 @@ static int alc_automute_mode_get(struct snd_kcontrol *kcontrol, ...@@ -803,7 +803,7 @@ static int alc_automute_mode_get(struct snd_kcontrol *kcontrol,
unsigned int val; unsigned int val;
if (!spec->automute) if (!spec->automute)
val = 0; val = 0;
else if (!spec->automute_lines) else if (!spec->automute_hp_lo || !spec->automute_lines)
val = 1; val = 1;
else else
val = 2; val = 2;
...@@ -824,7 +824,8 @@ static int alc_automute_mode_put(struct snd_kcontrol *kcontrol, ...@@ -824,7 +824,8 @@ static int alc_automute_mode_put(struct snd_kcontrol *kcontrol,
spec->automute = 0; spec->automute = 0;
break; break;
case 1: case 1:
if (spec->automute && !spec->automute_lines) if (spec->automute &&
(!spec->automute_hp_lo || !spec->automute_lines))
return 0; return 0;
spec->automute = 1; spec->automute = 1;
spec->automute_lines = 0; spec->automute_lines = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment