ALSA: hda: Suspend codec at shutdown
[sfrench/cifs-2.6.git] / sound / pci / hda / hda_codec.c
index 7a717e15115697987adb430568a626f69963346b..2c91c92c9ab229cdb51832c017fa24c8705ee404 100644 (file)
@@ -2981,6 +2981,20 @@ const struct dev_pm_ops hda_codec_driver_pm = {
                           NULL)
 };
 
                           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;
+
+       if (pm_runtime_suspended(hda_codec_dev(codec)))
+               return;
+
+       list_for_each_entry(cpcm, &codec->pcm_list_head, list)
+               snd_pcm_suspend_all(cpcm->pcm);
+
+       pm_runtime_suspend(hda_codec_dev(codec));
+}
+
 /*
  * add standard channel maps if not specified
  */
 /*
  * add standard channel maps if not specified
  */