[U-Boot] [PATCH 1/2] usb: gadget: s3c_udc_otg: fixed max packet size check for ep_in in high speed

Frank Wang frank.wang at rock-chips.com
Fri Dec 4 10:36:33 CET 2015


In current fastboot frame, both full and high speed use 'fs_ep_in',
but fs_ep_in.wMaxPacketSize is configurated 64 bytes as default,
I do not understand why high speed TX max packet size is also set as
64 bytes, so I changed the condition from  '!=' to '>' as a workaround.

Signed-off-by: Frank Wang <frank.wang at rock-chips.com>
---
 drivers/usb/gadget/s3c_udc_otg.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c
index 7a2d1e7..b2d3988 100644
--- a/drivers/usb/gadget/s3c_udc_otg.c
+++ b/drivers/usb/gadget/s3c_udc_otg.c
@@ -556,8 +556,8 @@ static int s3c_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);
-- 
1.7.9.5




More information about the U-Boot mailing list