lkml.org 
[lkml]   [2016]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 08/43] usb: gadget: composite: introduce new USB function ops
Date
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 <r.baldyga@samsung.com>
---
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 91948c7..7ede101 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -293,6 +293,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.
@@ -361,6 +365,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
\
 
 \ /
  Last update: 2016-02-03 14:01    [W:1.996 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site