Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755143AbbLKL0A (ORCPT ); Fri, 11 Dec 2015 06:26:00 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:36204 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754847AbbLKLZz (ORCPT ); Fri, 11 Dec 2015 06:25:55 -0500 X-AuditID: cbfee61a-f79266d000003652-d0-566ab2c1e457 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 v3 08/36] usb: gadget: composite: introduce new USB function ops Date: Fri, 11 Dec 2015 12:24:47 +0100 Message-id: <1449833115-24065-9-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1449833115-24065-1-git-send-email-r.baldyga@samsung.com> References: <1449833115-24065-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprKLMWRmVeSWpSXmKPExsVy+t9jQd1Dm7LCDLZNY7WY9bKdxWLjjPWs Fgfv11s0L17PZnF51xw2i0XLWpkt1h65y27x4PBOdgcOj/1z17B79G1Zxehx/MZ2Jo/Pm+QC WKK4bFJSczLLUov07RK4Mm7/e81Y0CZY0fh8M1MDYxNfFyMnh4SAiUTzigPsELaYxIV769m6 GLk4hARmMUo0zLzJApIQEvjJKDH9ahGIzSagI7Hl+wRGEFtEQEBi/YtL7CANzALnGCUe3mkD SwgLBEi8mTuXqYuRg4NFQFXi8MQ0kDCvgKvExud32SCWyUmcPDaZFcTmFHCTmHzyEjPELleJ N6/XMU5g5F3AyLCKUSK1ILmgOCk91zAvtVyvODG3uDQvXS85P3cTIziwnkntYDy4y/0QowAH oxIP7wKOrDAh1sSy4srcQ4wSHMxKIry/NgCFeFMSK6tSi/Lji0pzUosPMUpzsCiJ89ZeigwT EkhPLEnNTk0tSC2CyTJxcEo1MAo+DxRoPLflYOMtoecyBw7umfnlp3vNogDxx6902b80vJ/3 bRn/LY6XC5OiV++8/2rRbWfplkUXvua091d+u/n2RuD6u3waR3d4/fdfmqK6tKXol2CY1l0O rp7aGQaMbjbFNUZzdz3gTkg4Va309A23a+t7w4Ly1Ja3S5wTWO6+9f2+N0nsUocSS3FGoqEW c1FxIgB6O8riKAIAAA== 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/