mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
usb: gadget: get ep mult and maxburst for rockchip superspeed
For Rockchip platforms, they may need to get the mult and maxburst of endpoints for USB superspeed gadget when bind USB functions (e.g. uvc_function_bind), then the USB DWC3 controller can do Tx fifos resize properly for each endpoints. Change-Id: I7baddbc0dc515c91d82ca4bc1960531919ed6008 Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
@@ -125,9 +125,24 @@ found_ep:
|
||||
ep->claimed = true;
|
||||
#ifdef CONFIG_ARCH_ROCKCHIP
|
||||
ep->transfer_type = type;
|
||||
if (type == USB_ENDPOINT_XFER_ISOC ||
|
||||
type == USB_ENDPOINT_XFER_INT)
|
||||
if (gadget_is_superspeed(gadget) && ep_comp) {
|
||||
switch (type) {
|
||||
case USB_ENDPOINT_XFER_ISOC:
|
||||
/* mult: bits 1:0 of bmAttributes */
|
||||
ep->mult = (ep_comp->bmAttributes & 0x3) + 1;
|
||||
/* fall through */
|
||||
case USB_ENDPOINT_XFER_BULK:
|
||||
case USB_ENDPOINT_XFER_INT:
|
||||
ep->maxburst = ep_comp->bMaxBurst + 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (gadget_is_dualspeed(gadget) &&
|
||||
(type == USB_ENDPOINT_XFER_ISOC ||
|
||||
type == USB_ENDPOINT_XFER_INT)) {
|
||||
ep->mult = usb_endpoint_maxp_mult(desc);
|
||||
}
|
||||
#endif
|
||||
return ep;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user