Commit 9476d369 authored by Gabriele Mazzotta's avatar Gabriele Mazzotta Committed by Takashi Iwai

ALSA: hda - Mute headphone pin on suspend on XPS13 9333

Muting the headphone output pin right before the codec suspension
prevents pop noises when headphones are plugged in (except for a
barely audible click noise).
This solution allows to truly save some power when headphones are
plugged in unlike the previous solution (033b0a7c:
"ALSA: hda - Pop noises fix for XPS13 9333")
Signed-off-by: default avatarGabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent bc26d4d0
...@@ -4176,17 +4176,15 @@ static void alc_fixup_disable_aamix(struct hda_codec *codec, ...@@ -4176,17 +4176,15 @@ static void alc_fixup_disable_aamix(struct hda_codec *codec,
} }
} }
static unsigned int alc_power_filter_xps13(struct hda_codec *codec, static void alc_shutup_dell_xps13(struct hda_codec *codec)
hda_nid_t nid,
unsigned int power_state)
{ {
struct alc_spec *spec = codec->spec; struct alc_spec *spec = codec->spec;
int hp_pin = spec->gen.autocfg.hp_pins[0];
/* Avoid pop noises when headphones are plugged in */ /* Prevent pop noises when headphones are plugged in */
if (spec->gen.hp_jack_present) snd_hda_codec_write(codec, hp_pin, 0,
if (nid == codec->core.afg || nid == 0x02 || nid == 0x15) AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
return AC_PWRST_D0; msleep(20);
return snd_hda_gen_path_power_filter(codec, nid, power_state);
} }
static void alc_fixup_dell_xps13(struct hda_codec *codec, static void alc_fixup_dell_xps13(struct hda_codec *codec,
...@@ -4197,8 +4195,7 @@ static void alc_fixup_dell_xps13(struct hda_codec *codec, ...@@ -4197,8 +4195,7 @@ static void alc_fixup_dell_xps13(struct hda_codec *codec,
struct hda_input_mux *imux = &spec->gen.input_mux; struct hda_input_mux *imux = &spec->gen.input_mux;
int i; int i;
spec->shutup = alc_no_shutup; spec->shutup = alc_shutup_dell_xps13;
codec->power_filter = alc_power_filter_xps13;
/* Make the internal mic the default input source. */ /* Make the internal mic the default input source. */
for (i = 0; i < imux->num_items; i++) { for (i = 0; i < imux->num_items; i++) {
......
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