@@ -51,6 +51,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;
};
@@ -885,7 +885,10 @@ void snd_sof_new_platform_drv(struct snd_sof_dev *sdev)
struct snd_sof_pdata *plat_data = sdev->pdata;
const char *drv_name;
- drv_name = plat_data->machine->drv_name;
+ if (plat_data->machine)
+ drv_name = plat_data->machine->drv_name;
+ else
+ drv_name = plat_data->machine_drv_name;
pd->name = "sof-audio-component";
pd->probe = sof_pcm_probe;
@@ -884,7 +884,7 @@ int sof_machine_check(struct snd_sof_dev *sdev)
/* find machine */
snd_sof_machine_select(sdev);
- if (sof_pdata->machine) {
+ if (sof_pdata->machine || sof_pdata->machine_drv_name) {
snd_sof_set_mach_params(sof_pdata->machine, sdev);
return 0;
}
@@ -78,6 +78,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;
}