Page MenuHomeFreeBSD

D50306.diff
No OneTemporary

D50306.diff

diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c
--- a/sys/dev/sound/pci/hda/hdac.c
+++ b/sys/dev/sound/pci/hda/hdac.c
@@ -1638,6 +1638,35 @@
sizeof(sc->dev), sysctl_hdac_polling, "I", "Enable polling mode");
}
+/****************************************************************************
+ * int hdac_shutdown(device_t)
+ *
+ * Power down HDA bus and codecs.
+ ****************************************************************************/
+static int
+hdac_shutdown(device_t dev)
+{
+ struct hdac_softc *sc = device_get_softc(dev);
+
+ HDA_BOOTHVERBOSE(
+ device_printf(dev, "Shutdown...\n");
+ );
+ callout_drain(&sc->poll_callout);
+ taskqueue_drain(taskqueue_thread, &sc->unsolq_task);
+ bus_generic_shutdown(dev);
+
+ hdac_lock(sc);
+ HDA_BOOTHVERBOSE(
+ device_printf(dev, "Reset controller...\n");
+ );
+ hdac_reset(sc, false);
+ hdac_unlock(sc);
+ HDA_BOOTHVERBOSE(
+ device_printf(dev, "Shutdown done\n");
+ );
+ return (0);
+}
+
/****************************************************************************
* int hdac_suspend(device_t)
*
@@ -2148,6 +2177,7 @@
DEVMETHOD(device_probe, hdac_probe),
DEVMETHOD(device_attach, hdac_attach),
DEVMETHOD(device_detach, hdac_detach),
+ DEVMETHOD(device_shutdown, hdac_shutdown),
DEVMETHOD(device_suspend, hdac_suspend),
DEVMETHOD(device_resume, hdac_resume),
/* Bus interface */

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 28, 8:19 AM (9 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26278338
Default Alt Text
D50306.diff (1 KB)

Event Timeline