Skip to content

Commit

Permalink
ASoC: amd: acp: add legacy driver support for ACP7.1 based platforms
Browse files Browse the repository at this point in the history
Add acp pci driver and machine driver changes for ACP7.1 based platforms
for legacy stack.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20240813080850.3107409-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Vijendar Mukunda authored and Mark Brown committed Aug 13, 2024
1 parent ab73c7c commit c6f3abb
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
7 changes: 4 additions & 3 deletions sound/soc/amd/acp/acp-legacy-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ static int acp_power_on(struct acp_chip_info *chip)
acp_pgfsm_ctrl_reg = ACP63_PGFSM_CONTROL;
break;
case ACP70_DEV:
case ACP71_DEV:
acp_pgfsm_stat_reg = ACP70_PGFSM_STATUS;
acp_pgfsm_ctrl_reg = ACP70_PGFSM_CONTROL;
break;
Expand Down Expand Up @@ -336,10 +337,9 @@ int acp_deinit(struct acp_chip_info *chip)
if (ret)
return ret;

if (chip->acp_rev != ACP70_DEV)
if (chip->acp_rev < ACP70_DEV)
writel(0, chip->base + ACP_CONTROL);

if (chip->acp_rev >= ACP70_DEV)
else
writel(0x01, chip->base + ACP_ZSC_DSP_CTRL);
return 0;
}
Expand Down Expand Up @@ -461,6 +461,7 @@ void check_acp_config(struct pci_dev *pci, struct acp_chip_info *chip)
check_acp6x_config(chip);
break;
case ACP70_DEV:
case ACP71_DEV:
pdm_addr = ACP70_PDM_ADDR;
check_acp70_config(chip);
break;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/amd/acp/acp-mach-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
} else if (drv_data->platform == ACP63) {
links[i].platforms = 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].num_platforms = ARRAY_SIZE(platform_acp70_component);
} else {
Expand Down
1 change: 1 addition & 0 deletions sound/soc/amd/acp/acp-mach.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ enum platform_end_point {
REMBRANDT,
ACP63,
ACP70,
ACP71,
};

struct acp_mach_ops {
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/amd/acp/acp-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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->acp_rev = ACP70_DEV;
break;
case 0x71:
chip->name = "acp_asoc_acp70";
chip->acp_rev = ACP71_DEV;
break;
default:
dev_err(dev, "Unsupported device revision:0x%x\n", pci->revision);
ret = -EINVAL;
Expand Down
12 changes: 10 additions & 2 deletions sound/soc/amd/acp/acp70.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ static int acp_acp70_audio_probe(struct platform_device *pdev)
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);
return -ENODEV;
}
Expand Down Expand Up @@ -178,7 +182,11 @@ static int acp_acp70_audio_probe(struct platform_device *pdev)
adata->num_dai = ARRAY_SIZE(acp70_dai);
adata->rsrc = &rsrc;
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;
acp_machine_select(adata);

Expand Down
1 change: 1 addition & 0 deletions sound/soc/amd/acp/amd.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define ACP6X_DEV 6
#define ACP63_DEV 0x63
#define ACP70_DEV 0x70
#define ACP71_DEV 0x71

#define DMIC_INSTANCE 0x00
#define I2S_SP_INSTANCE 0x01
Expand Down

0 comments on commit c6f3abb

Please sign in to comment.