Skip to content

Commit 70b0c75

Browse files
plbossartbroonie
authored andcommitted
ASoC: SOF: acpi: add debug module param
Add debug parameter for snd-sof-acpi. One of the usages for this debug parameter to disable pm_runtime, which can be useful for platform bringup, or keep the parent device active while enabling pm_runtime for child devices (e.g. with SoundWire or MFD). This can also be useful to measure suspend-resume latencies or child devices. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191008164443.1358-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 902fd49 commit 70b0c75

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎sound/soc/sof/sof-acpi-dev.c‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ static char *tplg_path;
2929
module_param(tplg_path, charp, 0444);
3030
MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology.");
3131

32+
static int sof_acpi_debug;
33+
module_param_named(sof_acpi_debug, sof_acpi_debug, int, 0444);
34+
MODULE_PARM_DESC(sof_acpi_debug, "SOF ACPI debug options (0x0 all off)");
35+
36+
#define SOF_ACPI_DISABLE_PM_RUNTIME BIT(0)
37+
3238
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HASWELL)
3339
static const struct sof_dev_desc sof_acpi_haswell_desc = {
3440
.machines = snd_soc_acpi_intel_haswell_machines,
@@ -121,6 +127,9 @@ static const struct dev_pm_ops sof_acpi_pm = {
121127

122128
static void sof_acpi_probe_complete(struct device *dev)
123129
{
130+
if (sof_acpi_debug & SOF_ACPI_DISABLE_PM_RUNTIME)
131+
return;
132+
124133
/* allow runtime_pm */
125134
pm_runtime_set_autosuspend_delay(dev, SND_SOF_SUSPEND_DELAY_MS);
126135
pm_runtime_use_autosuspend(dev);
@@ -221,7 +230,8 @@ static int sof_acpi_probe(struct platform_device *pdev)
221230

222231
static int sof_acpi_remove(struct platform_device *pdev)
223232
{
224-
pm_runtime_disable(&pdev->dev);
233+
if (!(sof_acpi_debug & SOF_ACPI_DISABLE_PM_RUNTIME))
234+
pm_runtime_disable(&pdev->dev);
225235

226236
/* call sof helper for DSP hardware remove */
227237
snd_sof_device_remove(&pdev->dev);

0 commit comments

Comments
 (0)