Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754327AbbGaOEr (ORCPT ); Fri, 31 Jul 2015 10:04:47 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:49508 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754252AbbGaOEn (ORCPT ); Fri, 31 Jul 2015 10:04:43 -0400 X-AuditID: cbfee61a-f79a06d000005c6f-f5-55bb8079573d 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 28/46] usb: gadget: pxa27x_udc: add ep capabilities support Date: Fri, 31 Jul 2015 16:00:40 +0200 Message-id: <1438351258-31578-29-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+t9jAd2qht2hBrs7OC1mvWxnsTh4v95i 74K7jBad9w8zWzT9fcVisefML3aL5sXr2SwurDO32H36EqPFrwdCFpseX2O16D93msXi8q45 bBazl/SzWCxa1sps8fv7P1aLtUfuslu8exlh8e1yM7vFsdl/mSzmd0xltXhweCe7xaw3whYT fl9gc5DwmPxkI5PHgl9bWTzu7TvM4tG/7jOrx7/D/UweO2fdZffYP3cNu8fmJfUe52csZPSY ffcHo0ffllWMHlv2f2b0OH5jO5PHzJW9bB6fN8l57P38myVAMIrLJiU1J7MstUjfLoErY9Gt S0wFh8Qq7l35ztbA+E2oi5GTQ0LARGJ7+zUWCFtM4sK99WxdjFwcQgJLGSXOzv7JDOH8ZJQ4 8XM+I0gVm4COxJbvE8BsEQEBifUvLrGDFDEL/GCRODuvmx0kISzgJ/Hywy8wm0VAVWL3q3ts IDavgJvE9Z7/UOvkJE4em8wKYnMCxb+uPwtWLyTgKnHk2CnmCYy8CxgZVjFKpBYkFxQnpeca 5qWW6xUn5haX5qXrJefnbmIEx9ozqR2MB3e5H2IU4GBU4uEVWLwrVIg1say4MvcQowQHs5II 73213aFCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeWU3bA4VEkhPLEnNTk0tSC2CyTJxcEo1MHoe Td1fsqB8YnV846awAvtHeZlqcpdELR5If30jyGh6jetjgfhJNdEZM90Y7A60C9+8wRa8PTPE K3s9S/Q98S1Wc2c4s2yet2Sfn9wyjv49Sd7rTO6Z19iG5OneXLgvQXH+6d4TK9UeTz91fjlT nrQ8/5OGA7kmluuFWZsf1MpnFFxwmuTjqcRSnJFoqMVcVJwIALVrSWexAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3062 Lines: 70 Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga --- drivers/usb/gadget/udc/pxa27x_udc.h | 40 +++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/drivers/usb/gadget/udc/pxa27x_udc.h b/drivers/usb/gadget/udc/pxa27x_udc.h index 11e1423..cea2cb7 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.h +++ b/drivers/usb/gadget/udc/pxa27x_udc.h @@ -234,25 +234,35 @@ /* * Endpoint definition helpers */ -#define USB_EP_DEF(addr, bname, dir, type, maxpkt) \ -{ .usb_ep = { .name = bname, .ops = &pxa_ep_ops, .maxpacket = maxpkt, }, \ +#define USB_EP_DEF(addr, bname, dir, type, maxpkt, ctype, cdir) \ +{ .usb_ep = { .name = bname, .ops = &pxa_ep_ops, .maxpacket = maxpkt, \ + .caps = USB_EP_CAPS(ctype, cdir), }, \ .desc = { .bEndpointAddress = addr | (dir ? USB_DIR_IN : 0), \ - .bmAttributes = type, \ + .bmAttributes = USB_ENDPOINT_XFER_ ## type, \ .wMaxPacketSize = maxpkt, }, \ .dev = &memory \ } -#define USB_EP_BULK(addr, bname, dir) \ - USB_EP_DEF(addr, bname, dir, USB_ENDPOINT_XFER_BULK, BULK_FIFO_SIZE) -#define USB_EP_ISO(addr, bname, dir) \ - USB_EP_DEF(addr, bname, dir, USB_ENDPOINT_XFER_ISOC, ISO_FIFO_SIZE) -#define USB_EP_INT(addr, bname, dir) \ - USB_EP_DEF(addr, bname, dir, USB_ENDPOINT_XFER_INT, INT_FIFO_SIZE) -#define USB_EP_IN_BULK(n) USB_EP_BULK(n, "ep" #n "in-bulk", 1) -#define USB_EP_OUT_BULK(n) USB_EP_BULK(n, "ep" #n "out-bulk", 0) -#define USB_EP_IN_ISO(n) USB_EP_ISO(n, "ep" #n "in-iso", 1) -#define USB_EP_OUT_ISO(n) USB_EP_ISO(n, "ep" #n "out-iso", 0) -#define USB_EP_IN_INT(n) USB_EP_INT(n, "ep" #n "in-int", 1) -#define USB_EP_CTRL USB_EP_DEF(0, "ep0", 0, 0, EP0_FIFO_SIZE) +#define USB_EP_BULK(addr, bname, dir, cdir) \ + USB_EP_DEF(addr, bname, dir, BULK, BULK_FIFO_SIZE, \ + USB_EP_CAPS_TYPE_BULK, cdir) +#define USB_EP_ISO(addr, bname, dir, cdir) \ + USB_EP_DEF(addr, bname, dir, ISOC, ISO_FIFO_SIZE, \ + USB_EP_CAPS_TYPE_ISO, cdir) +#define USB_EP_INT(addr, bname, dir, cdir) \ + USB_EP_DEF(addr, bname, dir, INT, INT_FIFO_SIZE, \ + USB_EP_CAPS_TYPE_INT, cdir) +#define USB_EP_IN_BULK(n) USB_EP_BULK(n, "ep" #n "in-bulk", 1, \ + USB_EP_CAPS_DIR_IN) +#define USB_EP_OUT_BULK(n) USB_EP_BULK(n, "ep" #n "out-bulk", 0, \ + USB_EP_CAPS_DIR_OUT) +#define USB_EP_IN_ISO(n) USB_EP_ISO(n, "ep" #n "in-iso", 1, \ + USB_EP_CAPS_DIR_IN) +#define USB_EP_OUT_ISO(n) USB_EP_ISO(n, "ep" #n "out-iso", 0, \ + USB_EP_CAPS_DIR_OUT) +#define USB_EP_IN_INT(n) USB_EP_INT(n, "ep" #n "in-int", 1, \ + USB_EP_CAPS_DIR_IN) +#define USB_EP_CTRL USB_EP_DEF(0, "ep0", 0, CONTROL, EP0_FIFO_SIZE, \ + USB_EP_CAPS_TYPE_CONTROL, USB_EP_CAPS_DIR_ALL) #define PXA_EP_DEF(_idx, _addr, dir, _type, maxpkt, _config, iface, altset) \ { \ -- 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/