[PATCH 8/9] ASoC: SOF: amd: propagate pdm_sel to SDW machine driver via mach->pdata

From: Vijendar Mukunda

Date: Tue Oct 13 2026 - 15:27:23 EST


When amd_sof_sdw_machine_select() returns a SoundWire machine, it did
not carry the PDM controller selection to the machine driver. Without
this, acp-sdw-sof-mach.c cannot configure the correct DMIC DAI link
for ACP7.B/7.F platforms.

Allocate amd_pdm_pdata and assign it to mach->pdata in the SDW machine
select return path when acp_data->pdm_sel is non-zero, mirroring the
existing handling in amd_sof_machine_select().

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@xxxxxxx>
---
sound/soc/sof/amd/acp-common.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/sound/soc/sof/amd/acp-common.c b/sound/soc/sof/amd/acp-common.c
index 60e5c851c8743..3bb1de8c03762 100644
--- a/sound/soc/sof/amd/acp-common.c
+++ b/sound/soc/sof/amd/acp-common.c
@@ -132,6 +132,7 @@ static struct snd_soc_acpi_mach *amd_sof_sdw_machine_select(struct snd_sof_dev *
struct snd_soc_acpi_mach *mach;
const struct snd_soc_acpi_link_adr *link;
struct acp_dev_data *acp_data = sdev->pdata->hw_pdata;
+ struct amd_pdm_pdata *pdm_pdata;
int ret, i;

if (acp_data->info.count) {
@@ -162,6 +163,16 @@ static struct snd_soc_acpi_mach *amd_sof_sdw_machine_select(struct snd_sof_dev *
mach->mach_params.link_mask = mach->link_mask;
mach->mach_params.platform = dev_name(sdev->dev);

+ if (acp_data->pdm_sel) {
+ pdm_pdata = devm_kzalloc(sdev->dev,
+ sizeof(*pdm_pdata),
+ GFP_KERNEL);
+ if (!pdm_pdata)
+ return NULL;
+ pdm_pdata->pdm_sel = acp_data->pdm_sel;
+ mach->pdata = pdm_pdata;
+ }
+
dev_dbg(sdev->dev, "SSID %x%04x\n", mach->mach_params.subsystem_vendor,
mach->mach_params.subsystem_device);
return mach;
--
2.48.1