summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller/dwc_otg.c
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2016-07-11 12:59:23 +0000
committerhselasky <hselasky@FreeBSD.org>2016-07-11 12:59:23 +0000
commit2226cca8533f6c66270fd509babdbc4b90ea8ea8 (patch)
treec76274aeeb770b86649944873d36e26d91fc20ab /sys/dev/usb/controller/dwc_otg.c
parent50c1900a1a44a7d903f52b161322f75198cdf20e (diff)
downloadFreeBSD-src-2226cca8533f6c66270fd509babdbc4b90ea8ea8.zip
FreeBSD-src-2226cca8533f6c66270fd509babdbc4b90ea8ea8.tar.gz
MFC r302306:
Fix detection of USB device disconnects in USB host mode when the USB device is connected directly to the USB port of the DWC OTG, in this case a RPI-zero. PR: 210695
Diffstat (limited to 'sys/dev/usb/controller/dwc_otg.c')
-rw-r--r--sys/dev/usb/controller/dwc_otg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/usb/controller/dwc_otg.c b/sys/dev/usb/controller/dwc_otg.c
index 97fc70f..42b7f2a 100644
--- a/sys/dev/usb/controller/dwc_otg.c
+++ b/sys/dev/usb/controller/dwc_otg.c
@@ -2981,7 +2981,8 @@ dwc_otg_interrupt(void *arg)
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)
@@ -4741,6 +4742,8 @@ tr_handle_get_port_status:
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)
OpenPOWER on IntegriCloud