Merge tag 'sound-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[linux-2.6-microblaze.git] / sound / pci / hda / hda_codec.c
index 7a717e1..a9ebefd 100644 (file)
@@ -2981,6 +2981,18 @@ const struct dev_pm_ops hda_codec_driver_pm = {
                           NULL)
 };
 
+/* suspend the codec at shutdown; called from driver's shutdown callback */
+void snd_hda_codec_shutdown(struct hda_codec *codec)
+{
+       struct hda_pcm *cpcm;
+
+       list_for_each_entry(cpcm, &codec->pcm_list_head, list)
+               snd_pcm_suspend_all(cpcm->pcm);
+
+       pm_runtime_force_suspend(hda_codec_dev(codec));
+       pm_runtime_disable(hda_codec_dev(codec));
+}
+
 /*
  * add standard channel maps if not specified
  */