summaryrefslogtreecommitdiff
path: root/sound/soc/amd/acp/acp-pci.c
diff options
context:
space:
mode:
authorSyed Saba Kareem <Syed.SabaKareem@amd.com>2023-06-26 16:55:05 +0300
committerMark Brown <broonie@kernel.org>2023-07-10 00:47:33 +0300
commite61b415515d3db57dce3af3e4a0441f08d8d8f15 (patch)
treee1306b5b98f5f9e996e620b6aa3f5240a4cbf003 /sound/soc/amd/acp/acp-pci.c
parent3d74f42c56db263e82ad96f8fe23aef38cdc071f (diff)
downloadlinux-e61b415515d3db57dce3af3e4a0441f08d8d8f15.tar.xz
ASoC: amd: acp: refactor the acp init and de-init sequence
Remove the individual acp init and de-init functions from different variants of acp pci driver(for renoir/rembrandt platforms) and use a common file to define callbacks and refactor the callbacks to support existing platforms. Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com> Link: https://lore.kernel.org/r/20230626135515.1252063-2-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd/acp/acp-pci.c')
-rw-r--r--sound/soc/amd/acp/acp-pci.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c
index 8154fbfd1229..a51cf7f32f7d 100644
--- a/sound/soc/amd/acp/acp-pci.c
+++ b/sound/soc/amd/acp/acp-pci.c
@@ -106,6 +106,7 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
goto unregister_dmic_dev;
}
+ acp_init(chip);
res = devm_kcalloc(&pci->dev, num_res, sizeof(struct resource), GFP_KERNEL);
if (!res) {
ret = -ENOMEM;
@@ -154,10 +155,17 @@ disable_pci:
static void acp_pci_remove(struct pci_dev *pci)
{
+ struct acp_chip_info *chip;
+ int ret;
+
+ chip = pci_get_drvdata(pci);
if (dmic_dev)
platform_device_unregister(dmic_dev);
if (pdev)
platform_device_unregister(pdev);
+ ret = acp_deinit(chip->base);
+ if (ret)
+ dev_err(&pci->dev, "ACP de-init failed\n");
}
/* PCI IDs */
@@ -177,4 +185,5 @@ static struct pci_driver snd_amd_acp_pci_driver = {
module_pci_driver(snd_amd_acp_pci_driver);
MODULE_LICENSE("Dual BSD/GPL");
+MODULE_IMPORT_NS(SND_SOC_ACP_COMMON);
MODULE_ALIAS(DRV_NAME);