Commit b9ed96d7 authored by Robert Baldyga's avatar Robert Baldyga Committed by Felipe Balbi

usb: gadget: at91_udc: add ep capabilities support

Convert endpoint configuration to new capabilities model.
Signed-off-by: default avatarRobert Baldyga <r.baldyga@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 6f02ac5a
...@@ -59,15 +59,34 @@ ...@@ -59,15 +59,34 @@
#define DRIVER_VERSION "3 May 2006" #define DRIVER_VERSION "3 May 2006"
static const char driver_name [] = "at91_udc"; static const char driver_name [] = "at91_udc";
static const char * const ep_names[] = {
"ep0", static const struct {
"ep1", const char *name;
"ep2", const struct usb_ep_caps caps;
"ep3-int", } ep_info[] = {
"ep4", #define EP_INFO(_name, _caps) \
"ep5", { \
.name = _name, \
.caps = _caps, \
}
EP_INFO("ep0",
USB_EP_CAPS(USB_EP_CAPS_TYPE_CONTROL, USB_EP_CAPS_DIR_ALL)),
EP_INFO("ep1",
USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_ALL)),
EP_INFO("ep2",
USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_ALL)),
EP_INFO("ep3-int",
USB_EP_CAPS(USB_EP_CAPS_TYPE_INT, USB_EP_CAPS_DIR_ALL)),
EP_INFO("ep4",
USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_ALL)),
EP_INFO("ep5",
USB_EP_CAPS(USB_EP_CAPS_TYPE_ALL, USB_EP_CAPS_DIR_ALL)),
#undef EP_INFO
}; };
#define ep0name ep_names[0]
#define ep0name ep_info[0].name
#define VBUS_POLL_TIMEOUT msecs_to_jiffies(1000) #define VBUS_POLL_TIMEOUT msecs_to_jiffies(1000)
...@@ -1831,7 +1850,8 @@ static int at91udc_probe(struct platform_device *pdev) ...@@ -1831,7 +1850,8 @@ static int at91udc_probe(struct platform_device *pdev)
for (i = 0; i < NUM_ENDPOINTS; i++) { for (i = 0; i < NUM_ENDPOINTS; i++) {
ep = &udc->ep[i]; ep = &udc->ep[i];
ep->ep.name = ep_names[i]; ep->ep.name = ep_info[i].name;
ep->ep.caps = ep_info[i].caps;
ep->ep.ops = &at91_ep_ops; ep->ep.ops = &at91_ep_ops;
ep->udc = udc; ep->udc = udc;
ep->int_mask = BIT(i); ep->int_mask = BIT(i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment