summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2014-08-25 14:02:15 -0600
committerMarek Vasut <marex@denx.de>2014-09-02 14:29:28 +0200
commit842ef9a98ef8643df87d3ae5664802cd5db2bca0 (patch)
tree1cee8587565fbcc7679e43078cef0746d16622c3
parentf2ec4e34aa55c3d5553b69e8f6e7df140f3ef48a (diff)
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 <swarren@nvidia.com>
-rw-r--r--drivers/usb/gadget/ci_udc.c7
1 files changed, 7 insertions, 0 deletions
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);
+}