ALSA: hda - Apply click noise workaround for Thinkpads generically
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Dec 2015 22:30:43 +0000 (23:30 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 15 Dec 2015 14:06:14 +0000 (15:06 +0100)
It seems that a workaround for Thinkpad T440s crackling noise can be
applied generically to all Thinkpad models: namely, disabling the
default alc269 shutup callback.  This patch moves it to the existing
alc_fixup_tpt440_dock() while also replacing the rest code with
another existing alc_fixup_disable_aamix().  It resulted in a good
code reduction.

Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=958439
Reported-and-tested-by: Benjamin Poirier <bpoirier@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c

index b745a721c36307a1dd265365a333158872ba781d..531065eaac1be73dc888d33b406ef41026d1c096 100644 (file)
@@ -4198,24 +4198,13 @@ static void alc_fixup_tpt440_dock(struct hda_codec *codec,
        struct alc_spec *spec = codec->spec;
 
        if (action == HDA_FIXUP_ACT_PRE_PROBE) {
+               spec->shutup = alc_no_shutup; /* reduce click noise */
                spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
                codec->power_save_node = 0; /* avoid click noises */
                snd_hda_apply_pincfgs(codec, pincfgs);
        }
 }
 
-/* additional fixup for Thinkpad T440s noise problem */
-static void alc_fixup_tpt440(struct hda_codec *codec,
-                                 const struct hda_fixup *fix, int action)
-{
-       struct alc_spec *spec = codec->spec;
-
-       if (action == HDA_FIXUP_ACT_PRE_PROBE) {
-               spec->shutup = alc_no_shutup; /* reduce click noise */
-               spec->gen.mixer_nid = 0; /* reduce background noise */
-       }
-}
-
 static void alc_shutup_dell_xps13(struct hda_codec *codec)
 {
        struct alc_spec *spec = codec->spec;
@@ -5067,7 +5056,7 @@ static const struct hda_fixup alc269_fixups[] = {
        },
        [ALC292_FIXUP_TPT440] = {
                .type = HDA_FIXUP_FUNC,
-               .v.func = alc_fixup_tpt440,
+               .v.func = alc_fixup_disable_aamix,
                .chained = true,
                .chain_id = ALC292_FIXUP_TPT440_DOCK,
        },