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 572F7C001DC for ; Mon, 24 Jul 2023 01:26:08 +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 9C0CE7F8; Mon, 24 Jul 2023 03:25:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9C0CE7F8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690161966; bh=vWIWAXSPm/UdwXZIgKTcuPuKFwlmTT2IBEdbLdmH3xM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=jH4+p9cAGEgc8Kx5CFTJ8v6qdt0uhw8qQKiZKgshocoaCbZ3HaJzhVKpWNdK5Z9FB gOBATymM4TJ2H356VRbTBs0RL9wPQwr2g/sekCfxSVRC+pHvBl/RKYBQnNe68Z1JRM wqhETYINtMemI85vhssZ85WeWsjwKn1jJEZg6/cE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id BBD42F805BA; Mon, 24 Jul 2023 03:23:54 +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 4380CF805AE; Mon, 24 Jul 2023 03:23:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AD025F805AA; Mon, 24 Jul 2023 03:23:51 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A4914F8019B for ; Mon, 24 Jul 2023 03:23:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A4914F8019B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=IVPkmCn9 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 98CB660EF9; Mon, 24 Jul 2023 01:23:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E1E1C433C7; Mon, 24 Jul 2023 01:23:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690161827; bh=vWIWAXSPm/UdwXZIgKTcuPuKFwlmTT2IBEdbLdmH3xM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IVPkmCn9A4DsQkscQdxliGTBNhG0SFSeS0ToLzIkq01AYQ56XMF6jAYF3b+sS534v G02yz5AkKHgw/IfCGGzLOCeOWkW2P3c9a/9fWcN8ne3vFkaprXveRwhmk0Q+YfbrKI NG11CY8+IIzf32woO4XV9oBKa4sdJs4aeZijrcCQKsI71NIaP3hZfzD+TcSDlqcllI 1wD9iMKNCU+wqN/Yg9lqcDNeMzUUdu9+TJL77P//zJ1j94pTUUlHyMG0pwjpxwksuP q/4i50L6d1ON1E+G90B/9vj5NDfHya3O1gbKoIJ0o5V8eW/PlSWelSgG0Lw2X8NF+K uGx5mYtd3d2zg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Venkata Prasad Potturu , Mark Brown , Sasha Levin , lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.15 04/23] ASoC: amd: vangogh: Add check for acp config flags in vangogh platform Date: Sun, 23 Jul 2023 21:23:15 -0400 Message-Id: <20230724012334.2317140-4-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230724012334.2317140-1-sashal@kernel.org> References: <20230724012334.2317140-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.121 Content-Transfer-Encoding: 8bit Message-ID-Hash: JHDSQBEL2XZVNK35R7DSGI5IWZDY3P2V X-Message-ID-Hash: JHDSQBEL2XZVNK35R7DSGI5IWZDY3P2V X-MailFrom: sashal@kernel.org 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: From: Venkata Prasad Potturu [ Upstream commit e89f45edb747ed88e97a5771dd6d3dd1eb517873 ] We have SOF and generic ACP support enabled for Vangogh platform on some machines. Since we have same PCI id used for probing, add check for machine configuration flag to avoid conflict with newer pci drivers. Such machine flag has been initialized via dmi match on few Vangogh based machines. If no flag is specified probe and register older platform device. Signed-off-by: Venkata Prasad Potturu Link: https://lore.kernel.org/r/20230530110802.674939-1-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/amd/vangogh/acp5x.h | 2 ++ sound/soc/amd/vangogh/pci-acp5x.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/vangogh/acp5x.h b/sound/soc/amd/vangogh/acp5x.h index a808635f97400..ac9827393c453 100644 --- a/sound/soc/amd/vangogh/acp5x.h +++ b/sound/soc/amd/vangogh/acp5x.h @@ -145,6 +145,8 @@ static inline void acp_writel(u32 val, void __iomem *base_addr) writel(val, base_addr - ACP5x_PHY_BASE_ADDRESS); } +int snd_amd_acp_find_config(struct pci_dev *pci); + static inline u64 acp_get_byte_count(struct i2s_stream_instance *rtd, int direction) { diff --git a/sound/soc/amd/vangogh/pci-acp5x.c b/sound/soc/amd/vangogh/pci-acp5x.c index a57b762d9f2e1..1b4bf357f2015 100644 --- a/sound/soc/amd/vangogh/pci-acp5x.c +++ b/sound/soc/amd/vangogh/pci-acp5x.c @@ -121,10 +121,15 @@ static int snd_acp5x_probe(struct pci_dev *pci, { struct acp5x_dev_data *adata; struct platform_device_info pdevinfo[ACP5x_DEVS]; - unsigned int irqflags; + unsigned int irqflags, flag; int ret, i; u32 addr, val; + /* Return if acp config flag is defined */ + flag = snd_amd_acp_find_config(pci); + if (flag) + return -ENODEV; + irqflags = IRQF_SHARED; if (pci->revision != 0x50) return -ENODEV; -- 2.39.2