diff options
author | Chanho Park <chanho61.park@samsung.com> | 2012-08-31 09:54:07 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-08-31 11:31:40 +0200 |
commit | d2e9a13a388304bc2a7b25a6c34c6e2ab1540a5d (patch) | |
tree | aedb63453beb03b021b1640de822c4c7e6932bb5 /drivers/usb/dwc3/gadget.c | |
parent | usb: dwc3: core: memory ordering fix in close (diff) | |
download | linux-d2e9a13a388304bc2a7b25a6c34c6e2ab1540a5d.tar.xz linux-d2e9a13a388304bc2a7b25a6c34c6e2ab1540a5d.zip |
usb: dwc3: set up burst size only superspeed mode
When connection is established non-ss mode, endpoint.maxburst is correctly set
to 0, this means that current code will set maxburst bitfield on DEPCFG's
parameter 0 to the highest possible value (0x0f) which is wrong.
Even though this hasn't caused any issues so far (HW seems to ignore that when
not running in SS mode) we want to make sure maxburst bitfield is only set to
anything other than zero if we're running on SuperSpeed mode. In order to
achieve that, let's check for gadget's operating speed before setting maxburst
bitfield when issuing DEPCFG command.
[ balbi@ti.com : improved commit log a bit in order to clarify the situation ]
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 029cf0651564..ba444e7f9c44 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -439,8 +439,14 @@ static int dwc3_gadget_set_ep_config(struct dwc3 *dwc, struct dwc3_ep *dep, memset(¶ms, 0x00, sizeof(params)); params.param0 = DWC3_DEPCFG_EP_TYPE(usb_endpoint_type(desc)) - | DWC3_DEPCFG_MAX_PACKET_SIZE(usb_endpoint_maxp(desc)) - | DWC3_DEPCFG_BURST_SIZE(dep->endpoint.maxburst - 1); + | DWC3_DEPCFG_MAX_PACKET_SIZE(usb_endpoint_maxp(desc)); + + /* Burst size is only needed in SuperSpeed mode */ + if (dwc->gadget.speed == USB_SPEED_SUPER) { + u32 burst = dep->endpoint.maxburst - 1; + + params.param0 |= DWC3_DEPCFG_BURST_SIZE(burst); + } if (ignore) params.param0 |= DWC3_DEPCFG_IGN_SEQ_NUM; |