From patchwork Fri Jul 14 20:24:48 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: 120457 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp2473985vqm; Fri, 14 Jul 2023 05:39:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlG7+3jEKXBpNWgBFNCirGyiJTQZin3zcCBBfI+3WY5aS3zAc1wcmCEwgGrKs/tZ/cWoDsOG X-Received: by 2002:a05:6a00:1827:b0:684:aa3e:7bf3 with SMTP id y39-20020a056a00182700b00684aa3e7bf3mr1349272pfa.31.1689338345325; Fri, 14 Jul 2023 05:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689338345; cv=none; d=google.com; s=arc-20160816; b=sDR3rTwGoJVRuVMEVzwUozkA641P1UcGFnldnHH6BUDByoUypeigSQqmJlOzjB8gox JD8gaHBX//7ez39DR14msxM4iwjQOGWbJ+6bDDxU0q9BSBY4oO4F6N3PDkld5qo9PRq8 kITkm0hSzoPKPlfpwppei5Tyzk1EwTWxFB88CSwyb3YE4rFXZZzFBr+R7Kmmnfpgtlhy o7E4FNpOfERAghyfeGTnj8m1BSa5vVgqu02iSmjSO5r6QfoJQGJLkv5nvlwb0iZRSYtF J9R+H8r1blgdmio5+1RnwMzhsVMvwojx86M/3Ug7KH/oCKKj+dzp7P5oTcO4kSRywawE ArgQ== 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=cCdH+/AjA1SxTylxd/5atjunb5c8BtTAYZ6pQfhwMdbbRKQ7ftyWVT0F7NykhyT7Nw FXPOBnebyfb+lSOcgWnNnvByyXc6mCbpboCkZNTOxdzlON72YrziniFmB4VRSCmpzMq7 s/ar4X+xnL6JlRxFOpSqrs98VGn8mMtORsVQEz4CP+jTm3GNiz+wdnUzk9J6ToqSIs6y lU1dcIE091CbHcSaiY4lE1HkjBRngo6DdpByoPPqAFzy9UVqGKi3poGwjZUGmSJmgxhF SSX5EuX5vCXXeHn8OISPOUOIjpZB6aYEaKNX8FENLUMlZ0jdKEb1x+pcf4Lt/96BbNvj lugw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MeSD8x2i; 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 d4-20020a056a0010c400b0064f6a531c88si7068036pfu.323.2023.07.14.05.38.52; Fri, 14 Jul 2023 05:39:05 -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=MeSD8x2i; 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 S235303AbjGNMYT (ORCPT + 99 others); Fri, 14 Jul 2023 08:24:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235383AbjGNMYH (ORCPT ); Fri, 14 Jul 2023 08:24:07 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11D1B2722; Fri, 14 Jul 2023 05:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689337440; x=1720873440; 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=MeSD8x2irAZrK3NlDp64bUfPFiyxCKa4lcBhcWO8+gfbDTnuCu2IeoBk 5Mcd5VtCNL5XcXhpPgFD+5GKQtrnB7y3lcyzQ65gjZtYPL21t9V7mcRGQ pCZc6xPKyH+UNbZxCIcMKXB64Mlx+HOPzku9yAeTP3+eChD34HUp9s7/3 GaYlCeJHO1AR5SUt5P1nF06ePE9h3yKV2syHLev/xbLYuJKAEEmv0Y2xI /Mf2TFeblUTR7oy7OsbJKSH0xgNb5ZEhPNtdzxmHwHbLymrXwoLHNNEeh hKZo1BcObps9stcNdLEBZdwlT53V8LLCNa1bwEBMx6Z/4KaR2wg0gi6wr g==; X-IronPort-AV: E=McAfee;i="6600,9927,10770"; a="429225832" X-IronPort-AV: E=Sophos;i="6.01,205,1684825200"; d="scan'208";a="429225832" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2023 05:23:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10770"; a="1053034896" X-IronPort-AV: E=Sophos;i="6.01,205,1684825200"; d="scan'208";a="1053034896" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by fmsmga005.fm.intel.com with ESMTP; 14 Jul 2023 05:23:56 -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 v3 06/15] ALSA: hda: Use global PCI match macro Date: Fri, 14 Jul 2023 22:24:48 +0200 Message-Id: <20230714202457.423866-7-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230714202457.423866-1-amadeuszx.slawinski@linux.intel.com> References: <20230714202457.423866-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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: 1771399644475158485 X-GMAIL-MSGID: 1771399644475158485 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; }