diff mbox series

[SRU,H/OEM-5.10,3/6] ASoC: SOF: sof-pci-dev: add .shutdown() callback

Message ID 20210318034922.7546-4-hui.wang@canonical.com
State New
Headers show
Series power off stress test will hang on the TGL machines | expand

Commit Message

Hui Wang March 18, 2021, 3:49 a.m. UTC
From: Keyon Jie <yang.jie@linux.intel.com>

BugLink: https://bugs.launchpad.net/bugs/1919930

Add the .shutdown() callback to the sof-pci-dev driver, to help to
handle shutting down specific tasks for SOF PCI platforms.

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>
Link: https://lore.kernel.org/r/20210113152617.4048541-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 3475b44c7601d6f2b4d96e731047ef73fd2f1eb2)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
---
 sound/soc/sof/sof-pci-dev.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c
index 9adf50b20a73..1cb4b25e5777 100644
--- a/sound/soc/sof/sof-pci-dev.c
+++ b/sound/soc/sof/sof-pci-dev.c
@@ -459,6 +459,11 @@  static void sof_pci_remove(struct pci_dev *pci)
 	pci_release_regions(pci);
 }
 
+static void sof_pci_shutdown(struct pci_dev *pci)
+{
+	snd_sof_device_shutdown(&pci->dev);
+}
+
 /* PCI IDs */
 static const struct pci_device_id sof_pci_ids[] = {
 #if IS_ENABLED(CONFIG_SND_SOC_SOF_MERRIFIELD)
@@ -532,6 +537,7 @@  static struct pci_driver snd_sof_pci_driver = {
 	.id_table = sof_pci_ids,
 	.probe = sof_pci_probe,
 	.remove = sof_pci_remove,
+	.shutdown = sof_pci_shutdown,
 	.driver = {
 		.pm = &sof_pci_pm,
 	},