Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753296AbbKCMzC (ORCPT ); Tue, 3 Nov 2015 07:55:02 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:55348 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753999AbbKCMyw (ORCPT ); Tue, 3 Nov 2015 07:54:52 -0500 X-AuditID: cbfee61a-f79a06d000005c6f-b3-5638ae8f7308 From: Robert Baldyga To: balbi@ti.com Cc: gregkh@linuxfoundation.org, andrzej.p@samsung.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Baldyga Subject: [PATCH 08/23] usb: gadget: composite: introduce new USB function ops Date: Tue, 03 Nov 2015 13:53:47 +0100 Message-id: <1446555242-3733-9-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1446555242-3733-1-git-send-email-r.baldyga@samsung.com> References: <1446555242-3733-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMLMWRmVeSWpSXmKPExsVy+t9jQd3+dRZhBh8WmlnMetnOYrFxxnpW i4P36y2aF69ns7i8aw6bxaJlrcwWa4/cZbd4cHgnuwOHx/65a9g9+rasYvQ4fmM7k8fnTXIB LFFcNimpOZllqUX6dglcGbf/vWYsaBOsaHy+mamBsYmvi5GTQ0LAROJT639mCFtM4sK99Wxd jFwcQgKzGCVOLX7HCJIQEvjJKHFioT+IzSagI7Hl+wSwuIiAgMT6F5fYQRqYBc4xSjy80waU 4OAQFvCVuHw3AKSGRUBV4vnpE0wgNq+Ai8TjU1+YIJbJSZw8NpkVpJxTwFXi0jtlEFMIqOT4 dp4JjLwLGBlWMUqkFiQXFCel5xrmpZbrFSfmFpfmpesl5+duYgQH1TOpHYwHd7kfYhTgYFTi 4V2wxDxMiDWxrLgy9xCjBAezkgjv7rkWYUK8KYmVValF+fFFpTmpxYcYpTlYlMR59T2NwoQE 0hNLUrNTUwtSi2CyTBycUg2MbNuimuU1MhY4er+qLle0PvV+gpmkUw7D9IcxVX/WL9C8uOrx c4+1irYbPXc9iJiruaH31baPcmF+ES8CrV9rNMQps+x2nhPwu2/dkn3TLBp2MlxtNPermHH6 8lRrrw1cm3WlJk4W/2H6oFWhacXEa/5mVbpFk+UXZK/YnFfu29nA8mjlipnPlFiKMxINtZiL ihMBCzukCiYCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2378 Lines: 54 Introduce two new USB function operations: 1. prep_descs() prepares and assigns entity (interface and endpoint) descriptors to USB function. It's mandatory, in the new function API, as each USB function should have at least minimalistic set of entity descriptors. The minimum is single inferface with one altsetting with no endpoins (ep0 only). Descriptors assigned to function in prep_descs() callback are used during bind procedure. 2. prep_vendor_descs() - prepares and assigns class and vendor specific descriptors to function. This function is called after binding function to UDC hardware, which means that interface numbers and endpoint addresses are already assigned so that function can use these values to prepare class or vendor specific descriptors and attach them to function. Signed-off-by: Robert Baldyga --- include/linux/usb/composite.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index b778d4d..58d2929 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h @@ -286,6 +286,10 @@ struct usb_os_desc_table { * can expose more than one interface. If an interface is a member of * an IAD, only the first interface of IAD has its entry in the table. * @os_desc_n: Number of entries in os_desc_table + * @prep_descs: Returns standard function descriptors (interface and endpoint + * descritptors). + * @prep_vendor_descs: Attaches vendor or class specific descriptors to + * standard descriptors. * @bind: Before the gadget can register, all of its functions bind() to the * available resources including string and interface identifiers used * in interface or class descriptors; endpoints; I/O buffers; and so on. @@ -354,6 +358,10 @@ struct usb_function { * Related: unbind() may kfree() but bind() won't... */ + /* new function API*/ + int (*prep_descs)(struct usb_function *); + int (*prep_vendor_descs)(struct usb_function *); + /* configuration management: bind/unbind */ int (*bind)(struct usb_configuration *, struct usb_function *); -- 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/