All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai Vehmanen <kai.vehmanen@linux.intel.com>
To: alsa-devel@alsa-project.org, broonie@kernel.org
Cc: Marcin Rajwa <marcin.rajwa@linux.intel.com>,
	daniel.baluta@nxp.com, pierre-louis.bossart@linux.intel.com,
	kai.vehmanen@linux.intel.com, ranjani.sridharan@linux.intel.com
Subject: [PATCH 2/8] ASoC: SOF: add a power_down_notify method
Date: Fri, 15 May 2020 16:59:52 +0300	[thread overview]
Message-ID: <20200515135958.17511-3-kai.vehmanen@linux.intel.com> (raw)
In-Reply-To: <20200515135958.17511-1-kai.vehmanen@linux.intel.com>

From: Marcin Rajwa <marcin.rajwa@linux.intel.com>

This patch adds a snd_sof_dsp_power_down_notify() method which aims to
prepare the DSP for the upcoming power down.
This new function make use of SOF_IPC_PM_CTX_SAVE message.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/soc/sof/pm.c       | 9 +++++++++
 sound/soc/sof/sof-priv.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c
index 119e4d644ef4..5e804a7728f5 100644
--- a/sound/soc/sof/pm.c
+++ b/sound/soc/sof/pm.c
@@ -256,6 +256,15 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
 	return ret;
 }
 
+int snd_sof_dsp_power_down_notify(struct snd_sof_dev *sdev)
+{
+	/* Notify DSP of upcoming power down */
+	if (sof_ops(sdev)->remove)
+		return sof_send_pm_ctx_ipc(sdev, SOF_IPC_PM_CTX_SAVE);
+
+	return 0;
+}
+
 int snd_sof_runtime_suspend(struct device *dev)
 {
 	return sof_suspend(dev, true);
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
index a34dbae9f971..3ed39b887214 100644
--- a/sound/soc/sof/sof-priv.h
+++ b/sound/soc/sof/sof-priv.h
@@ -453,6 +453,7 @@ int snd_sof_runtime_resume(struct device *dev);
 int snd_sof_runtime_idle(struct device *dev);
 int snd_sof_resume(struct device *dev);
 int snd_sof_suspend(struct device *dev);
+int snd_sof_dsp_power_down_notify(struct snd_sof_dev *sdev);
 int snd_sof_prepare(struct device *dev);
 void snd_sof_complete(struct device *dev);
 
-- 
2.26.0


  parent reply	other threads:[~2020-05-15 14:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 13:59 [PATCH 0/8] ASoC: SOF: Intel and IMX updates for 5.8 Kai Vehmanen
2020-05-15 13:59 ` [PATCH 1/8] ASoC: SOF: Do nothing when DSP PM callbacks are not set Kai Vehmanen
2020-05-15 13:59 ` Kai Vehmanen [this message]
2020-05-15 13:59 ` [PATCH 3/8] ASoC: SOF: inform DSP that driver is going to be removed Kai Vehmanen
2020-05-15 13:59 ` [PATCH 4/8] ASoC: SOF: topology: add support to smart amplifier Kai Vehmanen
2020-05-15 13:59 ` [PATCH 5/8] ASoC: SOF: Intel: sdw: relax sdw machine select constraints Kai Vehmanen
2020-05-15 13:59 ` [PATCH 6/8] ASoC: SOF: define INFO_ flags in dsp_ops Kai Vehmanen
2020-05-15 13:59 ` [PATCH 7/8] ASoC: SOF: imx: make dsp_ops static Kai Vehmanen
2020-05-15 13:59 ` [PATCH 8/8] ASoC: SOF: imx: make imx8m_dsp_ops static Kai Vehmanen
2020-05-18 16:40 ` [PATCH 0/8] ASoC: SOF: Intel and IMX updates for 5.8 Mark Brown

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=20200515135958.17511-3-kai.vehmanen@linux.intel.com \
    --to=kai.vehmanen@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=marcin.rajwa@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    /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.