From patchwork Fri Jul 14 18:56:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 120426 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp2431710vqm; Fri, 14 Jul 2023 04:22:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlHhC1h22/Y9s9p7Vc9DDUtnlAAXkfV4i1Fm4LRFOXcLXFFJC7d7uq0W2ILoPu2qKl8LUPFM X-Received: by 2002:a05:6a20:4419:b0:106:25b3:2f92 with SMTP id ce25-20020a056a20441900b0010625b32f92mr3978569pzb.52.1689333763381; Fri, 14 Jul 2023 04:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689333763; cv=none; d=google.com; s=arc-20160816; b=wj7hn3uGkTFSAkmg/8GgY2iYaEHaOzdZFN1kJKzu5xAUGkmySplCVy3mCf3wJXzEX8 tj60p1uLRF5+deAtzU0IDgDNl87qeBxZLgCEB0zsLIpGdxLUCp46YKCqLi4FmP5n4pag Ns9DkDnJ/pY+bfO5LMnWA/ndtYAk/Lwkn/s1elhks/kTzrxnqXYwiz4u1wxdHLOQBUon 59ElE7rXf+OY3jsATbhsrQF/kQ8cmWbvgzETmEojZO93Eb19sHE+Ez4GLSo5DfvEKe3L 2B/OTMaj3NhWjYVDnMNNp0Fws4G9taVdoXIgtm5kkRrLZP4VHQNrFp5P3hqwlhnI4U5A 3o4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vbEoOyPt4D4SfVWLcCWzIkqIEzZJ9lUqznLYKXeDTOo=; fh=iLu8mJV3L09dzJN6VXkKj+SRT/C9p8fR4gJYErWu4bc=; b=NFgi+xF4svaxTWA093g4E+SfhLoKtsrmV3wcqRFR8YdwJiuVxpPysNaE6YDKhqv4yx 1GqdPH3j2FGVZ93oP6ohR8uPr63RtV5uwCpd+zCfYHAKqfYsUw1uAbCb11oWyqf000KU srupW6v9nC2IK7IE3y4zDHzAz7T6FpdBvocKOvKmBLZziJfft7IXcS7FFqBevSM87Whq 09Yhv1qevLqOOuavUj6Dg+VnFZ15mftyZ2d1y9VxtZPNTAVVwwN3AE47D0rBm6eztYu5 yVM2QwmLD5kkAFxccg5NHtXPegTlHClfVU9098oE3Lnf5uXam/pDkKyBzNOmuhApjwYA gIvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="i5Y2Wy/R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w13-20020a170902d3cd00b001b9c61c221bsi6833772plb.565.2023.07.14.04.22.30; Fri, 14 Jul 2023 04:22:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="i5Y2Wy/R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236324AbjGNKzz (ORCPT + 99 others); Fri, 14 Jul 2023 06:55:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235985AbjGNKzY (ORCPT ); Fri, 14 Jul 2023 06:55:24 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E34D535A5; Fri, 14 Jul 2023 03:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689332120; x=1720868120; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=M7s2WR/9r+GNRVVyX1shgcdusyU+2/x/3kFITCcHbVw=; b=i5Y2Wy/RzGR7NGquL97CYPr5ZXj6uxK0nWI8mBT6JUEpGELDpITz8RFX HcjaKJZYNWPUOy440noaUA2n4Sf8eXJ3XHVApt6DvN46USsxshJcsJhUh PzImczZUFLJwPQZuTTava+hfICW1pZcvUc/bl11cS7TKQoTLDCB18Va08 OoOgtHygGDAPNVLqTLzFSeiDCiIaW+Z+McLj1EpA1S1GGPkXzBBa3T79k nfHxI81sXzCFMayYRUm3gPPfbFEPTcu7dEZqZYJ2OJWF7ZjOpx99jGY9B +LPDNkL9RBCfLwzc8u6LgcrYxXJbVIAEujPe64OcX39vjtVo7nucPSF2u Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10770"; a="364321171" X-IronPort-AV: E=Sophos;i="6.01,205,1684825200"; d="scan'208";a="364321171" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2023 03:55:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10770"; a="722365482" X-IronPort-AV: E=Sophos;i="6.01,205,1684825200"; d="scan'208";a="722365482" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga002.jf.intel.com with ESMTP; 14 Jul 2023 03:55:17 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Bjorn Helgaas , Mark Brown , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Cezary Rojewski , Pierre-Louis Bossart , Kai Vehmanen , Andy Shevchenko , Hans de Goede , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Andy Shevchenko Subject: [PATCH v2 06/15] ALSA: hda: Use global PCI match macro Date: Fri, 14 Jul 2023 20:56:06 +0200 Message-Id: <20230714185615.370597-7-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230714185615.370597-1-amadeuszx.slawinski@linux.intel.com> References: <20230714185615.370597-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771394839961141147 X-GMAIL-MSGID: 1771394839961141147 Instead of using local macro to match PCI device, use global one. As Apollolake is Broxton-P successor that made it to the market, be precise and use APL shortcut. Reviewed-by: Andy Shevchenko Signed-off-by: Amadeusz Sławiński --- sound/pci/hda/hda_intel.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 8f0cebb83302..5e59dcc35665 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -330,18 +330,6 @@ enum { #define needs_eld_notify_link(chip) false #endif -#define CONTROLLER_IN_GPU(pci) (((pci)->vendor == 0x8086) && \ - (((pci)->device == 0x0a0c) || \ - ((pci)->device == 0x0c0c) || \ - ((pci)->device == 0x0d0c) || \ - ((pci)->device == 0x160c) || \ - ((pci)->device == 0x490d) || \ - ((pci)->device == 0x4f90) || \ - ((pci)->device == 0x4f91) || \ - ((pci)->device == 0x4f92))) - -#define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98) - static const char * const driver_short_names[] = { [AZX_DRIVER_ICH] = "HDA Intel", [AZX_DRIVER_PCH] = "HDA Intel PCH", @@ -573,7 +561,7 @@ static void hda_intel_init_chip(struct azx *chip, bool full_reset) snd_hdac_set_codec_wakeup(bus, false); /* reduce dma latency to avoid noise */ - if (IS_BXT(pci)) + if (HDA_CONTROLLER_IS_APL(pci)) bxt_reduce_dma_latency(chip); if (bus->mlcap != NULL) @@ -2175,7 +2163,7 @@ static int azx_probe(struct pci_dev *pci, #endif /* CONFIG_SND_HDA_PATCH_LOADER */ #ifndef CONFIG_SND_HDA_I915 - if (CONTROLLER_IN_GPU(pci)) + if (HDA_CONTROLLER_IN_GPU(pci)) dev_err(card->dev, "Haswell/Broadwell HDMI/DP must build in CONFIG_SND_HDA_I915\n"); #endif @@ -2283,7 +2271,7 @@ static int azx_probe_continue(struct azx *chip) * for other chips, still continue probing as other * codecs can be on the same link. */ - if (CONTROLLER_IN_GPU(pci)) { + if (HDA_CONTROLLER_IN_GPU(pci)) { dev_err(chip->card->dev, "HSW/BDW HD-audio HDMI/DP requires binding with gfx driver\n"); goto out_free; @@ -2294,7 +2282,7 @@ static int azx_probe_continue(struct azx *chip) } /* HSW/BDW controllers need this power */ - if (CONTROLLER_IN_GPU(pci)) + if (HDA_CONTROLLER_IN_GPU(pci)) hda->need_i915_power = true; }