DWC OTG patch to test
Edward Tomasz Napierała
trasz at FreeBSD.org
Fri Jul 1 07:20:47 UTC 2016
Works perfectly, thanks!
On 0630T2259, Hans Petter Selasky wrote:
> 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
> 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)
More information about the freebsd-arm
mailing list