summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2016-10-06 17:10:39 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-11-03 11:38:32 +0300
commit58f29034b4c47b202f76de055f843316c8a9325f (patch)
tree5b5b559dee4f0b44b1f99eea3f73e1bda35c58ad /drivers/usb/dwc3
parentb9bd138e06b931a4f668776fbf6d82e5ec8417b5 (diff)
downloadlinux-58f29034b4c47b202f76de055f843316c8a9325f.tar.xz
usb: dwc3: gadget: CSP is only valid for OUT endpoints
CSP bit is only valid for OUT endpoints. Synopsys databook is unclear if HW ignores CSP for IN endpoints (chances are, it does) but to avoid problems, let's make sure to set CSP only when valid to do so. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/gadget.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 2dfcbecec25c..270e837f16e0 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -875,7 +875,8 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
}
/* always enable Continue on Short Packet */
- trb->ctrl |= DWC3_TRB_CTRL_CSP;
+ if (usb_endpoint_dir_out(dep->endpoint.desc))
+ trb->ctrl |= DWC3_TRB_CTRL_CSP;
if ((!req->request.no_interrupt && !chain) ||
(dwc3_calc_trbs_left(dep) == 0))