mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
usb: gadget: function: f_fs: pass companion descriptor along
am: 5ce2e4ce4a
Change-Id: Id9a3ad5a46abd4c67239369f79a7f3bef4a6124e
This commit is contained in:
@@ -1833,11 +1833,14 @@ static int ffs_func_eps_enable(struct ffs_function *func)
|
||||
spin_lock_irqsave(&func->ffs->eps_lock, flags);
|
||||
do {
|
||||
struct usb_endpoint_descriptor *ds;
|
||||
struct usb_ss_ep_comp_descriptor *comp_desc = NULL;
|
||||
int needs_comp_desc = false;
|
||||
int desc_idx;
|
||||
|
||||
if (ffs->gadget->speed == USB_SPEED_SUPER)
|
||||
if (ffs->gadget->speed == USB_SPEED_SUPER) {
|
||||
desc_idx = 2;
|
||||
else if (ffs->gadget->speed == USB_SPEED_HIGH)
|
||||
needs_comp_desc = true;
|
||||
} else if (ffs->gadget->speed == USB_SPEED_HIGH)
|
||||
desc_idx = 1;
|
||||
else
|
||||
desc_idx = 0;
|
||||
@@ -1854,6 +1857,14 @@ static int ffs_func_eps_enable(struct ffs_function *func)
|
||||
|
||||
ep->ep->driver_data = ep;
|
||||
ep->ep->desc = ds;
|
||||
|
||||
comp_desc = (struct usb_ss_ep_comp_descriptor *)(ds +
|
||||
USB_DT_ENDPOINT_SIZE);
|
||||
ep->ep->maxburst = comp_desc->bMaxBurst + 1;
|
||||
|
||||
if (needs_comp_desc)
|
||||
ep->ep->comp_desc = comp_desc;
|
||||
|
||||
ret = usb_ep_enable(ep->ep);
|
||||
if (likely(!ret)) {
|
||||
epfile->ep = ep;
|
||||
|
||||
Reference in New Issue
Block a user