Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753877AbbGaOCh (ORCPT ); Fri, 31 Jul 2015 10:02:37 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:46099 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752488AbbGaOCc (ORCPT ); Fri, 31 Jul 2015 10:02:32 -0400 X-AuditID: cbfee61a-f79a06d000005c6f-5b-55bb7ff66504 From: Robert Baldyga To: balbi@ti.com Cc: gregkh@linuxfoundation.org, 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, stern@rowland.harvard.edu, petr.cvek@tul.cz, Robert Baldyga Subject: [PATCH v5 10/46] usb: gadget: bcm63xx_udc: add ep capabilities support Date: Fri, 31 Jul 2015 16:00:22 +0200 Message-id: <1438351258-31578-11-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1438351258-31578-1-git-send-email-r.baldyga@samsung.com> References: <1438351258-31578-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRmVeSWpSXmKPExsVy+t9jAd1v9btDDX490LCY9bKdxeLg/XqL vQvuMlp03j/MbNH09xWLxZ4zv9gtmhevZ7O4sM7cYvfpS4wWvx4IWWx6fI3Vov/caRaLy7vm sFnMXtLPYrFoWSuzxe/v/1gt1h65y27x7mWExbfLzewWx2b/ZbKY3zGV1eLB4Z3sFrPeCFtM +H2BzUHCY/KTjUweC35tZfG4t+8wi0f/us+sHv8O9zN57Jx1l91j/9w17B6bl9R7nJ+xkNFj 9t0fjB59W1YxemzZ/5nR4/iN7UweM1f2snl83iTnsffzb5YAwSgum5TUnMyy1CJ9uwSujPsX bzIXTOOreLLxI0sDYwtPFyMnh4SAiUTz2xksELaYxIV769m6GLk4hASWMkpc33yJFcL5CeR0 XmAFqWIT0JHY8n0CI4gtIiAgsf7FJXaQImaBHywSZ+d1s4MkhAX8JVrWT2QDsVkEVCXurGtj ArF5Bdwkvh9cwwqxTk7i5LHJYDYnUPzr+rNgvUICrhJHjp1insDIu4CRYRWjRGpBckFxUnqu YV5quV5xYm5xaV66XnJ+7iZGcKw9k9rBeHCX+yFGAQ5GJR5egcW7QoVYE8uKK3MPMUpwMCuJ 8N5X2x0qxJuSWFmVWpQfX1Sak1p8iFGag0VJnFd2w+ZQIYH0xJLU7NTUgtQimCwTB6dUA2Nl 1EN3mWUMYluFGrXeRJ7i2vWGZ8WRhfsenY96/GeVVOrVgw8fLfLgXPL1SdjFwknTpW+dOaP3 R3Q9r1nPxYUHz58Q+9PdtPlI2h+tC+WLLpgIXFQs6Xp/NYj//DfbvSIbvAyM9C895Kv3/Gbf NjF1jtz+MKtlBxZvj2d/J+1UzH6xyNomUtVNiaU4I9FQi7moOBEAP9nxXbECAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2002 Lines: 62 Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga --- drivers/usb/gadget/udc/bcm63xx_udc.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c index 9db968b..8cbb003 100644 --- a/drivers/usb/gadget/udc/bcm63xx_udc.c +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c @@ -44,9 +44,29 @@ #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); -- 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/