X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fcifs-2.6.git;a=blobdiff_plain;f=sound%2Fpci%2Fhda%2Fhda_codec.c;fp=sound%2Fpci%2Fhda%2Fhda_codec.c;h=2c91c92c9ab229cdb51832c017fa24c8705ee404;hp=7a717e15115697987adb430568a626f69963346b;hb=b98444ed597dc42be620bcac241c93da50933e69;hpb=95dc85dba05fa8f84c6db5fee3990fa4dd9fb499 diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 7a717e151156..2c91c92c9ab2 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -2981,6 +2981,20 @@ 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; + + 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 */