Commit 6162552b authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Fix invalid D3 of headphone DAC on VT202x codecs

We've got a bug report about the silent output from the headphone on a
mobo with VT2021, and spotted out that this was because of the wrong
D3 state on the DAC for the headphone output.  The bug is triggered by
the incomplete check for this DAC in set_widgets_power_state_vt1718S().
It checks only the connectivity of the primary output (0x27) but
doesn't consider the path from the headphone pin (0x28).

Now this patch fixes the problem by checking both pins for DAC 0x0b.

Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent c1b623d9
...@@ -3226,7 +3226,7 @@ static void set_widgets_power_state_vt1718S(struct hda_codec *codec) ...@@ -3226,7 +3226,7 @@ static void set_widgets_power_state_vt1718S(struct hda_codec *codec)
{ {
struct via_spec *spec = codec->spec; struct via_spec *spec = codec->spec;
int imux_is_smixer; int imux_is_smixer;
unsigned int parm; unsigned int parm, parm2;
/* MUX6 (1eh) = stereo mixer */ /* MUX6 (1eh) = stereo mixer */
imux_is_smixer = imux_is_smixer =
snd_hda_codec_read(codec, 0x1e, 0, AC_VERB_GET_CONNECT_SEL, 0x00) == 5; snd_hda_codec_read(codec, 0x1e, 0, AC_VERB_GET_CONNECT_SEL, 0x00) == 5;
...@@ -3249,7 +3249,7 @@ static void set_widgets_power_state_vt1718S(struct hda_codec *codec) ...@@ -3249,7 +3249,7 @@ static void set_widgets_power_state_vt1718S(struct hda_codec *codec)
parm = AC_PWRST_D3; parm = AC_PWRST_D3;
set_pin_power_state(codec, 0x27, &parm); set_pin_power_state(codec, 0x27, &parm);
update_power_state(codec, 0x1a, parm); update_power_state(codec, 0x1a, parm);
update_power_state(codec, 0xb, parm); parm2 = parm; /* for pin 0x0b */
/* PW2 (26h), AOW2 (ah) */ /* PW2 (26h), AOW2 (ah) */
parm = AC_PWRST_D3; parm = AC_PWRST_D3;
...@@ -3264,6 +3264,9 @@ static void set_widgets_power_state_vt1718S(struct hda_codec *codec) ...@@ -3264,6 +3264,9 @@ static void set_widgets_power_state_vt1718S(struct hda_codec *codec)
if (!spec->hp_independent_mode) /* check for redirected HP */ if (!spec->hp_independent_mode) /* check for redirected HP */
set_pin_power_state(codec, 0x28, &parm); set_pin_power_state(codec, 0x28, &parm);
update_power_state(codec, 0x8, parm); update_power_state(codec, 0x8, parm);
if (!spec->hp_independent_mode && parm2 != AC_PWRST_D3)
parm = parm2;
update_power_state(codec, 0xb, parm);
/* MW9 (21h), Mw2 (1ah), AOW0 (8h) */ /* MW9 (21h), Mw2 (1ah), AOW0 (8h) */
update_power_state(codec, 0x21, imux_is_smixer ? AC_PWRST_D0 : parm); update_power_state(codec, 0x21, imux_is_smixer ? AC_PWRST_D0 : parm);
......
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