Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752966AbbGOGel (ORCPT ); Wed, 15 Jul 2015 02:34:41 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:33702 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752897AbbGOGeh (ORCPT ); Wed, 15 Jul 2015 02:34:37 -0400 X-AuditID: cbfee61b-f79416d0000014c0-e9-55a5fef487af 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 10/46] usb: gadget: bcm63xx_udc: add ep capabilities support Date: Wed, 15 Jul 2015 08:31:57 +0200 Message-id: <1436941953-1327-11-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+xoO7Xf0tDDZ6tZraY9bKdxeLg/XqL vQvuMlp03j/MbNH09xWLxZ4zv9gtmhevZ7O4sM7cYvfpS4wWvx4IWWx6fI3Vov/caRaLy7vm sFnMXtLPYrFoWSuzxe/v/1gt1h65y27x7mWExbfLzewWx2b/ZbJ4cHgnu8WsN8IOYh6Tn2xk 8ljwayuLx719h1k8+td9ZvX4d7ifyWPnrLvsHvvnrmH32Lyk3uP8jIWMHn1bVjF6bNn/mdHj +I3tTB6fN8l57P38m8Vj++7lLAH8UVw2Kak5mWWpRfp2CVwZ/1q6mAoe8VQ0bL7A3sB4mauL kZNDQsBEYs2etUwQtpjEhXvr2boYuTiEBKYzSixf1gTl/GSU2PV6DTNIFZuAjsSW7xMYQWwR IHvd3x1gRcwCa1kkbr1ZwAKSEBbwl1i14CtYEYuAqsStTa/YQWxeAVeJVb9+s0Gsk5M4eWwy K4jNCRSf3vMLbIGQgIvE010fmCYw8i5gZFjFKJpakFxQnJSea6RXnJhbXJqXrpecn7uJERxH z6R3MK5qsDjEKMDBqMTD27BoaagQa2JZcWXuIUYJDmYlEd7ZH4FCvCmJlVWpRfnxRaU5qcWH GKU5WJTEeU/m+4QKCaQnlqRmp6YWpBbBZJk4OKUaGBXvZDQWLJvnbZj5QOFfT4Myq2Gzj0c8 X/K0Qu/vRs5LqiYn3bEW/vL1YWXi+gW557vLDl7TC9PfpKa33etvbPtXT49jqausMnhv/Z31 bKbX3PvSbZPXqfxi1JgaLxH3Lk2uV/pKNeu54kIT2WtZczecmpDTZZ/FEHP4xofUFkX9L3JF aw9fVWIpzkg01GIuKk4EAPanN9SfAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1826 Lines: 58 Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga --- drivers/usb/gadget/udc/bcm63xx_udc.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c index 9db968b..c5e0894 100644 --- a/drivers/usb/gadget/udc/bcm63xx_udc.c +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c @@ -44,9 +44,25 @@ #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, _type, _dir) \ + { \ + .name = _name, \ + .caps = USB_EP_CAPS(USB_EP_CAPS_TYPE_ ## _type, \ + USB_EP_CAPS_DIR_ ## _dir), \ + } + + EP_INFO(bcm63xx_ep0name, CONTROL, ALL), + EP_INFO("ep1in-bulk", BULK, IN), + EP_INFO("ep2out-bulk", BULK, OUT), + EP_INFO("ep3in-int", INT, IN), + EP_INFO("ep4out-int", INT, OUT), + +#undef EP_INFO }; static bool use_fullspeed; @@ -943,7 +959,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); -- 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/