Date: Thu, 30 Jun 2016 22:59:46 +0200 From: Hans Petter Selasky <hps@selasky.org> To: "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>, =?UTF-8?Q?Edward_Tomasz_Napiera=c5=82a?= <trasz@FreeBSD.org> Subject: DWC OTG patch to test Message-ID: <b6dd5aba-bde0-c2c5-103b-b814bc9579ea@selasky.org>
index | next in thread | raw e-mail
[-- Attachment #1 --] Hi, The attached patch should fix detection of USB detach, if you connect a USB device directly to the RPI, not via the built-in USB HUB, for example using RPI-zero. If you have a RPI-zero running FreeBSD - please test. --HPS [-- Attachment #2 --] Index: sys/dev/usb/controller/dwc_otg.c =================================================================== --- sys/dev/usb/controller/dwc_otg.c (revision 300199) +++ sys/dev/usb/controller/dwc_otg.c (working copy) @@ -2985,7 +2985,8 @@ else sc->sc_flags.status_bus_reset = 0; - if (hprt & HPRT_PRTENCHNG) + if ((hprt & HPRT_PRTENCHNG) && + (hprt & HPRT_PRTENA) == 0) sc->sc_flags.change_enabled = 1; if (hprt & HPRT_PRTENA) @@ -4745,6 +4746,8 @@ value = 0; + if (sc->sc_flags.change_enabled) + value |= UPS_C_PORT_ENABLED; if (sc->sc_flags.change_connect) value |= UPS_C_CONNECT_STATUS; if (sc->sc_flags.change_suspend)help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b6dd5aba-bde0-c2c5-103b-b814bc9579ea>
