From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Syed Saba Kareem <Syed.SabaKareem@amd.com>,
Vijendar Mukunda <Vijendar.Mukunda@amd.com>,
Mark Brown <broonie@kernel.org>, Sasha Levin <sashal@kernel.org>,
lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com,
rdunlap@infradead.org, mario.limonciello@amd.com,
pierre-louis.bossart@linux.intel.com, nathan@kernel.org,
alsa-devel@alsa-project.org
Subject: [PATCH AUTOSEL 6.3 18/24] ASoC: amd: Add check for acp config flags
Date: Sat, 6 May 2023 20:30:14 -0400 [thread overview]
Message-ID: <20230507003022.4070535-18-sashal@kernel.org> (raw)
In-Reply-To: <20230507003022.4070535-1-sashal@kernel.org>
From: Syed Saba Kareem <Syed.SabaKareem@amd.com>
[ Upstream commit bddcfb0802eb69b0f51293eab5db33d344c0262f ]
We have SOF and generic ACP support enabled for Rembrandt and
pheonix platforms 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 Chrome machines. If no
flag is specified probe and register older platform device.
Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230412091638.1158901-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/amd/Kconfig | 2 ++
sound/soc/amd/ps/acp63.h | 2 ++
sound/soc/amd/ps/pci-ps.c | 8 +++++++-
sound/soc/amd/yc/acp6x.h | 3 +++
sound/soc/amd/yc/pci-acp6x.c | 8 +++++++-
5 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig
index c88ebd84bdd50..08e42082f5e96 100644
--- a/sound/soc/amd/Kconfig
+++ b/sound/soc/amd/Kconfig
@@ -90,6 +90,7 @@ config SND_SOC_AMD_VANGOGH_MACH
config SND_SOC_AMD_ACP6x
tristate "AMD Audio Coprocessor-v6.x Yellow Carp support"
+ select SND_AMD_ACP_CONFIG
depends on X86 && PCI
help
This option enables Audio Coprocessor i.e ACP v6.x support on
@@ -130,6 +131,7 @@ config SND_SOC_AMD_RPL_ACP6x
config SND_SOC_AMD_PS
tristate "AMD Audio Coprocessor-v6.3 Pink Sardine support"
+ select SND_AMD_ACP_CONFIG
depends on X86 && PCI && ACPI
help
This option enables Audio Coprocessor i.e ACP v6.3 support on
diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h
index 6bf29b520511d..dd36790b25aef 100644
--- a/sound/soc/amd/ps/acp63.h
+++ b/sound/soc/amd/ps/acp63.h
@@ -111,3 +111,5 @@ struct acp63_dev_data {
u16 pdev_count;
u16 pdm_dev_index;
};
+
+int snd_amd_acp_find_config(struct pci_dev *pci);
diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c
index e86f23d97584f..558a67fe306ae 100644
--- a/sound/soc/amd/ps/pci-ps.c
+++ b/sound/soc/amd/ps/pci-ps.c
@@ -249,11 +249,17 @@ static int snd_acp63_probe(struct pci_dev *pci,
{
struct acp63_dev_data *adata;
u32 addr;
- u32 irqflags;
+ u32 irqflags, flag;
int val;
int ret;
irqflags = IRQF_SHARED;
+
+ /* Return if acp config flag is defined */
+ flag = snd_amd_acp_find_config(pci);
+ if (flag)
+ return -ENODEV;
+
/* Pink Sardine device check */
switch (pci->revision) {
case 0x63:
diff --git a/sound/soc/amd/yc/acp6x.h b/sound/soc/amd/yc/acp6x.h
index 036207568c048..2de7d1edf00b7 100644
--- a/sound/soc/amd/yc/acp6x.h
+++ b/sound/soc/amd/yc/acp6x.h
@@ -105,3 +105,6 @@ static inline void acp6x_writel(u32 val, void __iomem *base_addr)
{
writel(val, base_addr - ACP6x_PHY_BASE_ADDRESS);
}
+
+int snd_amd_acp_find_config(struct pci_dev *pci);
+
diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c
index 77c5fa1f7af14..7af6a349b1d41 100644
--- a/sound/soc/amd/yc/pci-acp6x.c
+++ b/sound/soc/amd/yc/pci-acp6x.c
@@ -149,10 +149,16 @@ static int snd_acp6x_probe(struct pci_dev *pci,
int index = 0;
int val = 0x00;
u32 addr;
- unsigned int irqflags;
+ unsigned int irqflags, flag;
int ret;
irqflags = IRQF_SHARED;
+
+ /* Return if acp config flag is defined */
+ flag = snd_amd_acp_find_config(pci);
+ if (flag)
+ return -ENODEV;
+
/* Yellow Carp device check */
switch (pci->revision) {
case 0x60:
--
2.39.2
next prev parent reply other threads:[~2023-05-07 0:33 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-07 0:29 [PATCH AUTOSEL 6.3 01/24] ASoC: jack: allow multiple interrupt per gpio Sasha Levin
2023-05-07 0:29 ` [PATCH AUTOSEL 6.3 02/24] staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE Sasha Levin
2023-05-07 0:29 ` [PATCH AUTOSEL 6.3 03/24] HID: apple: Set the tilde quirk flag on the Geyser 4 and later Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 04/24] iio: imu: st_lsm6dsx: discard samples during filters settling time Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 05/24] staging: axis-fifo: initialize timeouts in init only Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 06/24] ASoC: tegra: Support coupled mic-hp detection Sasha Levin
2023-05-07 23:38 ` Mark Brown
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 07/24] xhci: mem: Carefully calculate size for memory allocations Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 08/24] xhci: Avoid PCI MSI/MSIX interrupt reinitialization at resume Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 09/24] spi: intel-pci: Add support for Meteor Lake-S SPI serial flash Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 10/24] ASoC: amd: yc: Add DMI entries to support HP OMEN 16-n0xxx (8A42) Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 11/24] HID: logitech-hidpp: Don't use the USB serial for USB devices Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 12/24] HID: logitech-hidpp: Reconcile USB and Unifying serials Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 13/24] spi: spi-imx: fix MX51_ECSPI_* macros when cs > 3 Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 14/24] usb: typec: ucsi: acpi: add quirk for ASUS Zenbook UM325 Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 15/24] ALSA: hda: LNL: add HD Audio PCI ID Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 16/24] ASoC: amd: Add Dell G15 5525 to quirks list Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 17/24] ASoC: amd: yc: Add ThinkBook 14 G5+ ARP to quirks list for acp6x Sasha Levin
2023-05-07 0:30 ` Sasha Levin [this message]
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 19/24] HID: apple: Set the tilde quirk flag on the Geyser 3 Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 20/24] HID: Ignore battery for ELAN touchscreen on ROG Flow X13 GV301RA Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 21/24] HID: wacom: generic: Set battery quirk only when we see battery data Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 22/24] usb: typec: tcpm: fix multiple times discover svids error Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 23/24] serial: 8250: Reinit port->pm on port specific driver unbind Sasha Levin
2023-05-07 0:30 ` [PATCH AUTOSEL 6.3 24/24] mcb-pci: Reallocate memory region to avoid memory overlapping Sasha Levin
2023-05-07 23:38 ` [PATCH AUTOSEL 6.3 01/24] ASoC: jack: allow multiple interrupt per gpio Mark Brown
2023-05-18 17:09 ` Sasha Levin
2023-05-19 2:18 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230507003022.4070535-18-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Syed.SabaKareem@amd.com \
--cc=Vijendar.Mukunda@amd.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=nathan@kernel.org \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rdunlap@infradead.org \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox