From patchwork Tue Dec 6 06:39:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 9462057 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2E32D6022E for ; Tue, 6 Dec 2016 06:58:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C26D27F93 for ; Tue, 6 Dec 2016 06:58:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10C0E2808F; Tue, 6 Dec 2016 06:58:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 851CC27F93 for ; Tue, 6 Dec 2016 06:58:06 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B10EC266F2E; Tue, 6 Dec 2016 07:58:05 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6E9A7266686; Tue, 6 Dec 2016 07:55:45 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 02CF4266F16; Tue, 6 Dec 2016 07:40:07 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id 7687E266F01 for ; Tue, 6 Dec 2016 07:40:03 +0100 (CET) Received: from [175.41.48.77] (helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1cE9Q2-0007J6-F2; Tue, 06 Dec 2016 06:40:02 +0000 From: Kai-Heng Feng To: tiwai@suse.com Date: Tue, 6 Dec 2016 14:39:41 +0800 Message-Id: <20161206063941.13876-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.10.2 Cc: hui.wang@canonical.com, alsa-devel@alsa-project.org, Kai-Heng Feng Subject: [alsa-devel] [PATCH] ALSA: hda: ignore assoc when comparing pin configurations X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Commit [64047d7f4912 ALSA: hda - ignore the assoc and seq when comparing pin configurations] may still fail to match pins on some machines, because the bitmask it used only ignore seq but not assoc. Change the bitmask to also ignore assoc. Thanks to Hui Wang for the analysis. Signed-off-by: Kai-Heng Feng --- sound/pci/hda/hda_auto_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c index 4ad29f8..fdc30d0 100644 --- a/sound/pci/hda/hda_auto_parser.c +++ b/sound/pci/hda/hda_auto_parser.c @@ -901,7 +901,7 @@ static bool pin_config_match(struct hda_codec *codec, for (; t_pins->nid; t_pins++) { if (t_pins->nid == nid) { found = 1; - if ((t_pins->val & 0xfffffff0) == (cfg & 0xfffffff0)) + if ((t_pins->val & 0xffffff00) == (cfg & 0xffffff00)) break; else if ((cfg & 0xf0000000) == 0x40000000 && (t_pins->val & 0xf0000000) == 0x40000000) break;