From 6ace85b9838dc0162b474dbbbb6b388e7561f6a7 Mon Sep 17 00:00:00 2001 From: Chunxu Li Date: Fri, 5 Aug 2022 15:04:48 +0800 Subject: ASoC: SOF: Introduce function sof_of_machine_select From current design in sof_machine_check and snd_sof_new_platform_drv, the SOF can only support ACPI type machine. 1. In sof_machine_check if there is no ACPI machine exist, the function will return -ENODEV directly, that's we don't expected if we do not base on ACPI machine. 2. In snd_sof_new_platform_drv the component driver need a driver name to do ignore_machine, currently the driver name is obtained from machine->drv_name, and the type of machine is snd_soc_acpi_mach. So we add a new function named sof_of_machine_select that we can pass sof_machine_check and obtain info required by snd_sof_new_platform_drv. Signed-off-by: Chunxu Li Link: https://lore.kernel.org/r/20220805070449.6611-2-chunxu.li@mediatek.com Signed-off-by: Mark Brown --- include/sound/sof.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sound') diff --git a/include/sound/sof.h b/include/sound/sof.h index 367dccfea7ad..341fef19e612 100644 --- a/include/sound/sof.h +++ b/include/sound/sof.h @@ -89,6 +89,7 @@ struct snd_sof_pdata { /* machine */ struct platform_device *pdev_mach; const struct snd_soc_acpi_mach *machine; + const struct snd_sof_of_mach *of_machine; void *hw_pdata; @@ -102,6 +103,7 @@ struct snd_sof_pdata { struct sof_dev_desc { /* list of machines using this configuration */ struct snd_soc_acpi_mach *machines; + struct snd_sof_of_mach *of_machines; /* alternate list of machines using this configuration */ struct snd_soc_acpi_mach *alt_machines; -- cgit v1.2.3