Commit c6f3abbb authored by Vijendar Mukunda's avatar Vijendar Mukunda Committed by Mark Brown

ASoC: amd: acp: add legacy driver support for ACP7.1 based platforms

Add acp pci driver and machine driver changes for ACP7.1 based platforms
for legacy stack.
Signed-off-by: default avatarVijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240813080850.3107409-1-Vijendar.Mukunda@amd.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent ab73c7c0
...@@ -270,6 +270,7 @@ static int acp_power_on(struct acp_chip_info *chip) ...@@ -270,6 +270,7 @@ static int acp_power_on(struct acp_chip_info *chip)
acp_pgfsm_ctrl_reg = ACP63_PGFSM_CONTROL; acp_pgfsm_ctrl_reg = ACP63_PGFSM_CONTROL;
break; break;
case ACP70_DEV: case ACP70_DEV:
case ACP71_DEV:
acp_pgfsm_stat_reg = ACP70_PGFSM_STATUS; acp_pgfsm_stat_reg = ACP70_PGFSM_STATUS;
acp_pgfsm_ctrl_reg = ACP70_PGFSM_CONTROL; acp_pgfsm_ctrl_reg = ACP70_PGFSM_CONTROL;
break; break;
...@@ -336,10 +337,9 @@ int acp_deinit(struct acp_chip_info *chip) ...@@ -336,10 +337,9 @@ int acp_deinit(struct acp_chip_info *chip)
if (ret) if (ret)
return ret; return ret;
if (chip->acp_rev != ACP70_DEV) if (chip->acp_rev < ACP70_DEV)
writel(0, chip->base + ACP_CONTROL); writel(0, chip->base + ACP_CONTROL);
else
if (chip->acp_rev >= ACP70_DEV)
writel(0x01, chip->base + ACP_ZSC_DSP_CTRL); writel(0x01, chip->base + ACP_ZSC_DSP_CTRL);
return 0; return 0;
} }
...@@ -461,6 +461,7 @@ void check_acp_config(struct pci_dev *pci, struct acp_chip_info *chip) ...@@ -461,6 +461,7 @@ void check_acp_config(struct pci_dev *pci, struct acp_chip_info *chip)
check_acp6x_config(chip); check_acp6x_config(chip);
break; break;
case ACP70_DEV: case ACP70_DEV:
case ACP71_DEV:
pdm_addr = ACP70_PDM_ADDR; pdm_addr = ACP70_PDM_ADDR;
check_acp70_config(chip); check_acp70_config(chip);
break; break;
......
...@@ -1766,7 +1766,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card) ...@@ -1766,7 +1766,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
} else if (drv_data->platform == ACP63) { } else if (drv_data->platform == ACP63) {
links[i].platforms = platform_acp63_component; links[i].platforms = platform_acp63_component;
links[i].num_platforms = ARRAY_SIZE(platform_acp63_component); links[i].num_platforms = ARRAY_SIZE(platform_acp63_component);
} else if (drv_data->platform == ACP70) { } else if ((drv_data->platform == ACP70) || (drv_data->platform == ACP71)) {
links[i].platforms = platform_acp70_component; links[i].platforms = platform_acp70_component;
links[i].num_platforms = ARRAY_SIZE(platform_acp70_component); links[i].num_platforms = ARRAY_SIZE(platform_acp70_component);
} else { } else {
......
...@@ -56,6 +56,7 @@ enum platform_end_point { ...@@ -56,6 +56,7 @@ enum platform_end_point {
REMBRANDT, REMBRANDT,
ACP63, ACP63,
ACP70, ACP70,
ACP71,
}; };
struct acp_mach_ops { struct acp_mach_ops {
......
...@@ -95,6 +95,10 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id ...@@ -95,6 +95,10 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
chip->name = "acp_asoc_acp70"; chip->name = "acp_asoc_acp70";
chip->acp_rev = ACP70_DEV; chip->acp_rev = ACP70_DEV;
break; break;
case 0x71:
chip->name = "acp_asoc_acp70";
chip->acp_rev = ACP71_DEV;
break;
default: default:
dev_err(dev, "Unsupported device revision:0x%x\n", pci->revision); dev_err(dev, "Unsupported device revision:0x%x\n", pci->revision);
ret = -EINVAL; ret = -EINVAL;
......
...@@ -147,7 +147,11 @@ static int acp_acp70_audio_probe(struct platform_device *pdev) ...@@ -147,7 +147,11 @@ static int acp_acp70_audio_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
if (chip->acp_rev != ACP70_DEV) { switch (chip->acp_rev) {
case ACP70_DEV:
case ACP71_DEV:
break;
default:
dev_err(&pdev->dev, "Un-supported ACP Revision %d\n", chip->acp_rev); dev_err(&pdev->dev, "Un-supported ACP Revision %d\n", chip->acp_rev);
return -ENODEV; return -ENODEV;
} }
...@@ -178,7 +182,11 @@ static int acp_acp70_audio_probe(struct platform_device *pdev) ...@@ -178,7 +182,11 @@ static int acp_acp70_audio_probe(struct platform_device *pdev)
adata->num_dai = ARRAY_SIZE(acp70_dai); adata->num_dai = ARRAY_SIZE(acp70_dai);
adata->rsrc = &rsrc; adata->rsrc = &rsrc;
adata->machines = snd_soc_acpi_amd_acp70_acp_machines; adata->machines = snd_soc_acpi_amd_acp70_acp_machines;
adata->platform = ACP70; if (chip->acp_rev == ACP70_DEV)
adata->platform = ACP70;
else
adata->platform = ACP71;
adata->flag = chip->flag; adata->flag = chip->flag;
acp_machine_select(adata); acp_machine_select(adata);
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#define ACP6X_DEV 6 #define ACP6X_DEV 6
#define ACP63_DEV 0x63 #define ACP63_DEV 0x63
#define ACP70_DEV 0x70 #define ACP70_DEV 0x70
#define ACP71_DEV 0x71
#define DMIC_INSTANCE 0x00 #define DMIC_INSTANCE 0x00
#define I2S_SP_INSTANCE 0x01 #define I2S_SP_INSTANCE 0x01
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment