aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-04-27 04:43:22 -0400
committerTakashi Iwai <tiwai@suse.de>2015-04-27 04:48:37 -0400
commit3e1b0c4a9d563d7fc6e22dc92613cd3237bb5ce0 (patch)
tree7cfd41f1ac4009e5352f63e444bc8a41e80b0b5b /sound
parentb787f68c36d49bb1d9236f403813641efa74a031 (diff)
ALSA: hda - Fix click noise at start on Dell XPS13
Dell XPS13 produces a click noise at boot up, and Gabriele spotted out that it's triggered by the initial pin control of the mic (NID 0x19). This has to be set to Hi-Z Vref while the driver initializes to Vref 80% as a normal mic. This patch fixes the generic parser code not to override the target vref if it has been already set by the driver, and adds a proper initialization of the target vref for this pin in the Realtek driver side. Reported-and-tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_generic.c3
-rw-r--r--sound/pci/hda/patch_realtek.c16
2 files changed, 14 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 3d2597b7037b..788f969b1a68 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -3259,7 +3259,8 @@ static int create_input_ctls(struct hda_codec *codec)
3259 val = PIN_IN; 3259 val = PIN_IN;
3260 if (cfg->inputs[i].type == AUTO_PIN_MIC) 3260 if (cfg->inputs[i].type == AUTO_PIN_MIC)
3261 val |= snd_hda_get_default_vref(codec, pin); 3261 val |= snd_hda_get_default_vref(codec, pin);
3262 if (pin != spec->hp_mic_pin) 3262 if (pin != spec->hp_mic_pin &&
3263 !snd_hda_codec_get_pin_target(codec, pin))
3263 set_pin_target(codec, pin, val, false); 3264 set_pin_target(codec, pin, val, false);
3264 3265
3265 if (mixer) { 3266 if (mixer) {
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 06199e4e930f..e2afd53cc14c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4190,11 +4190,18 @@ static void alc_shutup_dell_xps13(struct hda_codec *codec)
4190static void alc_fixup_dell_xps13(struct hda_codec *codec, 4190static void alc_fixup_dell_xps13(struct hda_codec *codec,
4191 const struct hda_fixup *fix, int action) 4191 const struct hda_fixup *fix, int action)
4192{ 4192{
4193 if (action == HDA_FIXUP_ACT_PROBE) { 4193 struct alc_spec *spec = codec->spec;
4194 struct alc_spec *spec = codec->spec; 4194 struct hda_input_mux *imux = &spec->gen.input_mux;
4195 struct hda_input_mux *imux = &spec->gen.input_mux; 4195 int i;
4196 int i;
4197 4196
4197 switch (action) {
4198 case HDA_FIXUP_ACT_PRE_PROBE:
4199 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
4200 * it causes a click noise at start up
4201 */
4202 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
4203 break;
4204 case HDA_FIXUP_ACT_PROBE:
4198 spec->shutup = alc_shutup_dell_xps13; 4205 spec->shutup = alc_shutup_dell_xps13;
4199 4206
4200 /* Make the internal mic the default input source. */ 4207 /* Make the internal mic the default input source. */
@@ -4204,6 +4211,7 @@ static void alc_fixup_dell_xps13(struct hda_codec *codec,
4204 break; 4211 break;
4205 } 4212 }
4206 } 4213 }
4214 break;
4207 } 4215 }
4208} 4216}
4209 4217