Commit fbcaba0e authored by Bhupesh Sharma's avatar Bhupesh Sharma Committed by Felipe Balbi

usb: gadget: uvc: Add super-speed support to UVC webcam gadget

This patch adds super-speed support to UVC webcam gadget.

Also in this patch:
	- We add the configurability to pass bInterval, bMaxBurst, mult
	  factors for video streaming endpoint (ISOC IN) through module
	  parameters.

	- We use config_ep_by_speed helper routine to configure video
	  streaming endpoint.
Signed-off-by: default avatarBhupesh Sharma <bhupesh.sharma@st.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 57976636
This diff is collapsed.
...@@ -17,9 +17,11 @@ ...@@ -17,9 +17,11 @@
#include <linux/usb/video.h> #include <linux/usb/video.h>
extern int uvc_bind_config(struct usb_configuration *c, extern int uvc_bind_config(struct usb_configuration *c,
const struct uvc_descriptor_header * const *control, const struct uvc_descriptor_header * const *fs_control,
const struct uvc_descriptor_header * const *hs_control,
const struct uvc_descriptor_header * const *fs_streaming, const struct uvc_descriptor_header * const *fs_streaming,
const struct uvc_descriptor_header * const *hs_streaming); const struct uvc_descriptor_header * const *hs_streaming,
const struct uvc_descriptor_header * const *ss_streaming);
#endif /* _F_UVC_H_ */ #endif /* _F_UVC_H_ */
...@@ -153,9 +153,11 @@ struct uvc_device ...@@ -153,9 +153,11 @@ struct uvc_device
/* Descriptors */ /* Descriptors */
struct { struct {
const struct uvc_descriptor_header * const *control; const struct uvc_descriptor_header * const *fs_control;
const struct uvc_descriptor_header * const *ss_control;
const struct uvc_descriptor_header * const *fs_streaming; const struct uvc_descriptor_header * const *fs_streaming;
const struct uvc_descriptor_header * const *hs_streaming; const struct uvc_descriptor_header * const *hs_streaming;
const struct uvc_descriptor_header * const *ss_streaming;
} desc; } desc;
unsigned int control_intf; unsigned int control_intf;
......
...@@ -272,7 +272,15 @@ static const struct uvc_color_matching_descriptor uvc_color_matching = { ...@@ -272,7 +272,15 @@ static const struct uvc_color_matching_descriptor uvc_color_matching = {
.bMatrixCoefficients = 4, .bMatrixCoefficients = 4,
}; };
static const struct uvc_descriptor_header * const uvc_control_cls[] = { static const struct uvc_descriptor_header * const uvc_fs_control_cls[] = {
(const struct uvc_descriptor_header *) &uvc_control_header,
(const struct uvc_descriptor_header *) &uvc_camera_terminal,
(const struct uvc_descriptor_header *) &uvc_processing,
(const struct uvc_descriptor_header *) &uvc_output_terminal,
NULL,
};
static const struct uvc_descriptor_header * const uvc_ss_control_cls[] = {
(const struct uvc_descriptor_header *) &uvc_control_header, (const struct uvc_descriptor_header *) &uvc_control_header,
(const struct uvc_descriptor_header *) &uvc_camera_terminal, (const struct uvc_descriptor_header *) &uvc_camera_terminal,
(const struct uvc_descriptor_header *) &uvc_processing, (const struct uvc_descriptor_header *) &uvc_processing,
...@@ -304,6 +312,18 @@ static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = { ...@@ -304,6 +312,18 @@ static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = {
NULL, NULL,
}; };
static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = {
(const struct uvc_descriptor_header *) &uvc_input_header,
(const struct uvc_descriptor_header *) &uvc_format_yuv,
(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
(const struct uvc_descriptor_header *) &uvc_format_mjpg,
(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
(const struct uvc_descriptor_header *) &uvc_color_matching,
NULL,
};
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
* USB configuration * USB configuration
*/ */
...@@ -311,8 +331,9 @@ static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = { ...@@ -311,8 +331,9 @@ static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = {
static int __init static int __init
webcam_config_bind(struct usb_configuration *c) webcam_config_bind(struct usb_configuration *c)
{ {
return uvc_bind_config(c, uvc_control_cls, uvc_fs_streaming_cls, return uvc_bind_config(c, uvc_fs_control_cls, uvc_ss_control_cls,
uvc_hs_streaming_cls); uvc_fs_streaming_cls, uvc_hs_streaming_cls,
uvc_ss_streaming_cls);
} }
static struct usb_configuration webcam_config_driver = { static struct usb_configuration webcam_config_driver = {
...@@ -373,7 +394,7 @@ static struct usb_composite_driver webcam_driver = { ...@@ -373,7 +394,7 @@ static struct usb_composite_driver webcam_driver = {
.name = "g_webcam", .name = "g_webcam",
.dev = &webcam_device_descriptor, .dev = &webcam_device_descriptor,
.strings = webcam_device_strings, .strings = webcam_device_strings,
.max_speed = USB_SPEED_HIGH, .max_speed = USB_SPEED_SUPER,
.unbind = webcam_unbind, .unbind = webcam_unbind,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment