ALSA: hda - Fix speaker auto-mute in Cxt auto-parser
Fix some logic failures in auto-mute handling in Conexant auto-parser. Also, modify codes to be a bit more understandable. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
313d2c0652
commit
e2df82ffb8
@ -3434,7 +3434,9 @@ static void cx_auto_parse_output(struct hda_codec *codec)
|
|||||||
break;
|
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->hp_pins[0] &&
|
||||||
cfg->line_out_pins[0] != cfg->speaker_pins[0]) {
|
cfg->line_out_pins[0] != cfg->speaker_pins[0]) {
|
||||||
for (i = 0; i < cfg->line_outs; i++) {
|
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 conexant_spec *spec = codec->spec;
|
||||||
struct auto_pin_cfg *cfg = &spec->autocfg;
|
struct auto_pin_cfg *cfg = &spec->autocfg;
|
||||||
int on;
|
int on = 1;
|
||||||
|
|
||||||
if (!spec->auto_mute)
|
/* turn on HP EAPD when HP jacks are present */
|
||||||
on = 0;
|
if (spec->auto_mute)
|
||||||
else
|
on = spec->hp_present;
|
||||||
on = spec->hp_present | spec->line_present;
|
|
||||||
cx_auto_turn_eapd(codec, cfg->hp_outs, cfg->hp_pins, on);
|
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 */
|
/* toggle line-out mutes if needed, too */
|
||||||
/* if LO is a copy of either HP or Speaker, don't need to handle it */
|
/* 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] ||
|
if (cfg->line_out_pins[0] == cfg->hp_pins[0] ||
|
||||||
cfg->line_out_pins[0] == cfg->speaker_pins[0])
|
cfg->line_out_pins[0] == cfg->speaker_pins[0])
|
||||||
return;
|
return;
|
||||||
if (!spec->automute_lines || !spec->auto_mute)
|
if (spec->auto_mute) {
|
||||||
on = 0;
|
/* mute LO in auto-mode when HP jack is present */
|
||||||
else
|
if (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT ||
|
||||||
on = spec->hp_present;
|
spec->automute_lines)
|
||||||
do_automute(codec, cfg->line_outs, cfg->line_out_pins, !on);
|
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)
|
static void cx_auto_hp_automute(struct hda_codec *codec)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user