Skip to content

Commit

Permalink
ASoC: amd: vangogh: Add check for acp config flags in vangogh platform
Browse files Browse the repository at this point in the history
[ Upstream commit e89f45e ]

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 <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230530110802.674939-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Venkata-Prasad-Potturu authored and gregkh committed Aug 23, 2023
1 parent c212c2b commit 1260703
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sound/soc/amd/vangogh/acp5x.h
Expand Up @@ -147,6 +147,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)
{
Expand Down
7 changes: 6 additions & 1 deletion sound/soc/amd/vangogh/pci-acp5x.c
Expand Up @@ -125,10 +125,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;
Expand Down

0 comments on commit 1260703

Please sign in to comment.