LF-537-1 ASoC: SOF: Introduce machine driver name

ACPI creates tables with information about the machine driver.
With DT there is no need for such tables because we can directly
get all the information needed from DT file.

This patch introduces machine driver property inside dsp node.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This commit is contained in:
Daniel Baluta 2019-12-14 22:10:58 +02:00
parent 09803ef575
commit 0b4813a18e
3 changed files with 7 additions and 1 deletions

View File

@ -48,6 +48,7 @@ struct snd_sof_pdata {
/* machine */
struct platform_device *pdev_mach;
const struct snd_soc_acpi_mach *machine;
const char *machine_drv_name; /* machine driver name, set only for OF case */
void *hw_pdata;
};

View File

@ -756,7 +756,7 @@ void snd_sof_new_platform_drv(struct snd_sof_dev *sdev)
if (plat_data->machine)
drv_name = plat_data->machine->drv_name;
else
drv_name = "asoc-simple-card";
drv_name = plat_data->machine_drv_name;
pd->name = "sof-audio-component";
pd->probe = sof_pcm_probe;

View File

@ -54,6 +54,11 @@ int sof_of_parse(struct platform_device *pdev)
if (ret < 0)
return ret;
ret = of_property_read_string(np, "machine-drv-name",
&sof_pdata->machine_drv_name);
if (ret < 0)
return ret;
return 0;
}