Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752868AbbGOGe0 (ORCPT ); Wed, 15 Jul 2015 02:34:26 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:45920 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752779AbbGOGeY (ORCPT ); Wed, 15 Jul 2015 02:34:24 -0400 X-AuditID: cbfee61b-f79416d0000014c0-da-55a5feed7c11 From: Robert Baldyga To: gregkh@linuxfoundation.org, balbi@ti.com Cc: Peter.Chen@freescale.com, johnyoun@synopsys.com, dahlmann.thomas@arcor.de, nicolas.ferre@atmel.com, cernekee@gmail.com, leoli@freescale.com, daniel@zonque.org, haojian.zhuang@gmail.com, robert.jarzmik@free.fr, michal.simek@xilinx.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-geode@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, andrzej.p@samsung.com, m.szyprowski@samsung.com, Robert Baldyga Subject: [PATCH v3 09/46] usb: gadget: at91_udc: add ep capabilities support Date: Wed, 15 Jul 2015 08:31:56 +0200 Message-id: <1436941953-1327-10-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1436941953-1327-1-git-send-email-r.baldyga@samsung.com> References: <1436941953-1327-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42I5/e+xoO7bf0tDDTads7SY9bKdxeLg/XqL vQvuMlp03j/MbNH09xWLxZ4zv9gtmhevZ7O4sM7cYvfpS4wWvx4IWWx6fI3Vov/caRaLy7vm sFnMXtLPYrFoWSuzxe/v/1gt1h65y27x7mWExbfLzewWx2b/ZbJ4cHgnu8WsN8IOYh6Tn2xk 8ljwayuLx719h1k8+td9ZvX4d7ifyWPnrLvsHvvnrmH32Lyk3uP8jIWMHn1bVjF6bNn/mdHj +I3tTB6fN8l57P38m8Vj++7lLAH8UVw2Kak5mWWpRfp2CVwZew60Mxcc5qm41jiFpYFxAlcX IyeHhICJxP3Vf9kgbDGJC/fWA9lcHEIC0xkl/r/qYIZwfjJKTNp0gwWkik1AR2LL9wmMILYI kL3u7w6wDmaBtSwSt94sACsSFvCReNz3AsxmEVCVOLlhMZjNK+Aq8evKd1aIdXISJ49NBrM5 geLTe34xg9hCAi4ST3d9YJrAyLuAkWEVo2hqQXJBcVJ6rpFecWJucWleul5yfu4mRnAcPZPe wbiqweIQowAHoxIPb8OipaFCrIllxZW5hxglOJiVRHhnfwQK8aYkVlalFuXHF5XmpBYfYpTm YFES5z2Z7xMqJJCeWJKanZpakFoEk2Xi4JRqYDRsf7C7/cZRhW1WmbXMpquN+t5kqEo90mZP 1D6S+2i6/5awlynrzxyYJWZlqTLV4ETrxE+rHhjWhPR9b6pYcXGh2nV9yRk6W3Jba+ZeeWPI lK9ToDXn+uaez2Y8XfnTf794sPCDqUHsBVl736AfbcK3Z+5tdbT+u29pQq30cjXLqllbnwj3 hSmxFGckGmoxFxUnAgBnAmCfnwIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1786 Lines: 67 Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga --- drivers/usb/gadget/udc/at91_udc.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/drivers/usb/gadget/udc/at91_udc.c b/drivers/usb/gadget/udc/at91_udc.c index fc42264..a04b073 100644 --- a/drivers/usb/gadget/udc/at91_udc.c +++ b/drivers/usb/gadget/udc/at91_udc.c @@ -59,15 +59,29 @@ #define DRIVER_VERSION "3 May 2006" static const char driver_name [] = "at91_udc"; -static const char * const ep_names[] = { - "ep0", - "ep1", - "ep2", - "ep3-int", - "ep4", - "ep5", + +static const struct { + const char *name; + const struct usb_ep_caps caps; +} ep_info[] = { +#define EP_INFO(_name, _type, _dir) \ + { \ + .name = _name, \ + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ ## _type, \ + USB_EP_CAPS_DIR_ ## _dir), \ + } + + EP_INFO("ep0", CONTROL, ALL), + EP_INFO("ep1", ALL, ALL), + EP_INFO("ep2", ALL, ALL), + EP_INFO("ep3-int", INT, ALL), + EP_INFO("ep4", ALL, ALL), + EP_INFO("ep5", ALL, ALL), + +#undef EP_INFO }; -#define ep0name ep_names[0] + +#define ep0name ep_info[0].name #define VBUS_POLL_TIMEOUT msecs_to_jiffies(1000) @@ -1830,7 +1844,8 @@ static int at91udc_probe(struct platform_device *pdev) for (i = 0; i < NUM_ENDPOINTS; 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->udc = udc; ep->int_mask = BIT(i); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/