diff options
author | Felipe Balbi <balbi@ti.com> | 2015-11-16 16:20:34 -0600 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-12-15 09:12:41 -0600 |
commit | b5d335e5ea6a60f5254c1f3d5fddd47f4531bccf (patch) | |
tree | 5ae922db25fb3bd3c5dab47789506aa562c83408 /drivers/usb/dwc3/ep0.c | |
parent | ac7bdcc1b3ad042d21bc65e57503d7b41fc69f05 (diff) | |
download | linux-b5d335e5ea6a60f5254c1f3d5fddd47f4531bccf.tar.gz linux-b5d335e5ea6a60f5254c1f3d5fddd47f4531bccf.tar.bz2 linux-b5d335e5ea6a60f5254c1f3d5fddd47f4531bccf.zip |
usb: dwc3: ep0: fix setup_packet_pending initialization
It just ocurred to me that dwc3 already gives a
really hint of when a setup packet is pending and
that's the SETUP_PENDING TRB Status for EP0 IRQs.
Fix setup_packet_pending initialization based on
that. While at that, also make sure the comment in
gadget.c matches what code is doing.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/ep0.c')
-rw-r--r-- | drivers/usb/dwc3/ep0.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 3ea2bda0bd4d..3a9354abcb68 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -817,6 +817,8 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc, status = DWC3_TRB_SIZE_TRBSTS(trb->size); if (status == DWC3_TRBSTS_SETUP_PENDING) { + dwc->setup_packet_pending = true; + dwc3_trace(trace_dwc3_ep0, "Setup Pending received"); if (r) @@ -916,8 +918,10 @@ static void dwc3_ep0_complete_status(struct dwc3 *dwc, } status = DWC3_TRB_SIZE_TRBSTS(trb->size); - if (status == DWC3_TRBSTS_SETUP_PENDING) + if (status == DWC3_TRBSTS_SETUP_PENDING) { + dwc->setup_packet_pending = true; dwc3_trace(trace_dwc3_ep0, "Setup Pending received"); + } dwc->ep0state = EP0_SETUP_PHASE; dwc3_ep0_out_start(dwc); @@ -1063,8 +1067,6 @@ static void dwc3_ep0_end_control_data(struct dwc3 *dwc, struct dwc3_ep *dep) static void dwc3_ep0_xfernotready(struct dwc3 *dwc, const struct dwc3_event_depevt *event) { - dwc->setup_packet_pending = true; - switch (event->status) { case DEPEVT_STATUS_CONTROL_DATA: dwc3_trace(trace_dwc3_ep0, "Control Data"); |