From e3a82705a1a89cee78aeb1aa6266add2fa53acf2 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 24 May 2011 11:49:12 +0200 Subject: [PATCH] --- yaml --- r: 252103 b: refs/heads/master c: e2df82ffb8f61efdefba2857da09306182e9c599 h: refs/heads/master i: 252101: ca867a28b61c9a054e1032ee1ae3037dfe60ebbb 252099: 537504142d9b1a363a83487a96dc7213efcfe70b 252095: c225fb9131aea6abab8e3f51b4c87d3bb20e94b4 v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/patch_conexant.c | 33 ++++++++++++++++++---------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index ec15f06fa606..cc8b15a7ae17 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 313d2c065253a7549f5e7f43409f1da455329acd +refs/heads/master: e2df82ffb8f61efdefba2857da09306182e9c599 diff --git a/trunk/sound/pci/hda/patch_conexant.c b/trunk/sound/pci/hda/patch_conexant.c index e8dc736b2fc4..24fa31e46608 100644 --- a/trunk/sound/pci/hda/patch_conexant.c +++ b/trunk/sound/pci/hda/patch_conexant.c @@ -3434,7 +3434,9 @@ static void cx_auto_parse_output(struct hda_codec *codec) break; } } - if (spec->auto_mute && cfg->line_out_pins[0] && + if (spec->auto_mute && + cfg->line_out_pins[0] && + cfg->line_out_type != AUTO_PIN_SPEAKER_OUT && cfg->line_out_pins[0] != cfg->hp_pins[0] && cfg->line_out_pins[0] != cfg->speaker_pins[0]) { for (i = 0; i < cfg->line_outs; i++) { @@ -3482,25 +3484,32 @@ static void cx_auto_update_speakers(struct hda_codec *codec) { struct conexant_spec *spec = codec->spec; struct auto_pin_cfg *cfg = &spec->autocfg; - int on; + int on = 1; - if (!spec->auto_mute) - on = 0; - else - on = spec->hp_present | spec->line_present; + /* turn on HP EAPD when HP jacks are present */ + if (spec->auto_mute) + on = spec->hp_present; cx_auto_turn_eapd(codec, cfg->hp_outs, cfg->hp_pins, on); - do_automute(codec, cfg->speaker_outs, cfg->speaker_pins, !on); + /* mute speakers in auto-mode if HP or LO jacks are plugged */ + if (spec->auto_mute) + on = !(spec->hp_present || + (spec->detect_line && spec->line_present)); + do_automute(codec, cfg->speaker_outs, cfg->speaker_pins, on); /* toggle line-out mutes if needed, too */ /* if LO is a copy of either HP or Speaker, don't need to handle it */ if (cfg->line_out_pins[0] == cfg->hp_pins[0] || cfg->line_out_pins[0] == cfg->speaker_pins[0]) return; - if (!spec->automute_lines || !spec->auto_mute) - on = 0; - else - on = spec->hp_present; - do_automute(codec, cfg->line_outs, cfg->line_out_pins, !on); + if (spec->auto_mute) { + /* mute LO in auto-mode when HP jack is present */ + if (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT || + spec->automute_lines) + on = !spec->hp_present; + else + on = 1; + } + do_automute(codec, cfg->line_outs, cfg->line_out_pins, on); } static void cx_auto_hp_automute(struct hda_codec *codec)