mirror of https://gitee.com/openkylin/linux.git
usb: gadget: mv_udc_core: add ep capabilities support
Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
c12a30629f
commit
43710a8dba
|
@ -1257,6 +1257,9 @@ static int eps_init(struct mv_udc *udc)
|
||||||
ep->wedge = 0;
|
ep->wedge = 0;
|
||||||
ep->stopped = 0;
|
ep->stopped = 0;
|
||||||
usb_ep_set_maxpacket_limit(&ep->ep, EP0_MAX_PKT_SIZE);
|
usb_ep_set_maxpacket_limit(&ep->ep, EP0_MAX_PKT_SIZE);
|
||||||
|
ep->ep.caps.type_control = true;
|
||||||
|
ep->ep.caps.dir_in = true;
|
||||||
|
ep->ep.caps.dir_out = true;
|
||||||
ep->ep_num = 0;
|
ep->ep_num = 0;
|
||||||
ep->ep.desc = &mv_ep0_desc;
|
ep->ep.desc = &mv_ep0_desc;
|
||||||
INIT_LIST_HEAD(&ep->queue);
|
INIT_LIST_HEAD(&ep->queue);
|
||||||
|
@ -1269,14 +1272,20 @@ static int eps_init(struct mv_udc *udc)
|
||||||
if (i % 2) {
|
if (i % 2) {
|
||||||
snprintf(name, sizeof(name), "ep%din", i / 2);
|
snprintf(name, sizeof(name), "ep%din", i / 2);
|
||||||
ep->direction = EP_DIR_IN;
|
ep->direction = EP_DIR_IN;
|
||||||
|
ep->ep.caps.dir_in = true;
|
||||||
} else {
|
} else {
|
||||||
snprintf(name, sizeof(name), "ep%dout", i / 2);
|
snprintf(name, sizeof(name), "ep%dout", i / 2);
|
||||||
ep->direction = EP_DIR_OUT;
|
ep->direction = EP_DIR_OUT;
|
||||||
|
ep->ep.caps.dir_out = true;
|
||||||
}
|
}
|
||||||
ep->udc = udc;
|
ep->udc = udc;
|
||||||
strncpy(ep->name, name, sizeof(ep->name));
|
strncpy(ep->name, name, sizeof(ep->name));
|
||||||
ep->ep.name = ep->name;
|
ep->ep.name = ep->name;
|
||||||
|
|
||||||
|
ep->ep.caps.type_iso = true;
|
||||||
|
ep->ep.caps.type_bulk = true;
|
||||||
|
ep->ep.caps.type_int = true;
|
||||||
|
|
||||||
ep->ep.ops = &mv_ep_ops;
|
ep->ep.ops = &mv_ep_ops;
|
||||||
ep->stopped = 0;
|
ep->stopped = 0;
|
||||||
usb_ep_set_maxpacket_limit(&ep->ep, (unsigned short) ~0);
|
usb_ep_set_maxpacket_limit(&ep->ep, (unsigned short) ~0);
|
||||||
|
|
Loading…
Reference in New Issue