From 4fb3e77b9ed7c15bed28dfaff2062db1ce85f86b Mon Sep 17 00:00:00 2001 From: Sherry Sun Date: Mon, 9 Sep 2019 17:14:16 -0400 Subject: [PATCH] MLK-22577-2: usb: cdns3: Change the max packetsize of interrupt endpoint When use ep1out interrupt endpoint to receive data in sdp, the max packetsize of ep1out is set to 1024. But in cdns3 gadget driver, the max packetsize is limited to 512 bytes in high speed. So we can't implement data download through ep1out of cdns3 driver, here need change the max packesize of interrupt endpoints to 1024. Signed-off-by: Sherry Sun Reviewed-by: Ye Li (cherry picked from commit 17f321b4a32cfaac52339172dc354729e641451a) --- drivers/usb/cdns3/gadget.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c index 0a439c666f..1b00155ab2 100644 --- a/drivers/usb/cdns3/gadget.c +++ b/drivers/usb/cdns3/gadget.c @@ -1392,6 +1392,8 @@ static void cdns_ep_config(struct usb_ss_endpoint *usb_ss_ep) u32 bEndpointAddress = usb_ss_ep->num | usb_ss_ep->dir; u32 interrupt_mask = 0; bool is_iso_ep = (usb_ss_ep->type == USB_ENDPOINT_XFER_ISOC); + __maybe_unused bool is_int_ep = + (usb_ss_ep->type == USB_ENDPOINT_XFER_INT); dev_dbg(&usb_ss->dev, "%s: %s addr=0x%x, speed %d, is_iso_ep %d\n", __func__, usb_ss_ep->name, bEndpointAddress, usb_ss->gadget.speed, is_iso_ep); @@ -1422,6 +1424,10 @@ static void cdns_ep_config(struct usb_ss_endpoint *usb_ss_ep) max_packet_size = (is_iso_ep ? ENDPOINT_MAX_PACKET_SIZE_1024 : ENDPOINT_MAX_PACKET_SIZE_512); +#if defined(CONFIG_SPL_USB_SDP_SUPPORT) || defined(CONFIG_USB_FUNCTION_SDP) + if (is_int_ep) + max_packet_size = ENDPOINT_MAX_PACKET_SIZE_1024; +#endif break; case USB_SPEED_WIRELESS: -- 2.17.1