usb: gadget: bcm63xx_udc: add ep capabilities support
authorRobert Baldyga <r.baldyga@samsung.com>
Fri, 31 Jul 2015 14:00:22 +0000 (16:00 +0200)
committerFelipe Balbi <balbi@ti.com>
Tue, 4 Aug 2015 17:26:39 +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/bcm63xx_udc.c

index 9db968ba39f54aec7f102a2948ec00cc326094c6..8cbb00325824a480b9c5558202cb74d55e9d81b8 100644 (file)
 #define DRV_MODULE_NAME                "bcm63xx_udc"
 
 static const char bcm63xx_ep0name[] = "ep0";
-static const char *const bcm63xx_ep_name[] = {
-       bcm63xx_ep0name,
-       "ep1in-bulk", "ep2out-bulk", "ep3in-int", "ep4out-int",
+
+static const struct {
+       const char *name;
+       const struct usb_ep_caps caps;
+} bcm63xx_ep_info[] = {
+#define EP_INFO(_name, _caps) \
+       { \
+               .name = _name, \
+               .caps = _caps, \
+       }
+
+       EP_INFO(bcm63xx_ep0name,
+               USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL, USB_EP_CAPS_DIR_ALL)),
+       EP_INFO("ep1in-bulk",
+               USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_IN)),
+       EP_INFO("ep2out-bulk",
+               USB_EP_CAPS(USB_EP_CAPS_TYPE_BULK, USB_EP_CAPS_DIR_OUT)),
+       EP_INFO("ep3in-int",
+               USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_IN)),
+       EP_INFO("ep4out-int",
+               USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_OUT)),
+
+#undef EP_INFO
 };
 
 static bool use_fullspeed;
@@ -943,7 +963,8 @@ static int bcm63xx_init_udc_hw(struct bcm63xx_udc *udc)
        for (i = 0; i < BCM63XX_NUM_EP; i++) {
                struct bcm63xx_ep *bep = &udc->bep[i];
 
-               bep->ep.name = bcm63xx_ep_name[i];
+               bep->ep.name = bcm63xx_ep_info[i].name;
+               bep->ep.caps = bcm63xx_ep_info[i].caps;
                bep->ep_num = i;
                bep->ep.ops = &bcm63xx_udc_ep_ops;
                list_add_tail(&bep->ep.ep_list, &udc->gadget.ep_list);