Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8127166imu; Tue, 4 Dec 2018 03:28:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/XWfu09e/6mtOqia3ipFQJm6dYVuH66pEbtdm+hBJt6/Al1eP23VmJM8JwPR2mhJWcoz1yz X-Received: by 2002:a62:e044:: with SMTP id f65mr19518065pfh.208.1543922922039; Tue, 04 Dec 2018 03:28:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543922922; cv=none; d=google.com; s=arc-20160816; b=N0jXK2QoywE5d7J+oSKMvBQoK35b6G3QgeYj1suFblVa/vt1FJyQ5m960VVy9mioOw 93cfgSTELUP1jyVgT3/8MWEckYlAWW7qH7kMfPweyD9OlbEBqPd2E0BUZpRCOE84/HWW mEvAi6ZU4PVuOiVLTl1EC1JH9i2JP+xG4rbM1UJ9u4K/+p2bBaSNuCyAuzKUj4ibNBAu Babmm5w4GCZf/9VZMAJANnrY/iIQqQngeRc861swwciJejli8ObZqLv5OyoBc2kHBubA jarW5Grlyyn9HKixvczm4GnitWJSKaayAOgEWjoGZY0eEiQ8TB+BqVZcDb6TaxVrER5L ma0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kNFRe21wR65c52582OsAb4FVWo0d2+VixMHQ+p31Lto=; b=nTGVOSw9hxOXj0138OG9LvH301kh0/v3CqkasxPv4p6AGSBTEn0P4wG4EYRTEl5TRS Y9TQMTQD06znj44Pbyc0bfLE6remtfS7mx3Wvzc8xhbwYawSfuAjfS52wN850imkySb7 19CvRKAEERCbjf+TtCfO2XiLWUp5i+tIjYJEvYDvojmEZ3EoikVsr8T1Kuhb2ap0hSpX qIGYki5xLF8tU0F4NojWrKYHtRCQCuWjDciKwukA94D6AfKnC0IPhVs6eBUFpkwzmcxJ QN+InWKK0PJ6yKU8ACCZj5xxL79DsPs6r004auFb0RTlyZmGFI3D2rx1fhuxNyP7VACM KSbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eqjxS+Jy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o7si15240254pgg.118.2018.12.04.03.28.27; Tue, 04 Dec 2018 03:28:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eqjxS+Jy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727225AbeLDL1x (ORCPT + 99 others); Tue, 4 Dec 2018 06:27:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:43618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726478AbeLDK7B (ORCPT ); Tue, 4 Dec 2018 05:59:01 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E2AE820878; Tue, 4 Dec 2018 10:58:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543921140; bh=RMqPb0/uLSaMd3RqDPGy7ypNKVCnuNFx2P/MfFax3fA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eqjxS+Jy9NnaPvbvgMozHBfGAxVKBN1X7zSp3x8wig+mdeKTodiU/2xIz5779tPFO 500VyrmlysMIna5p/noGRPkoVCs5eMVmqH9/wDK8XKgYwcHab2DWnlbz+g50NJrj1x vR3Uk/1/1aUKGb7I7dTZN8f81UvH26SkpIL3jVdk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kailang Yang , Hui Wang , Takashi Iwai Subject: [PATCH 4.19 096/139] ALSA: hda/realtek - fix the pop noise on headphone for lenovo laptops Date: Tue, 4 Dec 2018 11:49:37 +0100 Message-Id: <20181204103654.341269777@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hui Wang commit c4cfcf6f4297c9256b53790bacbbbd6901fef468 upstream. We have several Lenovo laptops with the codec alc285, when playing sound via headphone, we can hear click/pop noise in the headphone, if we let the headphone share the DAC of NID 0x2 with the speaker, the noise disappears. The Lenovo laptops here include P52, P72, X1 yoda2 and X1 carbon. I have tried to set preferred_dacs and override_conn, but neither of them worked. Thanks for Kailang, he told me to invalidate the NID 0x3 through override_wcaps. BugLink: https://bugs.launchpad.net/bugs/1805079 Cc: Signed-off-by: Kailang Yang Signed-off-by: Hui Wang Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/patch_realtek.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -5361,6 +5361,16 @@ static void alc274_fixup_bind_dacs(struc spec->gen.preferred_dacs = preferred_pairs; } +/* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ +static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + if (action != HDA_FIXUP_ACT_PRE_PROBE) + return; + + snd_hda_override_wcaps(codec, 0x03, 0); +} + /* for hda_fixup_thinkpad_acpi() */ #include "thinkpad_helper.c" @@ -5498,6 +5508,7 @@ enum { ALC255_FIXUP_DELL_HEADSET_MIC, ALC295_FIXUP_HP_X360, ALC221_FIXUP_HP_HEADSET_MIC, + ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, }; static const struct hda_fixup alc269_fixups[] = { @@ -6365,6 +6376,10 @@ static const struct hda_fixup alc269_fix .chained = true, .chain_id = ALC269_FIXUP_HEADSET_MIC }, + [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc285_fixup_invalidate_dacs, + }, }; static const struct snd_pci_quirk alc269_fixup_tbl[] = { @@ -7038,6 +7053,11 @@ static const struct snd_hda_pin_quirk al {0x12, 0x90a60130}, {0x19, 0x03a11020}, {0x21, 0x0321101f}), + SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, + {0x12, 0x90a60130}, + {0x14, 0x90170110}, + {0x19, 0x04a11040}, + {0x21, 0x04211020}), SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, {0x12, 0x90a60120}, {0x14, 0x90170110},