ASoC: SOF: amd: propagate pdm_sel to SDW machine driver via mach->pdata

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@amd.com>
Link: https://patch.msgid.link/20261013154644.3788064-9-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Vijendar Mukunda 2026-10-13 21:11:40 +05:30 committed by Mark Brown
parent 0e4c408116
commit 439c43d962
No known key found for this signature in database
GPG Key ID: 2FEF73B0B3D03889

View File

@ -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;