All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, broonie@kernel.org,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [PATCH 4/5] ASoC: SOF: acpi: add module param to disable pm_runtime
Date: Fri, 24 May 2019 14:23:08 -0500	[thread overview]
Message-ID: <20190524192309.6359-5-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20190524192309.6359-1-pierre-louis.bossart@linux.intel.com>

Add debug option to disable pm_runtime. This is not intended for
production devices but is very useful for platform bringup.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/sof-acpi-dev.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/sof-acpi-dev.c b/sound/soc/sof/sof-acpi-dev.c
index e9cf69874b5b..38062dd00dd2 100644
--- a/sound/soc/sof/sof-acpi-dev.c
+++ b/sound/soc/sof/sof-acpi-dev.c
@@ -32,6 +32,12 @@ static char *tplg_path;
 module_param(tplg_path, charp, 0444);
 MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology.");
 
+static int sof_acpi_debug;
+module_param_named(sof_debug, sof_acpi_debug, int, 0444);
+MODULE_PARM_DESC(sof_debug, "SOF ACPI debug options (0x0 all off)");
+
+#define SOF_ACPI_DISABLE_PM_RUNTIME BIT(0)
+
 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HASWELL)
 static const struct sof_dev_desc sof_acpi_haswell_desc = {
 	.machines = snd_soc_acpi_intel_haswell_machines,
@@ -174,6 +180,9 @@ static const struct dev_pm_ops sof_acpi_pm = {
 
 static void sof_acpi_probe_complete(struct device *dev)
 {
+	if (sof_acpi_debug & SOF_ACPI_DISABLE_PM_RUNTIME)
+		return;
+
 	/* allow runtime_pm */
 	pm_runtime_set_autosuspend_delay(dev, SND_SOF_SUSPEND_DELAY_MS);
 	pm_runtime_use_autosuspend(dev);
@@ -274,7 +283,8 @@ static int sof_acpi_probe(struct platform_device *pdev)
 
 static int sof_acpi_remove(struct platform_device *pdev)
 {
-	pm_runtime_disable(&pdev->dev);
+	if (!(sof_acpi_debug & SOF_ACPI_DISABLE_PM_RUNTIME))
+		pm_runtime_disable(&pdev->dev);
 
 	/* call sof helper for DSP hardware remove */
 	snd_sof_device_remove(&pdev->dev);
-- 
2.20.1

  parent reply	other threads:[~2019-05-24 19:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24 19:23 [PATCH 0/5] ASoC: SOF: suspend/resume debug tools Pierre-Louis Bossart
2019-05-24 19:23 ` [PATCH 1/5] ASoC: SOF: trace: remove code duplication in sof_wait_trace_avail() Pierre-Louis Bossart
2019-05-28 15:06   ` Applied "ASoC: SOF: trace: remove code duplication in sof_wait_trace_avail()" to the asoc tree Mark Brown
2019-05-24 19:23 ` [PATCH 2/5] ASoC: SOF: force end-of-file for debugfs trace at suspend Pierre-Louis Bossart
2019-05-28 15:06   ` Applied "ASoC: SOF: force end-of-file for debugfs trace at suspend" to the asoc tree Mark Brown
2019-05-24 19:23 ` [PATCH 3/5] ASoC: SOF: trace: move to opt-in with Kconfig and module parameter Pierre-Louis Bossart
2019-05-24 19:23 ` Pierre-Louis Bossart [this message]
2019-05-24 19:23 ` [PATCH 5/5] ASoC: SOF: pci: add module param to disable pm_runtime Pierre-Louis Bossart
2019-06-03 15:45 ` [PATCH 0/5] ASoC: SOF: suspend/resume debug tools Pierre-Louis Bossart
2019-06-03 18:58   ` Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190524192309.6359-5-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.