usb: gadget: omap_udc: add ep capabilities support
authorRobert Baldyga <r.baldyga@samsung.com>
Fri, 31 Jul 2015 14:00:37 +0000 (16:00 +0200)
committerFelipe Balbi <balbi@ti.com>
Tue, 4 Aug 2015 17:26:50 +0000 (12:26 -0500)
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc/omap_udc.c

index e2fcdb8e55961fa3fee8093f55566e6271d41be1..9b7d39484ed3afa55c95a254379b995341bc7ad4 100644 (file)
@@ -2579,6 +2579,28 @@ omap_ep_setup(char *name, u8 addr, u8 type,
        ep->double_buf = dbuf;
        ep->udc = udc;
 
+       switch (type) {
+       case USB_ENDPOINT_XFER_CONTROL:
+               ep->ep.caps.type_control = true;
+               ep->ep.caps.dir_in = true;
+               ep->ep.caps.dir_out = true;
+               break;
+       case USB_ENDPOINT_XFER_ISOC:
+               ep->ep.caps.type_iso = true;
+               break;
+       case USB_ENDPOINT_XFER_BULK:
+               ep->ep.caps.type_bulk = true;
+               break;
+       case USB_ENDPOINT_XFER_INT:
+               ep->ep.caps.type_int = true;
+               break;
+       };
+
+       if (addr & USB_DIR_IN)
+               ep->ep.caps.dir_in = true;
+       else
+               ep->ep.caps.dir_out = true;
+
        ep->ep.name = ep->name;
        ep->ep.ops = &omap_ep_ops;
        ep->maxpacket = maxp;