summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-08-30 16:48:08 +0400
committerFelipe Balbi <balbi@ti.com>2011-09-09 14:02:17 +0400
commit0b7836a9eb32f626ffd3fe3045e8c618cb8ed965 (patch)
tree4b78a357ffbebab238e182a1de12efb8cf9b6e05 /drivers/usb/dwc3/gadget.c
parent76cb323f80ac32833109e2c089842be2b99d8d2b (diff)
downloadlinux-0b7836a9eb32f626ffd3fe3045e8c618cb8ed965.tar.xz
usb: dwc3: drop EP0_STALL state
Whenever we issue a Set Stall command on EP0, the state machine will be restarted and Stall is cleared automatically, when core receives the next SETUP packet. There's no need to track that EP0_STALL state. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index b5d95f8329f2..0c934a195deb 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -872,8 +872,14 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value)
memset(&params, 0x00, sizeof(params));
if (value) {
- if (dep->number == 0 || dep->number == 1)
- dwc->ep0state = EP0_STALL;
+ if (dep->number == 0 || dep->number == 1) {
+ /*
+ * Whenever EP0 is stalled, we will restart
+ * the state machine, thus moving back to
+ * Setup Phase
+ */
+ dwc->ep0state = EP0_SETUP_PHASE;
+ }
ret = dwc3_send_gadget_ep_cmd(dwc, dep->number,
DWC3_DEPCMD_SETSTALL, &params);