From patchwork Mon Jul 17 11:45:02 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: 121259 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1077548vqt; Mon, 17 Jul 2023 05:27:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlF/fB0Xi/x3ZfgE3IEyGlWWfHdh+hL3vbkFzknXXKfFi0NLIDkrJERJoy+7rIQ+1yP175b6 X-Received: by 2002:a17:907:75ef:b0:992:ba2c:2e0c with SMTP id jz15-20020a17090775ef00b00992ba2c2e0cmr10229045ejc.36.1689596865764; Mon, 17 Jul 2023 05:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689596865; cv=none; d=google.com; s=arc-20160816; b=ED9mvmExg6YyYfT9tPWHCDquJXqZyQzIpVz+4yy9w0nC1joamBfN7IYmhP84Pvo2Bh CwzA40MdsKSiNOU/uyaMJvNIQlnlrg+Y9eDEhEZxGAUvloP3rQwT6FUL84/XohadKLwU hU/vQDT2lh14N7gi2EZ4HXe5Xg3KMYArXiEITmNZZP2Kuprm3DMjVKUdKW4mSlHmaO2c uhUWp3ZhGxzBQV6enVeIBtWBh6aUj1wfiMR6RonomXcvIintOwToVEK8p3hzlKg4Ofdk 5CNGPVYZMWBmHdHbrwm7H7ue0fNms4ganlyEqX7EqEhF7EbWF/5NtxbTI/I0bytJZSc4 Mqbg== 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=O+crPwVa79UdYUs++xQ1qnSJQ+72FU8S/8oG1+eA2Rs=; fh=WYMxSBIzRoGpjokqDjpNyzs/ox+ow6sUuRoGJdpn/uA=; b=f/NSsUhX+xgMX1djlZvS5h2sQvNYIhhzD8uWu0KuB/Aeyqp2HxW1/VQZ7ZdSAGG69X UldgAynNvRh5RkEHjTfo0GqCoWQQzx1PSfiRg578/j13PGL1WbKm4Fes3eoeThCjdFjB HcSoxOKIgSh/tp+IgfImPI1S5vjzlMd3Z8Zl6CNaMepv17m85+gQCq1Gkv9grbOurkDO WUine5KIRY2B76tEBrS/LHQld+chHHSlY6Q2zZKd58xpySw/N2NUInxVvgdJriTbJuRw RwB/Hj6o/2lodrWZM3jy8T1tLkoDbkabNagAssYrW66p57VRl9d3zYGm0DeyVOFq5NhO EGSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="hK/VTVoE"; 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 gl7-20020a170906e0c700b0098da8d0ce58si14213064ejb.868.2023.07.17.05.27.22; Mon, 17 Jul 2023 05:27:45 -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="hK/VTVoE"; 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 S229736AbjGQLqK (ORCPT + 99 others); Mon, 17 Jul 2023 07:46:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbjGQLqD (ORCPT ); Mon, 17 Jul 2023 07:46:03 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1795C1732; Mon, 17 Jul 2023 04:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689594349; x=1721130349; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xDZvjDAnmyr9idM4V2jRguD7382ptl0JEWF/BZWKdgo=; b=hK/VTVoE0ptLKkLuuDwCaSoIaRVckFEZwMcI+2Z/Rc2XzbjG9Yh7qKMc AhQPPTh//5/fD3kT7oXiPkmt1IrGY2z41uuPyMLCqRFsYBAqCU29IKS+y B9CwaaZXsMA4A9MNBU+8vOytfefste2/Pz5ptBWVxxl1d4j4lFUYvWEZD aj5BCRsszPWe6El30gMfnk+sQxROqJAB/9RzYVuN8Du1A8ryM715WZXhV 83KSp6En4OvQoyJhwTRwWJGwMOsMJgcmGj1be1iWGsapz24/q4ToXR2qA vgaGpv/1XeV3mLqEo7xCLn+1GjoHNhgw9bRRG75VHeKjYXXZBhq1mmJ9/ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="363372838" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="363372838" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2023 04:45:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="969856511" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="969856511" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga006.fm.intel.com with ESMTP; 17 Jul 2023 04:45:37 -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 , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Hans de Goede , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Andy Shevchenko Subject: [PATCH v4 06/15] ALSA: hda: Use global PCI match macro Date: Mon, 17 Jul 2023 13:45:02 +0200 Message-Id: <20230717114511.484999-7-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230717114511.484999-1-amadeuszx.slawinski@linux.intel.com> References: <20230717114511.484999-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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: 1771670723105150218 X-GMAIL-MSGID: 1771670723105150218 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 Acked-by: Mark Brown Reviewed-by: Cezary Rojewski 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; }