diff mbox series

[1/4] ASoC: SOF: add .shutdown() callback to snd_sof_dsp_ops

Message ID 20210113152617.4048541-1-kai.vehmanen@linux.intel.com (mailing list archive)
State Accepted
Commit 7edb3051f11683640c38b93e183ef1676090a79b
Headers show
Series [1/4] ASoC: SOF: add .shutdown() callback to snd_sof_dsp_ops | expand

Commit Message

Kai Vehmanen Jan. 13, 2021, 3:26 p.m. UTC
From: Keyon Jie <yang.jie@linux.intel.com>

Add .shutdown() callback to the struct snd_sof_dsp_ops, for
doing platform specific actions at shutdown.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/soc/sof/ops.h      | 8 ++++++++
 sound/soc/sof/sof-priv.h | 4 +++-
 2 files changed, 11 insertions(+), 1 deletion(-)

Comments

Mark Brown Jan. 13, 2021, 5:53 p.m. UTC | #1
On Wed, 13 Jan 2021 17:26:14 +0200, Kai Vehmanen wrote:
> Add .shutdown() callback to the struct snd_sof_dsp_ops, for
> doing platform specific actions at shutdown.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/4] ASoC: SOF: add .shutdown() callback to snd_sof_dsp_ops
      commit: 7edb3051f11683640c38b93e183ef1676090a79b
[2/4] ASoC: SOF: add snd_sof_device_shutdown() helper for shutdown
      commit: daff7f1478e12cdee3e639c83c571cfd38bc5080
[3/4] ASoC: SOF: sof-pci-dev: add .shutdown() callback
      commit: 3475b44c7601d6f2b4d96e731047ef73fd2f1eb2
[4/4] ASoC: SOF: Intel: tgl: do thorough remove at .shutdown() callback
      commit: 44a4cfad8d78efcda9ec0dd97ceea38d8b602f24

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/sound/soc/sof/ops.h b/sound/soc/sof/ops.h
index 4c1f9daaa6e8..f0c9ca8820d2 100644
--- a/sound/soc/sof/ops.h
+++ b/sound/soc/sof/ops.h
@@ -37,6 +37,14 @@  static inline int snd_sof_remove(struct snd_sof_dev *sdev)
 	return 0;
 }
 
+static inline int snd_sof_shutdown(struct snd_sof_dev *sdev)
+{
+	if (sof_ops(sdev)->shutdown)
+		return sof_ops(sdev)->shutdown(sdev);
+
+	return 0;
+}
+
 /* control */
 
 /*
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
index 28d19fa30614..682c4b6d01ef 100644
--- a/sound/soc/sof/sof-priv.h
+++ b/sound/soc/sof/sof-priv.h
@@ -98,9 +98,10 @@  struct snd_sof_pdata;
  */
 struct snd_sof_dsp_ops {
 
-	/* probe and remove */
+	/* probe/remove/shutdown */
 	int (*probe)(struct snd_sof_dev *sof_dev); /* mandatory */
 	int (*remove)(struct snd_sof_dev *sof_dev); /* optional */
+	int (*shutdown)(struct snd_sof_dev *sof_dev); /* optional */
 
 	/* DSP core boot / reset */
 	int (*run)(struct snd_sof_dev *sof_dev); /* mandatory */
@@ -462,6 +463,7 @@  struct snd_sof_dev {
 
 int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data);
 int snd_sof_device_remove(struct device *dev);
+int snd_sof_device_shutdown(struct device *dev);
 
 int snd_sof_runtime_suspend(struct device *dev);
 int snd_sof_runtime_resume(struct device *dev);