From: Stephen Warren Date: Mon, 25 Aug 2014 20:02:15 +0000 (-0600) Subject: usb: ci_udc: implement dfu_usb_get_reset X-Git-Tag: v2025.01-rc5-pxa1908~14717^2~2 X-Git-Url: http://git.dujemihanovic.xyz/img/static/%7B%7B%20%24.Site.BaseURL%20%7D%7Dposts/index.xml?a=commitdiff_plain;h=842ef9a98ef8643df87d3ae5664802cd5db2bca0;p=u-boot.git usb: ci_udc: implement dfu_usb_get_reset This allows the USB code to determine whether a USB bus reset was issued, which in turn allows the code to differentiate between a detach (return to shell prompt) and a board reset/reboot request. Signed-off-by: Stephen Warren --- diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c index 4cd19c3afd..2572b346eb 100644 --- a/drivers/usb/gadget/ci_udc.c +++ b/drivers/usb/gadget/ci_udc.c @@ -919,3 +919,10 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) return 0; } + +bool dfu_usb_get_reset(void) +{ + struct ci_udc *udc = (struct ci_udc *)controller.ctrl->hcor; + + return !!(readl(&udc->usbsts) & STS_URI); +}