summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorRicardo Ribalda <ribalda@chromium.org>2022-11-27 21:04:15 +0100
committerMark Brown <broonie@kernel.org>2022-11-30 11:35:43 +0000
commite063330a77edbdc57a142a27a82e51dc1361ab9d (patch)
tree46a2bcbdde2f1acda687de3645a8c36fabfba57c /sound
parent93d519a12a83baa19dae59d121439b04fb9dfded (diff)
ASoC: SOF: mediatek: add shutdown callback
If we do not shutdown the peripheral properly at shutdown, the whole system crashes after kexec() on the first io access. Let's implement the appropriate callback. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20221127-mtk-snd-v1-0-b7886faa612b@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/sof/mediatek/mt8186/mt8186.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
index 181189e00e02..79da25725987 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.c
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
@@ -430,6 +430,11 @@ static int mt8186_dsp_remove(struct snd_sof_dev *sdev)
return 0;
}
+static int mt8186_dsp_shutdown(struct snd_sof_dev *sdev)
+{
+ return snd_sof_suspend(sdev->dev);
+}
+
static int mt8186_dsp_suspend(struct snd_sof_dev *sdev, u32 target_state)
{
mt8186_sof_hifixdsp_shutdown(sdev);
@@ -538,6 +543,7 @@ static struct snd_sof_dsp_ops sof_mt8186_ops = {
/* probe and remove */
.probe = mt8186_dsp_probe,
.remove = mt8186_dsp_remove,
+ .shutdown = mt8186_dsp_shutdown,
/* DSP core boot */
.run = mt8186_run,
@@ -629,6 +635,7 @@ MODULE_DEVICE_TABLE(of, sof_of_mt8186_ids);
static struct platform_driver snd_sof_of_mt8186_driver = {
.probe = sof_of_probe,
.remove = sof_of_remove,
+ .shutdown = sof_of_shutdown,
.driver = {
.name = "sof-audio-of-mt8186",
.pm = &sof_of_pm,