diff options
author | Gabriele Mazzotta <gabriele.mzt@gmail.com> | 2015-04-19 13:00:40 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-04-20 03:15:07 -0400 |
commit | 9476d369d7b39348945c297da5f2935904229813 (patch) | |
tree | e9bfd6650024d7786324a180c395d3c2270dbb0f /sound/pci | |
parent | bc26d4d06e337ade069f33d3f4377593b24e6e36 (diff) |
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 (033b0a7ca9c:
"ALSA: hda - Pop noises fix for XPS13 9333")
Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index b18b9c67b262..231d0e4b9a95 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -4176,17 +4176,15 @@ static void alc_fixup_disable_aamix(struct hda_codec *codec, | |||
4176 | } | 4176 | } |
4177 | } | 4177 | } |
4178 | 4178 | ||
4179 | static unsigned int alc_power_filter_xps13(struct hda_codec *codec, | 4179 | static void alc_shutup_dell_xps13(struct hda_codec *codec) |
4180 | hda_nid_t nid, | ||
4181 | unsigned int power_state) | ||
4182 | { | 4180 | { |
4183 | struct alc_spec *spec = codec->spec; | 4181 | struct alc_spec *spec = codec->spec; |
4182 | int hp_pin = spec->gen.autocfg.hp_pins[0]; | ||
4184 | 4183 | ||
4185 | /* Avoid pop noises when headphones are plugged in */ | 4184 | /* Prevent pop noises when headphones are plugged in */ |
4186 | if (spec->gen.hp_jack_present) | 4185 | snd_hda_codec_write(codec, hp_pin, 0, |
4187 | if (nid == codec->core.afg || nid == 0x02 || nid == 0x15) | 4186 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
4188 | return AC_PWRST_D0; | 4187 | msleep(20); |
4189 | return snd_hda_gen_path_power_filter(codec, nid, power_state); | ||
4190 | } | 4188 | } |
4191 | 4189 | ||
4192 | static void alc_fixup_dell_xps13(struct hda_codec *codec, | 4190 | 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 | struct hda_input_mux *imux = &spec->gen.input_mux; | 4195 | struct hda_input_mux *imux = &spec->gen.input_mux; |
4198 | int i; | 4196 | int i; |
4199 | 4197 | ||
4200 | spec->shutup = alc_no_shutup; | 4198 | spec->shutup = alc_shutup_dell_xps13; |
4201 | codec->power_filter = alc_power_filter_xps13; | ||
4202 | 4199 | ||
4203 | /* Make the internal mic the default input source. */ | 4200 | /* Make the internal mic the default input source. */ |
4204 | for (i = 0; i < imux->num_items; i++) { | 4201 | for (i = 0; i < imux->num_items; i++) { |