Skip to content

Commit e063330

Browse files
ribaldabroonie
authored andcommitted
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 <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 93d519a commit e063330

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sound/soc/sof/mediatek/mt8186/mt8186.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,11 @@ static int mt8186_dsp_remove(struct snd_sof_dev *sdev)
430430
return 0;
431431
}
432432

433+
static int mt8186_dsp_shutdown(struct snd_sof_dev *sdev)
434+
{
435+
return snd_sof_suspend(sdev->dev);
436+
}
437+
433438
static int mt8186_dsp_suspend(struct snd_sof_dev *sdev, u32 target_state)
434439
{
435440
mt8186_sof_hifixdsp_shutdown(sdev);
@@ -538,6 +543,7 @@ static struct snd_sof_dsp_ops sof_mt8186_ops = {
538543
/* probe and remove */
539544
.probe = mt8186_dsp_probe,
540545
.remove = mt8186_dsp_remove,
546+
.shutdown = mt8186_dsp_shutdown,
541547

542548
/* DSP core boot */
543549
.run = mt8186_run,
@@ -629,6 +635,7 @@ MODULE_DEVICE_TABLE(of, sof_of_mt8186_ids);
629635
static struct platform_driver snd_sof_of_mt8186_driver = {
630636
.probe = sof_of_probe,
631637
.remove = sof_of_remove,
638+
.shutdown = sof_of_shutdown,
632639
.driver = {
633640
.name = "sof-audio-of-mt8186",
634641
.pm = &sof_of_pm,

0 commit comments

Comments
 (0)