Skip to content

Commit

Permalink
usb: gadget: dwc2_udc_otg: modified the check condition for max packe…
Browse files Browse the repository at this point in the history
…t size of ep_in in high speed

In current high speed fastboot, fs_ep_in.wMaxPacketSize is configured 64 bytes
as default, as a result, it failed to match the size at initialization stage in
usb controller.
Actually, hardware can support less than or equal to 512 bytes in high speed mode,
so I changed the condition from  '!=' to '>' to fix this issue.

Signed-off-by: Frank Wang <[email protected]>
Tested-by: Steve Rae <[email protected]>
  • Loading branch information
Frank Wang authored and Marek Vasut committed Feb 4, 2016
1 parent 44189a0 commit 8c9b4d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/gadget/dwc2_udc_otg.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,8 @@ static int dwc2_ep_enable(struct usb_ep *_ep,
}

/* hardware _could_ do smaller, but driver doesn't */
if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK
&& le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) !=
if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK &&
le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) >
ep_maxpacket(ep)) || !get_unaligned(&desc->wMaxPacketSize)) {

debug("%s: bad %s maxpacket\n", __func__, _ep->name);
Expand Down

0 comments on commit 8c9b4d5

Please sign in to comment.