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>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------6CA4512BEC3D78A4FFAB7C48 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------6CA4512BEC3D78A4FFAB7C48 Content-Type: text/x-patch; name="dwc_otg.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dwc_otg.diff" 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) --------------6CA4512BEC3D78A4FFAB7C48--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b6dd5aba-bde0-c2c5-103b-b814bc9579ea>