mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 19:47:08 +02:00
ASoC: amd: acp: use acp_rev for platform specific conditional checks
Add 'acp_rev' as a member in machine driver private data structure to store acp pci revision id. Replace platform specific conditional checks by using 'acp_rev' variable. Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://patch.msgid.link/20240924061821.1127054-3-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
839a8b18db
commit
fca471b5d0
|
|
@ -126,6 +126,7 @@ static int acp_asoc_probe(struct platform_device *pdev)
|
|||
{
|
||||
struct snd_soc_card *card = NULL;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct snd_soc_acpi_mach *mach = dev_get_platdata(&pdev->dev);
|
||||
const struct dmi_system_id *dmi_id;
|
||||
struct acp_card_drvdata *acp_card_drvdata;
|
||||
int ret;
|
||||
|
|
@ -173,6 +174,7 @@ static int acp_asoc_probe(struct platform_device *pdev)
|
|||
if (!strcmp(pdev->name, "acp-pdm-mach"))
|
||||
acp_card_drvdata->platform = *((int *)dev->platform_data);
|
||||
|
||||
acp_card_drvdata->acp_rev = mach->mach_params.subsystem_rev;
|
||||
dmi_id = dmi_first_match(acp_quirk_table);
|
||||
if (dmi_id && dmi_id->driver_data)
|
||||
acp_card_drvdata->tdm_mode = dmi_id->driver_data;
|
||||
|
|
|
|||
|
|
@ -1471,7 +1471,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
|
|||
if (drv_data->amp_cpu_id == I2S_SP) {
|
||||
links[i].name = "acp-amp-codec";
|
||||
links[i].id = AMP_BE_ID;
|
||||
if (drv_data->platform == RENOIR) {
|
||||
if (drv_data->acp_rev == ACP_RN_PCI_ID) {
|
||||
links[i].cpus = sof_sp;
|
||||
links[i].num_cpus = ARRAY_SIZE(sof_sp);
|
||||
} else {
|
||||
|
|
@ -1647,12 +1647,12 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
|
|||
links[i].id = HEADSET_BE_ID;
|
||||
links[i].cpus = i2s_hs;
|
||||
links[i].num_cpus = ARRAY_SIZE(i2s_hs);
|
||||
switch (drv_data->platform) {
|
||||
case REMBRANDT:
|
||||
switch (drv_data->acp_rev) {
|
||||
case ACP_RMB_PCI_ID:
|
||||
links[i].platforms = platform_rmb_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_rmb_component);
|
||||
break;
|
||||
case ACP63:
|
||||
case ACP63_PCI_ID:
|
||||
links[i].platforms = platform_acp63_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_acp63_component);
|
||||
break;
|
||||
|
|
@ -1719,12 +1719,12 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
|
|||
links[i].id = AMP_BE_ID;
|
||||
links[i].cpus = i2s_hs;
|
||||
links[i].num_cpus = ARRAY_SIZE(i2s_hs);
|
||||
switch (drv_data->platform) {
|
||||
case REMBRANDT:
|
||||
switch (drv_data->acp_rev) {
|
||||
case ACP_RMB_PCI_ID:
|
||||
links[i].platforms = platform_rmb_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_rmb_component);
|
||||
break;
|
||||
case ACP63:
|
||||
case ACP63_PCI_ID:
|
||||
links[i].platforms = platform_acp63_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_acp63_component);
|
||||
break;
|
||||
|
|
@ -1770,17 +1770,17 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
|
|||
}
|
||||
links[i].cpus = pdm_dmic;
|
||||
links[i].num_cpus = ARRAY_SIZE(pdm_dmic);
|
||||
switch (drv_data->platform) {
|
||||
case REMBRANDT:
|
||||
switch (drv_data->acp_rev) {
|
||||
case ACP_RMB_PCI_ID:
|
||||
links[i].platforms = platform_rmb_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_rmb_component);
|
||||
break;
|
||||
case ACP63:
|
||||
case ACP63_PCI_ID:
|
||||
links[i].platforms = platform_acp63_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_acp63_component);
|
||||
break;
|
||||
case ACP70:
|
||||
case ACP71:
|
||||
case ACP70_PCI_ID:
|
||||
case ACP71_PCI_ID:
|
||||
links[i].platforms = platform_acp70_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_acp70_component);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
#include <linux/module.h>
|
||||
#include <sound/soc.h>
|
||||
|
||||
#include "acp_common.h"
|
||||
|
||||
#define TDM_CHANNELS 8
|
||||
|
||||
#define ACP_OPS(priv, cb) ((priv)->ops.cb)
|
||||
|
|
@ -78,6 +80,7 @@ struct acp_card_drvdata {
|
|||
unsigned int dmic_codec_id;
|
||||
unsigned int dai_fmt;
|
||||
unsigned int platform;
|
||||
unsigned int acp_rev;
|
||||
struct clk *wclk;
|
||||
struct clk *bclk;
|
||||
struct acp_mach_ops ops;
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ static int acp_sof_probe(struct platform_device *pdev)
|
|||
{
|
||||
struct snd_soc_card *card = NULL;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct snd_soc_acpi_mach *mach = dev_get_platdata(&pdev->dev);
|
||||
const struct dmi_system_id *dmi_id;
|
||||
struct acp_card_drvdata *acp_card_drvdata;
|
||||
int ret;
|
||||
|
|
@ -116,6 +117,7 @@ static int acp_sof_probe(struct platform_device *pdev)
|
|||
if (dmi_id && dmi_id->driver_data)
|
||||
acp_card_drvdata->tdm_mode = dmi_id->driver_data;
|
||||
|
||||
acp_card_drvdata->acp_rev = mach->mach_params.subsystem_rev;
|
||||
ret = acp_sofdsp_dai_links_create(card);
|
||||
if (ret)
|
||||
return dev_err_probe(&pdev->dev, ret, "Failed to create DAI links\n");
|
||||
|
|
|
|||
19
sound/soc/amd/acp/acp_common.h
Normal file
19
sound/soc/amd/acp/acp_common.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only
|
||||
* Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved
|
||||
*/
|
||||
|
||||
/*
|
||||
* acp_common.h - acp common header file
|
||||
*/
|
||||
|
||||
#ifndef __ACP_COMMON_H
|
||||
#define __ACP_COMMON_H
|
||||
|
||||
#define ACP_RN_PCI_ID 0x01
|
||||
#define ACP_VANGOGH_PCI_ID 0x50
|
||||
#define ACP_RMB_PCI_ID 0x6F
|
||||
#define ACP63_PCI_ID 0x63
|
||||
#define ACP70_PCI_ID 0x70
|
||||
#define ACP71_PCI_ID 0x71
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user