summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-07-11 11:28:13 +0200
committerTakashi Iwai <tiwai@suse.de>2011-07-11 11:28:13 +0200
commit6e969d9155a4ee7bce800dfbee02099105ca5b97 (patch)
tree9a6ca0b2c73295cfd990350a38c665bd4f365e0a
parent21ce0b65272b85f122455818b0c69740945b451a (diff)
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: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_via.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index be2e57b4450..27de53fb331 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -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 void via_hp_automute(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,
/* update jack power state */
set_widgets_power_state(codec);
+ via_hp_automute(codec);
return 1;
}
@@ -1532,19 +1534,18 @@ static void via_line_automute(struct hda_codec *codec, int present)
static void via_hp_automute(struct hda_codec *codec)
{
int present = 0;
+ int nums;
struct via_spec *spec = codec->spec;
- if (!spec->hp_independent_mode && spec->autocfg.hp_pins[0]) {
- int nums;
+ if (!spec->hp_independent_mode && spec->autocfg.hp_pins[0])
present = snd_hda_jack_detect(codec, spec->autocfg.hp_pins[0]);
- if (spec->smart51_enabled)
- nums = spec->autocfg.line_outs + spec->smart51_nums;
- else
- nums = spec->autocfg.line_outs;
- toggle_output_mutes(codec, nums,
- spec->autocfg.line_out_pins,
- present);
- }
+
+ if (spec->smart51_enabled)
+ nums = spec->autocfg.line_outs + spec->smart51_nums;
+ else
+ nums = spec->autocfg.line_outs;
+ toggle_output_mutes(codec, nums, spec->autocfg.line_out_pins, present);
+
via_line_automute(codec, present);
}