From f69257baa8323ffdc5b4fb6af200f9994a2003bd Mon Sep 17 00:00:00 2001 From: T Karthik Reddy Date: Mon, 14 Oct 2019 14:52:50 +0200 Subject: usb: composite: add BOS descriptor support to composite framework To add usb-3.0 support to peripheral device add BOS & SS capability descriptors to gadget composite framework. Signed-off-by: T Karthik Reddy Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek Reviewed-by: Roger Quadros --- include/linux/usb/ch9.h | 3 +++ include/linux/usb/gadget.h | 9 +++++++++ 2 files changed, 12 insertions(+) (limited to 'include') diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 264c971..989a5fc 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h @@ -878,6 +878,9 @@ struct usb_ss_cap_descriptor { /* Link Power Management */ __le16 bU2DevExitLat; } __attribute__((packed)); +#define USB_DEFAULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */ +#define USB_DEFAULT_U2_DEV_EXIT_LAT 0x01F4 /* Less then 500 microsec */ + #define USB_DT_USB_SS_CAP_SIZE 10 /* diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 66794d7..06292dd 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -592,6 +592,15 @@ static inline int gadget_is_otg(struct usb_gadget *g) } /** + * gadget_is_superspeed() - return true if the hardware handles superspeed + * @g: controller that might support superspeed + */ +static inline int gadget_is_superspeed(struct usb_gadget *g) +{ + return g->max_speed >= USB_SPEED_SUPER; +} + +/** * usb_gadget_frame_number - returns the current frame number * @gadget: controller that reports the frame number * -- cgit v1.1