diff options
author | Bhupesh Sharma <bhupesh.sharma@st.com> | 2012-06-01 05:38:56 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-06-04 11:12:36 -0400 |
commit | fbcaba0e3dcec8451cccdc1fa92fcddbde2bc3f2 (patch) | |
tree | b21dad6486886007a24cffeb38c7ea8af8a7055b /drivers/usb/gadget/webcam.c | |
parent | 5797663674b0d802f275761e71593b32b0849242 (diff) |
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: Bhupesh Sharma <bhupesh.sharma@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/webcam.c')
-rw-r--r-- | drivers/usb/gadget/webcam.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/drivers/usb/gadget/webcam.c b/drivers/usb/gadget/webcam.c index 668fe128f2ef..120e134e805e 100644 --- a/drivers/usb/gadget/webcam.c +++ b/drivers/usb/gadget/webcam.c | |||
@@ -272,7 +272,15 @@ static const struct uvc_color_matching_descriptor uvc_color_matching = { | |||
272 | .bMatrixCoefficients = 4, | 272 | .bMatrixCoefficients = 4, |
273 | }; | 273 | }; |
274 | 274 | ||
275 | static const struct uvc_descriptor_header * const uvc_control_cls[] = { | 275 | static const struct uvc_descriptor_header * const uvc_fs_control_cls[] = { |
276 | (const struct uvc_descriptor_header *) &uvc_control_header, | ||
277 | (const struct uvc_descriptor_header *) &uvc_camera_terminal, | ||
278 | (const struct uvc_descriptor_header *) &uvc_processing, | ||
279 | (const struct uvc_descriptor_header *) &uvc_output_terminal, | ||
280 | NULL, | ||
281 | }; | ||
282 | |||
283 | static const struct uvc_descriptor_header * const uvc_ss_control_cls[] = { | ||
276 | (const struct uvc_descriptor_header *) &uvc_control_header, | 284 | (const struct uvc_descriptor_header *) &uvc_control_header, |
277 | (const struct uvc_descriptor_header *) &uvc_camera_terminal, | 285 | (const struct uvc_descriptor_header *) &uvc_camera_terminal, |
278 | (const struct uvc_descriptor_header *) &uvc_processing, | 286 | (const struct uvc_descriptor_header *) &uvc_processing, |
@@ -304,6 +312,18 @@ static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = { | |||
304 | NULL, | 312 | NULL, |
305 | }; | 313 | }; |
306 | 314 | ||
315 | static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = { | ||
316 | (const struct uvc_descriptor_header *) &uvc_input_header, | ||
317 | (const struct uvc_descriptor_header *) &uvc_format_yuv, | ||
318 | (const struct uvc_descriptor_header *) &uvc_frame_yuv_360p, | ||
319 | (const struct uvc_descriptor_header *) &uvc_frame_yuv_720p, | ||
320 | (const struct uvc_descriptor_header *) &uvc_format_mjpg, | ||
321 | (const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p, | ||
322 | (const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p, | ||
323 | (const struct uvc_descriptor_header *) &uvc_color_matching, | ||
324 | NULL, | ||
325 | }; | ||
326 | |||
307 | /* -------------------------------------------------------------------------- | 327 | /* -------------------------------------------------------------------------- |
308 | * USB configuration | 328 | * USB configuration |
309 | */ | 329 | */ |
@@ -311,8 +331,9 @@ static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = { | |||
311 | static int __init | 331 | static int __init |
312 | webcam_config_bind(struct usb_configuration *c) | 332 | webcam_config_bind(struct usb_configuration *c) |
313 | { | 333 | { |
314 | return uvc_bind_config(c, uvc_control_cls, uvc_fs_streaming_cls, | 334 | return uvc_bind_config(c, uvc_fs_control_cls, uvc_ss_control_cls, |
315 | uvc_hs_streaming_cls); | 335 | uvc_fs_streaming_cls, uvc_hs_streaming_cls, |
336 | uvc_ss_streaming_cls); | ||
316 | } | 337 | } |
317 | 338 | ||
318 | static struct usb_configuration webcam_config_driver = { | 339 | static struct usb_configuration webcam_config_driver = { |
@@ -373,7 +394,7 @@ static struct usb_composite_driver webcam_driver = { | |||
373 | .name = "g_webcam", | 394 | .name = "g_webcam", |
374 | .dev = &webcam_device_descriptor, | 395 | .dev = &webcam_device_descriptor, |
375 | .strings = webcam_device_strings, | 396 | .strings = webcam_device_strings, |
376 | .max_speed = USB_SPEED_HIGH, | 397 | .max_speed = USB_SPEED_SUPER, |
377 | .unbind = webcam_unbind, | 398 | .unbind = webcam_unbind, |
378 | }; | 399 | }; |
379 | 400 | ||