Commit 6e969d91 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Set line-out pin-ctls properly when indep-HP mode changes

When Independent-HP mode is changed for VIA, the driver needs to
re-issue the auto-mute check so that the line-out pins are set properly
without influence of HP pin state.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 21ce0b65
...@@ -615,6 +615,7 @@ static void via_auto_init_speaker_out(struct hda_codec *codec) ...@@ -615,6 +615,7 @@ static void via_auto_init_speaker_out(struct hda_codec *codec)
} }
static bool is_smart51_pins(struct hda_codec *codec, hda_nid_t pin); static bool is_smart51_pins(struct hda_codec *codec, hda_nid_t pin);
static void via_hp_automute(struct hda_codec *codec);
static void via_auto_init_analog_input(struct hda_codec *codec) static void via_auto_init_analog_input(struct hda_codec *codec)
{ {
...@@ -801,6 +802,7 @@ static int via_independent_hp_put(struct snd_kcontrol *kcontrol, ...@@ -801,6 +802,7 @@ static int via_independent_hp_put(struct snd_kcontrol *kcontrol,
/* update jack power state */ /* update jack power state */
set_widgets_power_state(codec); set_widgets_power_state(codec);
via_hp_automute(codec);
return 1; return 1;
} }
...@@ -1532,19 +1534,18 @@ static void via_line_automute(struct hda_codec *codec, int present) ...@@ -1532,19 +1534,18 @@ static void via_line_automute(struct hda_codec *codec, int present)
static void via_hp_automute(struct hda_codec *codec) static void via_hp_automute(struct hda_codec *codec)
{ {
int present = 0; int present = 0;
int nums;
struct via_spec *spec = codec->spec; struct via_spec *spec = codec->spec;
if (!spec->hp_independent_mode && spec->autocfg.hp_pins[0]) { if (!spec->hp_independent_mode && spec->autocfg.hp_pins[0])
int nums;
present = snd_hda_jack_detect(codec, spec->autocfg.hp_pins[0]); present = snd_hda_jack_detect(codec, spec->autocfg.hp_pins[0]);
if (spec->smart51_enabled) if (spec->smart51_enabled)
nums = spec->autocfg.line_outs + spec->smart51_nums; nums = spec->autocfg.line_outs + spec->smart51_nums;
else else
nums = spec->autocfg.line_outs; nums = spec->autocfg.line_outs;
toggle_output_mutes(codec, nums, toggle_output_mutes(codec, nums, spec->autocfg.line_out_pins, present);
spec->autocfg.line_out_pins,
present);
}
via_line_automute(codec, present); via_line_automute(codec, present);
} }
......
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