Unverified Commit 7edb3051 authored by Keyon Jie's avatar Keyon Jie Committed by Mark Brown
Browse files

ASoC: SOF: add .shutdown() callback to snd_sof_dsp_ops



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

Signed-off-by: default avatarKeyon Jie <yang.jie@linux.intel.com>
Reviewed-by: default avatarBard Liao <bard.liao@intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210113152617.4048541-1-kai.vehmanen@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 342c3bc5
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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 */

/*
+3 −1
Original line number Diff line number Diff line
@@ -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);