From 0b4813a18e7a3c0269f69300625b1d136efdde42 Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Sat, 14 Dec 2019 22:10:58 +0200 Subject: [PATCH] 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 --- include/sound/sof.h | 1 + sound/soc/sof/pcm.c | 2 +- sound/soc/sof/sof-of-dev.c | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/sound/sof.h b/include/sound/sof.h index 81889a859379..889c5644f482 100644 --- a/include/sound/sof.h +++ b/include/sound/sof.h @@ -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; }; diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c index 7fc5306b955d..504f155ecace 100644 --- a/sound/soc/sof/pcm.c +++ b/sound/soc/sof/pcm.c @@ -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; diff --git a/sound/soc/sof/sof-of-dev.c b/sound/soc/sof/sof-of-dev.c index c53d0c09aa20..f5a8c78c7a8d 100644 --- a/sound/soc/sof/sof-of-dev.c +++ b/sound/soc/sof/sof-of-dev.c @@ -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; }