From b3e475e831b7ae38c2a1db0cfdf65fddc817599a Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Mon, 18 Mar 2019 21:36:15 -0700 Subject: [PATCH] ASoC: SOF: ACPI: detach platform dev from pm_domain on Minnowboard A recent change in the SOF driver to power off all DAPM widgets in the audio pipeline when not active causes the DSP on the Minnowboard to be powered off. This is despite the fact that PM is not implemented for the Baytrail platform and we explicitly keep the device usage count > 0 to prevent the system from being runtime suspended. In ACPI platforms (such as BYT), the platform device is attached to a pm_domain. The pm_domain provider is responsible for powering on/off all the devices that are attached it. So when all the DAPM widgets in the card get powered down, the pm_domain provider powers off the DSP as well. Additionally, Minnowboard has a known issue with the BIOS that prevents the DSP from resuming back to D0 when the system resumes from S3 to S0. So, given the above limitations, it is recommended to detach the platform device from the pm_domain to prevent the DSP from being powered off on the Minnowboard. Signed-off-by: Ranjani Sridharan --- sound/soc/sof/sof-acpi-dev.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/sound/soc/sof/sof-acpi-dev.c b/sound/soc/sof/sof-acpi-dev.c index 53d2ade525b57f..2f0082edcd4460 100644 --- a/sound/soc/sof/sof-acpi-dev.c +++ b/sound/soc/sof/sof-acpi-dev.c @@ -13,6 +13,8 @@ #include #include #include +#include +#include #include #include #ifdef CONFIG_X86 @@ -166,6 +168,26 @@ static const struct sof_dev_desc sof_acpi_cherrytrail_desc = { #endif +/* BYT Minnowboard quirk table */ +static const struct dmi_system_id byt_quirk_table[] = { + { + /* Minnowboard Max B3 */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Circuitco"), + DMI_MATCH(DMI_PRODUCT_NAME, + "Minnowboard Max B3 PLATFORM"), + }, + }, + { + /* Minnowboard Turbot */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ADI"), + DMI_MATCH(DMI_PRODUCT_NAME, "Minnowboard Turbot"), + }, + }, + {} +}; + static const struct dev_pm_ops sof_acpi_pm = { SET_SYSTEM_SLEEP_PM_OPS(snd_sof_suspend, snd_sof_resume) SET_RUNTIME_PM_OPS(snd_sof_runtime_suspend, snd_sof_runtime_resume, @@ -191,6 +213,18 @@ static int sof_acpi_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "ACPI DSP detected"); + /* + * Minnowboard has a known issue with the BIOS that prevents the DSP + * from resuming back to D0 when the system resumes from S3 to S0. + * So, detach the platform device from the pm_domain to prevent + * the DSP from entering D3. The @power_off argument to the + * dev_pm_domain_detach() call indicates that the DSP should be + * left powered on. + */ + if (dmi_check_system(byt_quirk_table)) + if (dev->pm_domain) + dev_pm_domain_detach(dev, false); + sof_pdata = devm_kzalloc(dev, sizeof(*sof_pdata), GFP_KERNEL); if (!sof_pdata) return -ENOMEM;