From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2C8FEB64DC for ; Tue, 11 Jul 2023 13:37:38 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C36B5AEA; Tue, 11 Jul 2023 15:36:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C36B5AEA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1689082656; bh=524GPqhKA4PY07IMonLbtpmWvOSiTrizz3nlKdExsX0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=vMsUVF3CzCIINoOU2DzNsEoSC0OLvLWSNhX3fP3U5m0eKHAiUCfo8jM3nKqw9oJX8 LVLN1a+pCdrkL1tF8E8JSVeZWhbu2EFOc1kYncvR/nEu+k3y28FFHFeE8VQz5qp3oH zmex86648o2ewb9hJKvJiX1dW2jVnPNM+xNCmkMA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0B90CF80290; Tue, 11 Jul 2023 15:36:25 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 916EEF80249; Tue, 11 Jul 2023 15:36:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D75C8F80249; Tue, 11 Jul 2023 15:36:20 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9838BF800E4 for ; Tue, 11 Jul 2023 15:36:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9838BF800E4 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=nkOKQ0YX DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689082577; x=1720618577; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=524GPqhKA4PY07IMonLbtpmWvOSiTrizz3nlKdExsX0=; b=nkOKQ0YXpxf6d6HtXhT/V31Qum1ig54FxXL9x4QAtYAkoPhm5jz+i2V5 E44L/BqpgC9rMFXcQOBqjqWRvkp+xdFvzYEslgy0HjbNRub24fzsPkpQa 47OB/vCDB/mh7FjPzQkhWwjqBea5UP7LlTALe5OAjIvhfrIIaftYZTjCl VeqMvRftRhfE115jFVHAwZ9fJ19uBXdfSkTDNPmCqOZJ4ds6WBHLh5aLD RVPTtZRG5+WvMTMXMvSs1vsSIv0Zc18emu/3SyTSCUbTCtHG+zoq+PHtE +EMT17I7D0TbhBFSmzT/hnJ+TqiGbrTZJbtQHaXHnad/DwfTwmv2ppBpW A==; X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="364656340" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="364656340" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2023 06:36:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="724436510" X-IronPort-AV: E=Sophos;i="6.01,196,1684825200"; d="scan'208";a="724436510" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga007.fm.intel.com with ESMTP; 11 Jul 2023 06:36:11 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qJDXF-001rTm-0r; Tue, 11 Jul 2023 16:36:09 +0300 Date: Tue, 11 Jul 2023 16:36:09 +0300 From: Andy Shevchenko To: Amadeusz =?utf-8?B?U8WCYXdpxYRza2k=?= Cc: Bjorn Helgaas , Mark Brown , Takashi Iwai , alsa-devel@alsa-project.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Cezary Rojewski , Pierre-Louis Bossart , Kai Vehmanen , Hans de Goede Subject: Re: [PATCH 03/13] ALSA: hda: Add controller matching macros Message-ID: References: <20230711125726.3509391-1-amadeuszx.slawinski@linux.intel.com> <20230711125726.3509391-4-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230711125726.3509391-4-amadeuszx.slawinski@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Message-ID-Hash: ADS7IKNIWS4APDSDIC4EYT7F44QCSBLC X-Message-ID-Hash: ADS7IKNIWS4APDSDIC4EYT7F44QCSBLC X-MailFrom: andriy.shevchenko@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, Jul 11, 2023 at 02:57:16PM +0200, Amadeusz Sławiński wrote: > Some HDA controllers require additional handling, so there are macros to > match them, however those are spread across multiple files. Add them all > in one place, so they can be reused. FWIW, Reviewed-by: Andy Shevchenko One nit-pick below. > Signed-off-by: Amadeusz Sławiński > --- > include/sound/hdaudio.h | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > > diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h > index 2ffdf58bd6d4..aacacca456d5 100644 > --- a/include/sound/hdaudio.h > +++ b/include/sound/hdaudio.h > @@ -11,6 +11,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -704,4 +705,30 @@ static inline unsigned int snd_array_index(struct snd_array *array, void *ptr) > for ((idx) = 0, (ptr) = (array)->list; (idx) < (array)->used; \ > (ptr) = snd_array_elem(array, ++(idx))) > > +/* > + * Device matching > + */ > + > +#define HDA_CONTROLLER_IS_HSW(pci) (pci_match_id((struct pci_device_id []){ \ > + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_HSW_0) }, \ > + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_HSW_2) }, \ > + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_HSW_3) }, \ > + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_BDW) }, \ > + { } \ > + }, pci)) > + > +#define HDA_CONTROLLER_IS_APL(pci) (pci_match_id((struct pci_device_id []){ \ > + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_APL) }, \ > + { } \ > + }, pci)) > + > +#define HDA_CONTROLLER_IN_GPU(pci) (HDA_CONTROLLER_IS_HSW(pci) || \ > + pci_match_id((struct pci_device_id []){ \ I think if you start with pci_match_id() and move HDA_CONTROLLER_IS_HSW() at the end it will make this macro aligned with the rest, so easier to get them all at once. > + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_DG1) }, \ > + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_DG2_0) }, \ > + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_DG2_1) }, \ > + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_DG2_2) }, \ > + { } \ > + }, pci)) -- With Best Regards, Andy Shevchenko