diff options
author | Li Jun | 2021-01-25 21:43:54 +0800 |
---|---|---|
committer | Marek Vasut | 2021-01-31 14:08:56 +0100 |
commit | 8745b9ebccae599856045c5d6354463178604f72 (patch) | |
tree | 13468dcb0fb892e0477269c1c19fc9ec25215bcd /include/linux | |
parent | 42a594de14637f809050cd2e2ea8b4a7f51bb31a (diff) |
usb: gadget: add super speed support
This patch is to add usb gadget super speed support in common
driver, including BOS descriptor and select the super speed
descriptor from function driver.
Reviewed-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Tested-by: faqiang.zhu <faqiang.zhu@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/usb/composite.h | 4 | ||||
-rw-r--r-- | include/linux/usb/gadget.h | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index d75a0bc4c49..935e5c0cbb1 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h @@ -146,6 +146,7 @@ struct usb_function { struct usb_gadget_strings **strings; struct usb_descriptor_header **descriptors; struct usb_descriptor_header **hs_descriptors; + struct usb_descriptor_header **ss_descriptors; struct usb_configuration *config; @@ -279,6 +280,7 @@ struct usb_configuration { u8 next_interface_id; unsigned highspeed:1; unsigned fullspeed:1; + unsigned superspeed:1; struct usb_function *interface[MAX_CONFIG_INTERFACES]; }; @@ -292,6 +294,7 @@ int usb_add_config(struct usb_composite_dev *, * identifiers. * @strings: tables of strings, keyed by identifiers assigned during bind() * and language IDs provided in control requests + * @max_speed: Highest speed the driver supports. * @bind: (REQUIRED) Used to allocate resources that are shared across the * whole device, such as string IDs, and add its configurations using * @usb_add_config(). This may fail by returning a negative errno @@ -319,6 +322,7 @@ struct usb_composite_driver { const char *name; const struct usb_device_descriptor *dev; struct usb_gadget_strings **strings; + enum usb_device_speed max_speed; /* REVISIT: bind() functions can be marked __init, which * makes trouble for section mismatch analysis. See if diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 8d54b91734c..7e6d329e542 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -449,6 +449,11 @@ static inline void usb_ep_fifo_flush(struct usb_ep *ep) /*-------------------------------------------------------------------------*/ +struct usb_dcd_config_params { + __u8 bU1devExitLat; /* U1 Device exit Latency */ + __le16 bU2DevExitLat; /* U2 Device exit Latency */ +}; + struct usb_gadget; struct usb_gadget_driver; @@ -464,6 +469,7 @@ struct usb_gadget_ops { int (*pullup) (struct usb_gadget *, int is_on); int (*ioctl)(struct usb_gadget *, unsigned code, unsigned long param); + void (*get_config_params)(struct usb_dcd_config_params *); int (*udc_start)(struct usb_gadget *, struct usb_gadget_driver *); int (*udc_stop)(struct usb_gadget *); |