Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb uaudio: don't block suspend.



details:   https://anonhg.NetBSD.org/src/rev/fc06fbabdf02
branches:  trunk
changeset: 355339:fc06fbabdf02
user:      maya <maya%NetBSD.org@localhost>
date:      Wed Jul 26 07:45:05 2017 +0000

description:
uaudio: don't block suspend.

audio after resume hasn't been fully tested due to other issues, but
the problem machine resumes. tested by Ricardo Mottola

diffstat:

 sys/dev/usb/uaudio.c |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 1c2f3032ee5f -r fc06fbabdf02 sys/dev/usb/uaudio.c
--- a/sys/dev/usb/uaudio.c      Wed Jul 26 07:39:54 2017 +0000
+++ b/sys/dev/usb/uaudio.c      Wed Jul 26 07:45:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uaudio.c,v 1.154 2017/06/09 10:11:20 nat Exp $ */
+/*     $NetBSD: uaudio.c,v 1.155 2017/07/26 07:45:05 maya Exp $        */
 
 /*
  * Copyright (c) 1999, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.154 2017/06/09 10:11:20 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.155 2017/07/26 07:45:05 maya Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -504,6 +504,9 @@
        DPRINTF("%s", "doing audio_attach_mi\n");
        sc->sc_audiodev = audio_attach_mi(&uaudio_hw_if, sc, sc->sc_dev);
 
+       if (!pmf_device_register(self, NULL, NULL))
+               aprint_error_dev(self, "couldn't establish power handler\n");
+
        return;
 }
 
@@ -534,9 +537,10 @@
 uaudio_detach(device_t self, int flags)
 {
        struct uaudio_softc *sc = device_private(self);
-       int rv;
-
-       rv = 0;
+       int rv = 0;
+
+       pmf_device_deregister(self);
+
        /* Wait for outstanding requests to complete. */
        usbd_delay_ms(sc->sc_udev, UAUDIO_NCHANBUFS * UAUDIO_NFRAMES);
 



Home | Main Index | Thread Index | Old Index