summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2025-02-17 17:17:43 -0600
committerMark Brown <broonie@kernel.org>2025-02-18 23:15:15 +0000
commit135c6af1cac5465529469700d16c0c44b24ce317 (patch)
tree99ea716b378d4e52866efc9bfb757c257a693c07
parente211adcf36d0ccdd31af7398af4725a47d74b3d4 (diff)
ASoC: amd: acp: acp70: Use AMD_NODE
All consumers of SMN in the kernel should be doing it through the functions provided by AMD_NODE. Stop using the local SMN read/write symbols and switch to the AMD_NODE provided ones. Tested by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://patch.msgid.link/20250217231747.1656228-4-superm1@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/amd/acp/Kconfig1
-rw-r--r--sound/soc/amd/acp/acp70.c28
-rw-r--r--sound/soc/sof/amd/pci-acp70.c1
3 files changed, 5 insertions, 25 deletions
diff --git a/sound/soc/amd/acp/Kconfig b/sound/soc/amd/acp/Kconfig
index cdc3add3ffdb..811921931430 100644
--- a/sound/soc/amd/acp/Kconfig
+++ b/sound/soc/amd/acp/Kconfig
@@ -82,6 +82,7 @@ config SND_AMD_ASOC_ACP70
tristate "AMD ACP ASOC Acp7.0 Support"
depends on X86 && PCI
depends on ACPI
+ depends on AMD_NODE
select SND_SOC_AMD_ACP_PCM
select SND_SOC_AMD_ACP_I2S
select SND_SOC_AMD_ACP_PDM
diff --git a/sound/soc/amd/acp/acp70.c b/sound/soc/amd/acp/acp70.c
index 9e23729fd1a7..ef3f6504bc7f 100644
--- a/sound/soc/amd/acp/acp70.c
+++ b/sound/soc/amd/acp/acp70.c
@@ -23,6 +23,8 @@
#include "amd.h"
#include "acp-mach.h"
+#include <asm/amd_node.h>
+
#define DRV_NAME "acp_asoc_acp70"
#define CLK7_CLK0_DFS_CNTL_N1 0X0006C1A4
@@ -137,29 +139,6 @@ static struct snd_soc_dai_driver acp70_dai[] = {
},
};
-static int acp70_i2s_master_clock_generate(struct acp_dev_data *adata)
-{
- struct pci_dev *smn_dev;
- u32 device_id;
-
- if (adata->acp_rev == ACP70_PCI_ID)
- device_id = 0x1507;
- else if (adata->acp_rev == ACP71_PCI_ID)
- device_id = 0x1122;
- else
- return -ENODEV;
-
- smn_dev = pci_get_device(PCI_VENDOR_ID_AMD, device_id, NULL);
-
- if (!smn_dev)
- return -ENODEV;
-
- /* Set clk7 DFS clock divider register value to get mclk as 196.608MHz*/
- smn_write(smn_dev, CLK7_CLK0_DFS_CNTL_N1, CLK0_DIVIDER);
-
- return 0;
-}
-
static int acp_acp70_audio_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -215,7 +194,8 @@ static int acp_acp70_audio_probe(struct platform_device *pdev)
dev_set_drvdata(dev, adata);
- ret = acp70_i2s_master_clock_generate(adata);
+ /* Set clk7 DFS clock divider register value to get mclk as 196.608MHz*/
+ ret = amd_smn_write(0, CLK7_CLK0_DFS_CNTL_N1, CLK0_DIVIDER);
if (ret) {
dev_err(&pdev->dev, "Failed to set I2S master clock as 196.608MHz\n");
return ret;
diff --git a/sound/soc/sof/amd/pci-acp70.c b/sound/soc/sof/amd/pci-acp70.c
index 3647ec992e95..d886bdf3a112 100644
--- a/sound/soc/sof/amd/pci-acp70.c
+++ b/sound/soc/sof/amd/pci-acp70.c
@@ -28,7 +28,6 @@
#define ACP70_REG_END 0x125C000
static const struct sof_amd_acp_desc acp70_chip_info = {
- .host_bridge_id = HOST_BRIDGE_ACP70,
.pgfsm_base = ACP70_PGFSM_BASE,
.ext_intr_enb = ACP70_EXTERNAL_INTR_ENB,
.ext_intr_cntl = ACP70_EXTERNAL_INTR_CNTL,