Lines Matching +full:xps +full:- +full:gpio +full:- +full:1

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * uvc_driver.c -- USB Video Class driver
5 * Copyright (C) 2005-2010
11 #include <linux/gpio/consumer.h>
24 #include <media/v4l2-common.h>
25 #include <media/v4l2-ioctl.h>
36 static unsigned int uvc_quirks_param = -1;
40 /* ------------------------------------------------------------------------
50 for (i = 0; i < alts->desc.bNumEndpoints; ++i) { in uvc_find_endpoint()
51 ep = &alts->endpoint[i]; in uvc_find_endpoint()
52 if (ep->desc.bEndpointAddress == epaddr) in uvc_find_endpoint()
89 V4L2_XFER_FUNC_709, /* Substitution for BT.470-2 M */ in uvc_xfer_func()
90 V4L2_XFER_FUNC_709, /* Substitution for BT.470-2 B, G */ in uvc_xfer_func()
119 V4L2_YCBCR_ENC_601, /* Substitution for BT.470-2 B, G */ in uvc_ycbcr_enc()
130 /* ------------------------------------------------------------------------
138 list_for_each_entry(entity, &dev->entities, list) { in uvc_entity_by_id()
139 if (entity->id == id) in uvc_entity_by_id()
152 entity = list_entry(&dev->entities, struct uvc_entity, list); in uvc_entity_by_reference()
154 list_for_each_entry_continue(entity, &dev->entities, list) { in uvc_entity_by_reference()
155 for (i = 0; i < entity->bNrInPins; ++i) in uvc_entity_by_reference()
156 if (entity->baSourceID[i] == id) in uvc_entity_by_reference()
167 list_for_each_entry(stream, &dev->streams, list) { in uvc_stream_by_id()
168 if (stream->header.bTerminalLink == id) in uvc_stream_by_id()
175 /* ------------------------------------------------------------------------
181 if (stream->async_wq) in uvc_stream_delete()
182 destroy_workqueue(stream->async_wq); in uvc_stream_delete()
184 mutex_destroy(&stream->mutex); in uvc_stream_delete()
186 usb_put_intf(stream->intf); in uvc_stream_delete()
188 kfree(stream->formats); in uvc_stream_delete()
189 kfree(stream->header.bmaControls); in uvc_stream_delete()
202 mutex_init(&stream->mutex); in uvc_stream_new()
204 stream->dev = dev; in uvc_stream_new()
205 stream->intf = usb_get_intf(intf); in uvc_stream_new()
206 stream->intfnum = intf->cur_altsetting->desc.bInterfaceNumber; in uvc_stream_new()
209 stream->async_wq = alloc_workqueue("uvcvideo", WQ_UNBOUND | WQ_HIGHPRI, in uvc_stream_new()
211 if (!stream->async_wq) { in uvc_stream_new()
219 /* ------------------------------------------------------------------------
228 struct usb_interface *intf = streaming->intf; in uvc_parse_format()
229 struct usb_host_interface *alts = intf->cur_altsetting; in uvc_parse_format()
233 unsigned int width_multiplier = 1; in uvc_parse_format()
238 format->type = buffer[2]; in uvc_parse_format()
239 format->index = buffer[3]; in uvc_parse_format()
240 format->frames = frames; in uvc_parse_format()
249 dev->udev->devnum, in uvc_parse_format()
250 alts->desc.bInterfaceNumber); in uvc_parse_format()
251 return -EINVAL; in uvc_parse_format()
262 dev_info(&streaming->intf->dev, in uvc_parse_format()
267 format->fcc = fmtdesc->fcc; in uvc_parse_format()
268 format->bpp = buffer[21]; in uvc_parse_format()
274 if (dev->quirks & UVC_QUIRK_FORCE_Y8) { in uvc_parse_format()
275 if (format->fcc == V4L2_PIX_FMT_YUYV) { in uvc_parse_format()
276 format->fcc = V4L2_PIX_FMT_GREY; in uvc_parse_format()
277 format->bpp = 8; in uvc_parse_format()
283 if (dev->quirks & UVC_QUIRK_FORCE_BPP) { in uvc_parse_format()
285 v4l2_format_info(format->fcc); in uvc_parse_format()
288 unsigned int div = info->hdiv * info->vdiv; in uvc_parse_format()
290 n = info->bpp[0] * div; in uvc_parse_format()
291 for (i = 1; i < info->comp_planes; i++) in uvc_parse_format()
292 n += info->bpp[i]; in uvc_parse_format()
294 format->bpp = DIV_ROUND_UP(8 * n, div); in uvc_parse_format()
303 format->flags = UVC_FMT_FLAG_COMPRESSED; in uvc_parse_format()
311 dev->udev->devnum, in uvc_parse_format()
312 alts->desc.bInterfaceNumber); in uvc_parse_format()
313 return -EINVAL; in uvc_parse_format()
316 format->fcc = V4L2_PIX_FMT_MJPEG; in uvc_parse_format()
317 format->flags = UVC_FMT_FLAG_COMPRESSED; in uvc_parse_format()
318 format->bpp = 0; in uvc_parse_format()
326 dev->udev->devnum, in uvc_parse_format()
327 alts->desc.bInterfaceNumber); in uvc_parse_format()
328 return -EINVAL; in uvc_parse_format()
334 dev->udev->devnum, in uvc_parse_format()
335 alts->desc.bInterfaceNumber, buffer[8]); in uvc_parse_format()
336 return -EINVAL; in uvc_parse_format()
339 format->fcc = V4L2_PIX_FMT_DV; in uvc_parse_format()
340 format->flags = UVC_FMT_FLAG_COMPRESSED | UVC_FMT_FLAG_STREAM; in uvc_parse_format()
341 format->bpp = 0; in uvc_parse_format()
347 frame->bFrameIntervalType = 1; in uvc_parse_format()
348 frame->dwDefaultFrameInterval = 1; in uvc_parse_format()
349 frame->dwFrameInterval = *intervals; in uvc_parse_format()
350 *(*intervals)++ = 1; in uvc_parse_format()
351 format->nframes = 1; in uvc_parse_format()
360 dev->udev->devnum, alts->desc.bInterfaceNumber, in uvc_parse_format()
362 return -EINVAL; in uvc_parse_format()
365 uvc_dbg(dev, DESCR, "Found format %p4cc", &format->fcc); in uvc_parse_format()
367 buflen -= buffer[0]; in uvc_parse_format()
374 while (ftype && buflen > 2 && buffer[1] == USB_DT_CS_INTERFACE && in uvc_parse_format()
378 frame = &frames[format->nframes]; in uvc_parse_format()
389 dev->udev->devnum, in uvc_parse_format()
390 alts->desc.bInterfaceNumber); in uvc_parse_format()
391 return -EINVAL; in uvc_parse_format()
394 frame->bFrameIndex = buffer[3]; in uvc_parse_format()
395 frame->bmCapabilities = buffer[4]; in uvc_parse_format()
396 frame->wWidth = get_unaligned_le16(&buffer[5]) in uvc_parse_format()
398 frame->wHeight = get_unaligned_le16(&buffer[7]); in uvc_parse_format()
399 frame->dwMinBitRate = get_unaligned_le32(&buffer[9]); in uvc_parse_format()
400 frame->dwMaxBitRate = get_unaligned_le32(&buffer[13]); in uvc_parse_format()
402 frame->dwMaxVideoFrameBufferSize = in uvc_parse_format()
404 frame->dwDefaultFrameInterval = in uvc_parse_format()
406 frame->bFrameIntervalType = buffer[25]; in uvc_parse_format()
408 frame->dwMaxVideoFrameBufferSize = 0; in uvc_parse_format()
409 frame->dwDefaultFrameInterval = in uvc_parse_format()
411 frame->bFrameIntervalType = buffer[21]; in uvc_parse_format()
419 * zero. Setting all null intervals to 1 fixes the problem and in uvc_parse_format()
422 frame->dwFrameInterval = *intervals; in uvc_parse_format()
426 (*intervals)[i] = interval ? interval : 1; in uvc_parse_format()
443 if (!(format->flags & UVC_FMT_FLAG_COMPRESSED)) in uvc_parse_format()
444 frame->dwMaxVideoFrameBufferSize = format->bpp in uvc_parse_format()
445 * frame->wWidth * frame->wHeight / 8; in uvc_parse_format()
451 * value and dwFrameInterval[1] storing the maximum value. in uvc_parse_format()
453 maxIntervalIndex = frame->bFrameIntervalType ? n - 1 : 1; in uvc_parse_format()
454 frame->dwDefaultFrameInterval = in uvc_parse_format()
455 clamp(frame->dwDefaultFrameInterval, in uvc_parse_format()
456 frame->dwFrameInterval[0], in uvc_parse_format()
457 frame->dwFrameInterval[maxIntervalIndex]); in uvc_parse_format()
464 if (dev->quirks & UVC_QUIRK_RESTRICT_FRAME_RATE) { in uvc_parse_format()
465 frame->bFrameIntervalType = 1; in uvc_parse_format()
466 (*intervals)[0] = frame->dwDefaultFrameInterval; in uvc_parse_format()
469 uvc_dbg(dev, DESCR, "- %ux%u (%u.%u fps)\n", in uvc_parse_format()
470 frame->wWidth, frame->wHeight, in uvc_parse_format()
471 10000000 / frame->dwDefaultFrameInterval, in uvc_parse_format()
472 (100000000 / frame->dwDefaultFrameInterval) % 10); in uvc_parse_format()
474 format->nframes++; in uvc_parse_format()
477 buflen -= buffer[0]; in uvc_parse_format()
481 if (buflen > 2 && buffer[1] == USB_DT_CS_INTERFACE && in uvc_parse_format()
483 buflen -= buffer[0]; in uvc_parse_format()
487 if (buflen > 2 && buffer[1] == USB_DT_CS_INTERFACE && in uvc_parse_format()
492 dev->udev->devnum, in uvc_parse_format()
493 alts->desc.bInterfaceNumber); in uvc_parse_format()
494 return -EINVAL; in uvc_parse_format()
497 format->colorspace = uvc_colorspace(buffer[3]); in uvc_parse_format()
498 format->xfer_func = uvc_xfer_func(buffer[4]); in uvc_parse_format()
499 format->ycbcr_enc = uvc_ycbcr_enc(buffer[5]); in uvc_parse_format()
501 buflen -= buffer[0]; in uvc_parse_format()
504 format->colorspace = V4L2_COLORSPACE_SRGB; in uvc_parse_format()
507 return buffer - start; in uvc_parse_format()
516 struct usb_host_interface *alts = &intf->altsetting[0]; in uvc_parse_streaming()
517 const unsigned char *_buffer, *buffer = alts->extra; in uvc_parse_streaming()
518 int _buflen, buflen = alts->extralen; in uvc_parse_streaming()
523 int ret = -EINVAL; in uvc_parse_streaming()
525 if (intf->cur_altsetting->desc.bInterfaceSubClass in uvc_parse_streaming()
529 dev->udev->devnum, in uvc_parse_streaming()
530 intf->altsetting[0].desc.bInterfaceNumber); in uvc_parse_streaming()
531 return -EINVAL; in uvc_parse_streaming()
537 dev->udev->devnum, in uvc_parse_streaming()
538 intf->altsetting[0].desc.bInterfaceNumber); in uvc_parse_streaming()
539 return -EINVAL; in uvc_parse_streaming()
545 return -ENOMEM; in uvc_parse_streaming()
549 * The Pico iMage webcam has its class-specific interface descriptors in uvc_parse_streaming()
553 for (i = 0; i < alts->desc.bNumEndpoints; ++i) { in uvc_parse_streaming()
554 struct usb_host_endpoint *ep = &alts->endpoint[i]; in uvc_parse_streaming()
556 if (ep->extralen == 0) in uvc_parse_streaming()
559 if (ep->extralen > 2 && in uvc_parse_streaming()
560 ep->extra[1] == USB_DT_CS_INTERFACE) { in uvc_parse_streaming()
564 buffer = alts->endpoint[i].extra; in uvc_parse_streaming()
565 buflen = alts->endpoint[i].extralen; in uvc_parse_streaming()
572 while (buflen > 2 && buffer[1] != USB_DT_CS_INTERFACE) { in uvc_parse_streaming()
573 buflen -= buffer[0]; in uvc_parse_streaming()
579 "no class-specific streaming interface descriptors found\n"); in uvc_parse_streaming()
586 streaming->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; in uvc_parse_streaming()
591 streaming->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; in uvc_parse_streaming()
598 dev->udev->devnum, alts->desc.bInterfaceNumber); in uvc_parse_streaming()
603 n = buflen >= size ? buffer[size-1] : 0; in uvc_parse_streaming()
608 dev->udev->devnum, alts->desc.bInterfaceNumber); in uvc_parse_streaming()
612 streaming->header.bNumFormats = p; in uvc_parse_streaming()
613 streaming->header.bEndpointAddress = buffer[6]; in uvc_parse_streaming()
615 streaming->header.bmInfo = buffer[7]; in uvc_parse_streaming()
616 streaming->header.bTerminalLink = buffer[8]; in uvc_parse_streaming()
617 streaming->header.bStillCaptureMethod = buffer[9]; in uvc_parse_streaming()
618 streaming->header.bTriggerSupport = buffer[10]; in uvc_parse_streaming()
619 streaming->header.bTriggerUsage = buffer[11]; in uvc_parse_streaming()
621 streaming->header.bTerminalLink = buffer[7]; in uvc_parse_streaming()
623 streaming->header.bControlSize = n; in uvc_parse_streaming()
625 streaming->header.bmaControls = kmemdup(&buffer[size], p * n, in uvc_parse_streaming()
627 if (streaming->header.bmaControls == NULL) { in uvc_parse_streaming()
628 ret = -ENOMEM; in uvc_parse_streaming()
632 buflen -= buffer[0]; in uvc_parse_streaming()
639 while (_buflen > 2 && _buffer[1] == USB_DT_CS_INTERFACE) { in uvc_parse_streaming()
661 dev->udev->devnum, in uvc_parse_streaming()
662 alts->desc.bInterfaceNumber, _buffer[2]); in uvc_parse_streaming()
679 _buflen -= _buffer[0]; in uvc_parse_streaming()
686 dev->udev->devnum, alts->desc.bInterfaceNumber); in uvc_parse_streaming()
702 ret = -ENOMEM; in uvc_parse_streaming()
711 streaming->formats = format; in uvc_parse_streaming()
712 streaming->nformats = 0; in uvc_parse_streaming()
715 while (buflen > 2 && buffer[1] == USB_DT_CS_INTERFACE) { in uvc_parse_streaming()
728 streaming->nformats++; in uvc_parse_streaming()
729 frame += format->nframes; in uvc_parse_streaming()
732 buflen -= ret; in uvc_parse_streaming()
740 buflen -= buffer[0]; in uvc_parse_streaming()
747 dev->udev->devnum, alts->desc.bInterfaceNumber, buflen); in uvc_parse_streaming()
750 for (i = 0; i < intf->num_altsetting; ++i) { in uvc_parse_streaming()
753 alts = &intf->altsetting[i]; in uvc_parse_streaming()
755 streaming->header.bEndpointAddress); in uvc_parse_streaming()
758 psize = uvc_endpoint_max_bpi(dev->udev, ep); in uvc_parse_streaming()
759 if (psize > streaming->maxpsize) in uvc_parse_streaming()
760 streaming->maxpsize = psize; in uvc_parse_streaming()
763 list_add_tail(&streaming->list, &dev->streams); in uvc_parse_streaming()
786 extra_size = roundup(extra_size, sizeof(*entity->pads)); in uvc_alloc_entity()
788 num_inputs = type & UVC_TERM_OUTPUT ? num_pads : num_pads - 1; in uvc_alloc_entity()
791 size = sizeof(*entity) + extra_size + sizeof(*entity->pads) * num_pads in uvc_alloc_entity()
797 entity->id = id; in uvc_alloc_entity()
798 entity->type = type; in uvc_alloc_entity()
806 memcpy(entity->guid, uvc_gpio_guid, 16); in uvc_alloc_entity()
809 memcpy(entity->guid, uvc_camera_guid, 16); in uvc_alloc_entity()
812 memcpy(entity->guid, uvc_media_transport_input_guid, 16); in uvc_alloc_entity()
815 memcpy(entity->guid, uvc_processing_guid, 16); in uvc_alloc_entity()
819 entity->num_links = 0; in uvc_alloc_entity()
820 entity->num_pads = num_pads; in uvc_alloc_entity()
821 entity->pads = ((void *)(entity + 1)) + extra_size; in uvc_alloc_entity()
824 entity->pads[i].flags = MEDIA_PAD_FL_SINK; in uvc_alloc_entity()
826 entity->pads[num_pads-1].flags = MEDIA_PAD_FL_SOURCE; in uvc_alloc_entity()
828 entity->bNrInPins = num_inputs; in uvc_alloc_entity()
829 entity->baSourceID = (u8 *)(&entity->pads[num_pads]); in uvc_alloc_entity()
846 ret = usb_string(dev->udev, string_id, entity->name, in uvc_entity_set_name()
847 sizeof(entity->name)); in uvc_entity_set_name()
852 sprintf(entity->name, "%s %u", type_name, entity->id); in uvc_entity_set_name()
855 /* Parse vendor-specific extensions. */
859 struct usb_device *udev = dev->udev; in uvc_parse_vendor_control()
860 struct usb_host_interface *alts = dev->intf->cur_altsetting; in uvc_parse_vendor_control()
865 switch (le16_to_cpu(dev->udev->descriptor.idVendor)) { in uvc_parse_vendor_control()
867 if (buffer[1] != 0x41 || buffer[2] != 0x01) in uvc_parse_vendor_control()
879 * ---------------------------------------------------------- in uvc_parse_vendor_control()
880 * 0 bLength 1 Number in uvc_parse_vendor_control()
882 * ---------------------------------------------------------- in uvc_parse_vendor_control()
886 * 1: Relative in uvc_parse_vendor_control()
889 * ---------------------------------------------------------- in uvc_parse_vendor_control()
890 * 23+p+n*2 bReserved 1 Boolean in uvc_parse_vendor_control()
891 * ---------------------------------------------------------- in uvc_parse_vendor_control()
892 * 24+p+n*2 iExtension 1 Index in uvc_parse_vendor_control()
895 * ---------------------------------------------------------- in uvc_parse_vendor_control()
903 udev->devnum, alts->desc.bInterfaceNumber); in uvc_parse_vendor_control()
908 p + 1, 2*n); in uvc_parse_vendor_control()
910 return -ENOMEM; in uvc_parse_vendor_control()
912 memcpy(unit->guid, &buffer[4], 16); in uvc_parse_vendor_control()
913 unit->extension.bNumControls = buffer[20]; in uvc_parse_vendor_control()
914 memcpy(unit->baSourceID, &buffer[22], p); in uvc_parse_vendor_control()
915 unit->extension.bControlSize = buffer[22+p]; in uvc_parse_vendor_control()
916 unit->extension.bmControls = (u8 *)unit + sizeof(*unit); in uvc_parse_vendor_control()
917 unit->extension.bmControlsType = (u8 *)unit + sizeof(*unit) in uvc_parse_vendor_control()
919 memcpy(unit->extension.bmControls, &buffer[23+p], 2*n); in uvc_parse_vendor_control()
923 list_add_tail(&unit->list, &dev->entities); in uvc_parse_vendor_control()
924 handled = 1; in uvc_parse_vendor_control()
934 struct usb_device *udev = dev->udev; in uvc_parse_standard_control()
937 struct usb_host_interface *alts = dev->intf->cur_altsetting; in uvc_parse_standard_control()
949 udev->devnum, alts->desc.bInterfaceNumber); in uvc_parse_standard_control()
950 return -EINVAL; in uvc_parse_standard_control()
953 dev->uvc_version = get_unaligned_le16(&buffer[3]); in uvc_parse_standard_control()
954 dev->clock_frequency = get_unaligned_le32(&buffer[7]); in uvc_parse_standard_control()
962 udev->devnum, i); in uvc_parse_standard_control()
974 udev->devnum, alts->desc.bInterfaceNumber); in uvc_parse_standard_control()
975 return -EINVAL; in uvc_parse_standard_control()
981 * - The high byte must be non-zero, otherwise it would be in uvc_parse_standard_control()
984 * - Bit 15 must be 0, as we use it internally as a terminal in uvc_parse_standard_control()
993 udev->devnum, alts->desc.bInterfaceNumber, in uvc_parse_standard_control()
1015 udev->devnum, alts->desc.bInterfaceNumber); in uvc_parse_standard_control()
1016 return -EINVAL; in uvc_parse_standard_control()
1020 1, n + p); in uvc_parse_standard_control()
1022 return -ENOMEM; in uvc_parse_standard_control()
1025 term->camera.bControlSize = n; in uvc_parse_standard_control()
1026 term->camera.bmControls = (u8 *)term + sizeof(*term); in uvc_parse_standard_control()
1027 term->camera.wObjectiveFocalLengthMin = in uvc_parse_standard_control()
1029 term->camera.wObjectiveFocalLengthMax = in uvc_parse_standard_control()
1031 term->camera.wOcularFocalLength = in uvc_parse_standard_control()
1033 memcpy(term->camera.bmControls, &buffer[15], n); in uvc_parse_standard_control()
1036 term->media.bControlSize = n; in uvc_parse_standard_control()
1037 term->media.bmControls = (u8 *)term + sizeof(*term); in uvc_parse_standard_control()
1038 term->media.bTransportModeSize = p; in uvc_parse_standard_control()
1039 term->media.bmTransportModes = (u8 *)term in uvc_parse_standard_control()
1041 memcpy(term->media.bmControls, &buffer[9], n); in uvc_parse_standard_control()
1042 memcpy(term->media.bmTransportModes, &buffer[10+n], p); in uvc_parse_standard_control()
1054 list_add_tail(&term->list, &dev->entities); in uvc_parse_standard_control()
1061 udev->devnum, alts->desc.bInterfaceNumber); in uvc_parse_standard_control()
1062 return -EINVAL; in uvc_parse_standard_control()
1073 udev->devnum, alts->desc.bInterfaceNumber, in uvc_parse_standard_control()
1079 1, 0); in uvc_parse_standard_control()
1081 return -ENOMEM; in uvc_parse_standard_control()
1083 memcpy(term->baSourceID, &buffer[7], 1); in uvc_parse_standard_control()
1087 list_add_tail(&term->list, &dev->entities); in uvc_parse_standard_control()
1096 udev->devnum, alts->desc.bInterfaceNumber); in uvc_parse_standard_control()
1097 return -EINVAL; in uvc_parse_standard_control()
1100 unit = uvc_alloc_entity(buffer[2], buffer[3], p + 1, 0); in uvc_parse_standard_control()
1102 return -ENOMEM; in uvc_parse_standard_control()
1104 memcpy(unit->baSourceID, &buffer[5], p); in uvc_parse_standard_control()
1108 list_add_tail(&unit->list, &dev->entities); in uvc_parse_standard_control()
1113 p = dev->uvc_version >= 0x0110 ? 10 : 9; in uvc_parse_standard_control()
1118 udev->devnum, alts->desc.bInterfaceNumber); in uvc_parse_standard_control()
1119 return -EINVAL; in uvc_parse_standard_control()
1124 return -ENOMEM; in uvc_parse_standard_control()
1126 memcpy(unit->baSourceID, &buffer[4], 1); in uvc_parse_standard_control()
1127 unit->processing.wMaxMultiplier = in uvc_parse_standard_control()
1129 unit->processing.bControlSize = buffer[7]; in uvc_parse_standard_control()
1130 unit->processing.bmControls = (u8 *)unit + sizeof(*unit); in uvc_parse_standard_control()
1131 memcpy(unit->processing.bmControls, &buffer[8], n); in uvc_parse_standard_control()
1132 if (dev->uvc_version >= 0x0110) in uvc_parse_standard_control()
1133 unit->processing.bmVideoStandards = buffer[9+n]; in uvc_parse_standard_control()
1137 list_add_tail(&unit->list, &dev->entities); in uvc_parse_standard_control()
1147 udev->devnum, alts->desc.bInterfaceNumber); in uvc_parse_standard_control()
1148 return -EINVAL; in uvc_parse_standard_control()
1151 unit = uvc_alloc_entity(buffer[2], buffer[3], p + 1, n); in uvc_parse_standard_control()
1153 return -ENOMEM; in uvc_parse_standard_control()
1155 memcpy(unit->guid, &buffer[4], 16); in uvc_parse_standard_control()
1156 unit->extension.bNumControls = buffer[20]; in uvc_parse_standard_control()
1157 memcpy(unit->baSourceID, &buffer[22], p); in uvc_parse_standard_control()
1158 unit->extension.bControlSize = buffer[22+p]; in uvc_parse_standard_control()
1159 unit->extension.bmControls = (u8 *)unit + sizeof(*unit); in uvc_parse_standard_control()
1160 memcpy(unit->extension.bmControls, &buffer[23+p], n); in uvc_parse_standard_control()
1164 list_add_tail(&unit->list, &dev->entities); in uvc_parse_standard_control()
1179 struct usb_host_interface *alts = dev->intf->cur_altsetting; in uvc_parse_control()
1180 const unsigned char *buffer = alts->extra; in uvc_parse_control()
1181 int buflen = alts->extralen; in uvc_parse_control()
1192 buffer[1] != USB_DT_CS_INTERFACE) in uvc_parse_control()
1200 buflen -= buffer[0]; in uvc_parse_control()
1205 * Check if the optional status endpoint is present. Built-in iSight in uvc_parse_control()
1210 if (alts->desc.bNumEndpoints == 1 && in uvc_parse_control()
1211 !(dev->quirks & UVC_QUIRK_BUILTIN_ISIGHT)) { in uvc_parse_control()
1212 struct usb_host_endpoint *ep = &alts->endpoint[0]; in uvc_parse_control()
1213 struct usb_endpoint_descriptor *desc = &ep->desc; in uvc_parse_control()
1216 le16_to_cpu(desc->wMaxPacketSize) >= 8 && in uvc_parse_control()
1217 desc->bInterval != 0) { in uvc_parse_control()
1220 desc->bEndpointAddress); in uvc_parse_control()
1221 dev->int_ep = ep; in uvc_parse_control()
1228 /* -----------------------------------------------------------------------------
1229 * Privacy GPIO
1234 struct uvc_entity *unit = dev->gpio_unit; in uvc_gpio_event()
1241 new_val = gpiod_get_value_cansleep(unit->gpio.gpio_privacy); in uvc_gpio_event()
1243 /* GPIO entities are always on the first chain. */ in uvc_gpio_event()
1244 chain = list_first_entry(&dev->chains, struct uvc_video_chain, list); in uvc_gpio_event()
1245 uvc_ctrl_status_event(chain, unit->controls, &new_val); in uvc_gpio_event()
1251 if (cs != UVC_CT_PRIVACY_CONTROL || size < 1) in uvc_gpio_get_cur()
1252 return -EINVAL; in uvc_gpio_get_cur()
1254 *(u8 *)data = gpiod_get_value_cansleep(entity->gpio.gpio_privacy); in uvc_gpio_get_cur()
1263 return -EINVAL; in uvc_gpio_get_info()
1283 gpio_privacy = devm_gpiod_get_optional(&dev->udev->dev, "privacy", in uvc_gpio_parse()
1290 return dev_err_probe(&dev->udev->dev, irq, in uvc_gpio_parse()
1291 "No IRQ for privacy GPIO\n"); in uvc_gpio_parse()
1293 unit = uvc_alloc_entity(UVC_EXT_GPIO_UNIT, UVC_EXT_GPIO_UNIT_ID, 0, 1); in uvc_gpio_parse()
1295 return -ENOMEM; in uvc_gpio_parse()
1297 unit->gpio.gpio_privacy = gpio_privacy; in uvc_gpio_parse()
1298 unit->gpio.irq = irq; in uvc_gpio_parse()
1299 unit->gpio.bControlSize = 1; in uvc_gpio_parse()
1300 unit->gpio.bmControls = (u8 *)unit + sizeof(*unit); in uvc_gpio_parse()
1301 unit->gpio.bmControls[0] = 1; in uvc_gpio_parse()
1302 unit->get_cur = uvc_gpio_get_cur; in uvc_gpio_parse()
1303 unit->get_info = uvc_gpio_get_info; in uvc_gpio_parse()
1304 strscpy(unit->name, "GPIO", sizeof(unit->name)); in uvc_gpio_parse()
1306 list_add_tail(&unit->list, &dev->entities); in uvc_gpio_parse()
1308 dev->gpio_unit = unit; in uvc_gpio_parse()
1315 struct uvc_entity *unit = dev->gpio_unit; in uvc_gpio_init_irq()
1317 if (!unit || unit->gpio.irq < 0) in uvc_gpio_init_irq()
1320 return devm_request_threaded_irq(&dev->udev->dev, unit->gpio.irq, NULL, in uvc_gpio_init_irq()
1327 /* ------------------------------------------------------------------------
1335 * - one or more Output Terminals (USB Streaming or Display)
1336 * - zero or one Processing Unit
1337 * - zero, one or more single-input Selector Units
1338 * - zero or one multiple-input Selector Units, provided all inputs are
1340 * - zero, one or mode single-input Extension Units
1341 * - one or more Input Terminals (Camera, External or USB Streaming)
1345 * ITT_*(0) -> +---------+ +---------+ +---------+ -> TT_STREAMING(0)
1346 * ... | SU{0,1} | -> | PU{0,1} | -> | XU{0,n} | ...
1347 * ITT_*(n) -> +---------+ +---------+ +---------+ -> TT_STREAMING(n)
1349 * +---------+ +---------+ -> OTT_*(0)
1350 * TT_STREAMING -> | PU{0,1} | -> | XU{0,n} | ...
1351 * +---------+ +---------+ -> OTT_*(n)
1354 * Extension Units connected to the main chain as single-unit branches are
1355 * also supported. Single-input Selector Units are ignored.
1362 uvc_dbg_cont(PROBE, " <- XU %d", entity->id); in uvc_scan_chain_entity()
1364 if (entity->bNrInPins != 1) { in uvc_scan_chain_entity()
1365 uvc_dbg(chain->dev, DESCR, in uvc_scan_chain_entity()
1366 "Extension unit %d has more than 1 input pin\n", in uvc_scan_chain_entity()
1367 entity->id); in uvc_scan_chain_entity()
1368 return -1; in uvc_scan_chain_entity()
1374 uvc_dbg_cont(PROBE, " <- PU %d", entity->id); in uvc_scan_chain_entity()
1376 if (chain->processing != NULL) { in uvc_scan_chain_entity()
1377 uvc_dbg(chain->dev, DESCR, in uvc_scan_chain_entity()
1379 return -1; in uvc_scan_chain_entity()
1382 chain->processing = entity; in uvc_scan_chain_entity()
1386 uvc_dbg_cont(PROBE, " <- SU %d", entity->id); in uvc_scan_chain_entity()
1388 /* Single-input selector units are ignored. */ in uvc_scan_chain_entity()
1389 if (entity->bNrInPins == 1) in uvc_scan_chain_entity()
1392 if (chain->selector != NULL) { in uvc_scan_chain_entity()
1393 uvc_dbg(chain->dev, DESCR, in uvc_scan_chain_entity()
1395 return -1; in uvc_scan_chain_entity()
1398 chain->selector = entity; in uvc_scan_chain_entity()
1404 uvc_dbg_cont(PROBE, " <- IT %d\n", entity->id); in uvc_scan_chain_entity()
1411 uvc_dbg_cont(PROBE, " OT %d", entity->id); in uvc_scan_chain_entity()
1417 uvc_dbg_cont(PROBE, " <- IT %d\n", entity->id); in uvc_scan_chain_entity()
1419 uvc_dbg_cont(PROBE, " OT %d", entity->id); in uvc_scan_chain_entity()
1424 uvc_dbg(chain->dev, DESCR, in uvc_scan_chain_entity()
1427 return -1; in uvc_scan_chain_entity()
1430 list_add_tail(&entity->chain, &chain->entities); in uvc_scan_chain_entity()
1444 while (1) { in uvc_scan_chain_forward()
1445 forward = uvc_entity_by_reference(chain->dev, entity->id, in uvc_scan_chain_forward()
1451 if (forward->chain.next || forward->chain.prev) { in uvc_scan_chain_forward()
1452 uvc_dbg(chain->dev, DESCR, in uvc_scan_chain_forward()
1454 forward->id); in uvc_scan_chain_forward()
1455 return -EINVAL; in uvc_scan_chain_forward()
1460 if (forward->bNrInPins != 1) { in uvc_scan_chain_forward()
1461 uvc_dbg(chain->dev, DESCR, in uvc_scan_chain_forward()
1462 "Extension unit %d has more than 1 input pin\n", in uvc_scan_chain_forward()
1463 forward->id); in uvc_scan_chain_forward()
1464 return -EINVAL; in uvc_scan_chain_forward()
1480 source = uvc_entity_by_id(chain->dev, in uvc_scan_chain_forward()
1481 entity->baSourceID[0]); in uvc_scan_chain_forward()
1483 uvc_dbg(chain->dev, DESCR, in uvc_scan_chain_forward()
1485 forward->id); in uvc_scan_chain_forward()
1489 forward->baSourceID[0] = source->id; in uvc_scan_chain_forward()
1492 list_add_tail(&forward->chain, &chain->entities); in uvc_scan_chain_forward()
1494 uvc_dbg_cont(PROBE, " (->"); in uvc_scan_chain_forward()
1496 uvc_dbg_cont(PROBE, " XU %d", forward->id); in uvc_scan_chain_forward()
1497 found = 1; in uvc_scan_chain_forward()
1505 uvc_dbg(chain->dev, DESCR, in uvc_scan_chain_forward()
1507 forward->id); in uvc_scan_chain_forward()
1508 return -EINVAL; in uvc_scan_chain_forward()
1512 uvc_dbg(chain->dev, DESCR, in uvc_scan_chain_forward()
1514 entity->id, forward->id); in uvc_scan_chain_forward()
1518 list_add_tail(&forward->chain, &chain->entities); in uvc_scan_chain_forward()
1520 uvc_dbg_cont(PROBE, " (->"); in uvc_scan_chain_forward()
1522 uvc_dbg_cont(PROBE, " OT %d", forward->id); in uvc_scan_chain_forward()
1523 found = 1; in uvc_scan_chain_forward()
1538 int id = -EINVAL, i; in uvc_scan_chain_backward()
1543 id = entity->baSourceID[0]; in uvc_scan_chain_backward()
1547 /* Single-input selector units are ignored. */ in uvc_scan_chain_backward()
1548 if (entity->bNrInPins == 1) { in uvc_scan_chain_backward()
1549 id = entity->baSourceID[0]; in uvc_scan_chain_backward()
1553 uvc_dbg_cont(PROBE, " <- IT"); in uvc_scan_chain_backward()
1555 chain->selector = entity; in uvc_scan_chain_backward()
1556 for (i = 0; i < entity->bNrInPins; ++i) { in uvc_scan_chain_backward()
1557 id = entity->baSourceID[i]; in uvc_scan_chain_backward()
1558 term = uvc_entity_by_id(chain->dev, id); in uvc_scan_chain_backward()
1560 uvc_dbg(chain->dev, DESCR, in uvc_scan_chain_backward()
1562 entity->id, i); in uvc_scan_chain_backward()
1563 return -1; in uvc_scan_chain_backward()
1566 if (term->chain.next || term->chain.prev) { in uvc_scan_chain_backward()
1567 uvc_dbg(chain->dev, DESCR, in uvc_scan_chain_backward()
1569 term->id); in uvc_scan_chain_backward()
1570 return -EINVAL; in uvc_scan_chain_backward()
1573 uvc_dbg_cont(PROBE, " %d", term->id); in uvc_scan_chain_backward()
1575 list_add_tail(&term->chain, &chain->entities); in uvc_scan_chain_backward()
1591 id = UVC_ENTITY_IS_OTERM(entity) ? entity->baSourceID[0] : 0; in uvc_scan_chain_backward()
1600 entity = uvc_entity_by_id(chain->dev, id); in uvc_scan_chain_backward()
1602 uvc_dbg(chain->dev, DESCR, in uvc_scan_chain_backward()
1604 return -EINVAL; in uvc_scan_chain_backward()
1616 uvc_dbg(chain->dev, PROBE, "Scanning UVC chain:"); in uvc_scan_chain()
1623 if (entity->chain.next || entity->chain.prev) { in uvc_scan_chain()
1624 uvc_dbg(chain->dev, DESCR, in uvc_scan_chain()
1626 entity->id); in uvc_scan_chain()
1627 return -EINVAL; in uvc_scan_chain()
1632 return -EINVAL; in uvc_scan_chain()
1636 return -EINVAL; in uvc_scan_chain()
1641 return -EINVAL; in uvc_scan_chain()
1665 p += sprintf(p, "%u", term->id); in uvc_print_terms()
1668 return p - buffer; in uvc_print_terms()
1676 p += uvc_print_terms(&chain->entities, UVC_TERM_INPUT, p); in uvc_print_chain()
1677 p += sprintf(p, " -> "); in uvc_print_chain()
1678 uvc_print_terms(&chain->entities, UVC_TERM_OUTPUT, p); in uvc_print_chain()
1691 INIT_LIST_HEAD(&chain->entities); in uvc_alloc_chain()
1692 mutex_init(&chain->ctrl_mutex); in uvc_alloc_chain()
1693 chain->dev = dev; in uvc_alloc_chain()
1694 v4l2_prio_init(&chain->prio); in uvc_alloc_chain()
1709 * - Acer Integrated Camera (5986:055a)
1710 * - Realtek rtl157a7 (0bda:57a7)
1724 list_for_each_entry(entity, &dev->entities, list) { in uvc_scan_fallback()
1727 return -EINVAL; in uvc_scan_fallback()
1733 return -EINVAL; in uvc_scan_fallback()
1739 return -EINVAL; in uvc_scan_fallback()
1744 return -ENOMEM; in uvc_scan_fallback()
1758 list_for_each_entry_reverse(entity, &dev->entities, list) { in uvc_scan_fallback()
1759 if (entity->type != UVC_VC_PROCESSING_UNIT && in uvc_scan_fallback()
1760 entity->type != UVC_VC_EXTENSION_UNIT) in uvc_scan_fallback()
1763 if (entity->num_pads != 2) in uvc_scan_fallback()
1769 prev->baSourceID[0] = entity->id; in uvc_scan_fallback()
1776 prev->baSourceID[0] = iterm->id; in uvc_scan_fallback()
1778 list_add_tail(&chain->list, &dev->chains); in uvc_scan_fallback()
1787 return -EINVAL; in uvc_scan_fallback()
1800 list_for_each_entry(term, &dev->entities, list) { in uvc_scan_device()
1810 if (term->chain.next || term->chain.prev) in uvc_scan_device()
1815 return -ENOMEM; in uvc_scan_device()
1817 term->flags |= UVC_ENTITY_FLAG_DEFAULT; in uvc_scan_device()
1827 list_add_tail(&chain->list, &dev->chains); in uvc_scan_device()
1830 if (list_empty(&dev->chains)) in uvc_scan_device()
1833 if (list_empty(&dev->chains)) { in uvc_scan_device()
1834 dev_info(&dev->udev->dev, "No valid video chain found.\n"); in uvc_scan_device()
1835 return -1; in uvc_scan_device()
1838 /* Add GPIO entity to the first chain. */ in uvc_scan_device()
1839 if (dev->gpio_unit) { in uvc_scan_device()
1840 chain = list_first_entry(&dev->chains, in uvc_scan_device()
1842 list_add_tail(&dev->gpio_unit->chain, &chain->entities); in uvc_scan_device()
1848 /* ------------------------------------------------------------------------
1870 usb_put_intf(dev->intf); in uvc_delete()
1871 usb_put_dev(dev->udev); in uvc_delete()
1874 media_device_cleanup(&dev->mdev); in uvc_delete()
1877 list_for_each_safe(p, n, &dev->chains) { in uvc_delete()
1884 list_for_each_safe(p, n, &dev->entities) { in uvc_delete()
1894 list_for_each_safe(p, n, &dev->streams) { in uvc_delete()
1899 streaming->intf); in uvc_delete()
1909 struct uvc_device *dev = stream->dev; in uvc_release()
1911 kref_put(&dev->ref, uvc_delete); in uvc_release()
1921 list_for_each_entry(stream, &dev->streams, list) { in uvc_unregister_video()
1922 if (!video_is_registered(&stream->vdev)) in uvc_unregister_video()
1925 video_unregister_device(&stream->vdev); in uvc_unregister_video()
1926 video_unregister_device(&stream->meta.vdev); in uvc_unregister_video()
1933 if (dev->vdev.dev) in uvc_unregister_video()
1934 v4l2_device_unregister(&dev->vdev); in uvc_unregister_video()
1936 if (media_devnode_is_registered(dev->mdev.devnode)) in uvc_unregister_video()
1937 media_device_unregister(&dev->mdev); in uvc_unregister_video()
1959 * We already hold a reference to dev->udev. The video device will be in uvc_register_video_device()
1963 vdev->v4l2_dev = &dev->vdev; in uvc_register_video_device()
1964 vdev->fops = fops; in uvc_register_video_device()
1965 vdev->ioctl_ops = ioctl_ops; in uvc_register_video_device()
1966 vdev->release = uvc_release; in uvc_register_video_device()
1967 vdev->prio = &stream->chain->prio; in uvc_register_video_device()
1969 vdev->vfl_dir = VFL_DIR_TX; in uvc_register_video_device()
1971 vdev->vfl_dir = VFL_DIR_RX; in uvc_register_video_device()
1976 vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; in uvc_register_video_device()
1979 vdev->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING; in uvc_register_video_device()
1982 vdev->device_caps = V4L2_CAP_META_CAPTURE | V4L2_CAP_STREAMING; in uvc_register_video_device()
1986 strscpy(vdev->name, dev->name, sizeof(vdev->name)); in uvc_register_video_device()
1994 ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1); in uvc_register_video_device()
1996 dev_err(&stream->intf->dev, in uvc_register_video_device()
2002 kref_get(&dev->ref); in uvc_register_video_device()
2014 dev_err(&stream->intf->dev, in uvc_register_video()
2019 if (stream->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) in uvc_register_video()
2020 stream->chain->caps |= V4L2_CAP_VIDEO_CAPTURE in uvc_register_video()
2023 stream->chain->caps |= V4L2_CAP_VIDEO_OUTPUT; in uvc_register_video()
2028 return uvc_register_video_device(dev, stream, &stream->vdev, in uvc_register_video()
2029 &stream->queue, stream->type, in uvc_register_video()
2043 list_for_each_entry(term, &chain->entities, chain) { in uvc_register_terms()
2047 stream = uvc_stream_by_id(dev, term->id); in uvc_register_terms()
2049 dev_info(&dev->udev->dev, in uvc_register_terms()
2051 term->id); in uvc_register_terms()
2055 stream->chain = chain; in uvc_register_terms()
2066 term->vdev = &stream->vdev; in uvc_register_terms()
2077 list_for_each_entry(chain, &dev->chains, list) { in uvc_register_chains()
2085 dev_info(&dev->udev->dev, in uvc_register_chains()
2093 /* ------------------------------------------------------------------------
2105 (const struct uvc_device_info *)id->driver_info; in uvc_probe()
2112 return -ENOMEM; in uvc_probe()
2114 INIT_LIST_HEAD(&dev->entities); in uvc_probe()
2115 INIT_LIST_HEAD(&dev->chains); in uvc_probe()
2116 INIT_LIST_HEAD(&dev->streams); in uvc_probe()
2117 kref_init(&dev->ref); in uvc_probe()
2118 atomic_set(&dev->nmappings, 0); in uvc_probe()
2119 mutex_init(&dev->lock); in uvc_probe()
2121 dev->udev = usb_get_dev(udev); in uvc_probe()
2122 dev->intf = usb_get_intf(intf); in uvc_probe()
2123 dev->intfnum = intf->cur_altsetting->desc.bInterfaceNumber; in uvc_probe()
2124 dev->info = info ? info : &uvc_quirk_none; in uvc_probe()
2125 dev->quirks = uvc_quirks_param == -1 in uvc_probe()
2126 ? dev->info->quirks : uvc_quirks_param; in uvc_probe()
2128 if (id->idVendor && id->idProduct) in uvc_probe()
2130 udev->devpath, id->idVendor, id->idProduct); in uvc_probe()
2133 udev->devpath); in uvc_probe()
2135 if (udev->product != NULL) in uvc_probe()
2136 strscpy(dev->name, udev->product, sizeof(dev->name)); in uvc_probe()
2138 snprintf(dev->name, sizeof(dev->name), in uvc_probe()
2140 le16_to_cpu(udev->descriptor.idVendor), in uvc_probe()
2141 le16_to_cpu(udev->descriptor.idProduct)); in uvc_probe()
2148 if (intf->intf_assoc && intf->intf_assoc->iFunction != 0) in uvc_probe()
2149 function = intf->intf_assoc->iFunction; in uvc_probe()
2151 function = intf->cur_altsetting->desc.iInterface; in uvc_probe()
2155 strlcat(dev->name, ": ", sizeof(dev->name)); in uvc_probe()
2156 len = strlen(dev->name); in uvc_probe()
2157 usb_string(udev, function, dev->name + len, in uvc_probe()
2158 sizeof(dev->name) - len); in uvc_probe()
2163 dev->mdev.dev = &intf->dev; in uvc_probe()
2164 strscpy(dev->mdev.model, dev->name, sizeof(dev->mdev.model)); in uvc_probe()
2165 if (udev->serial) in uvc_probe()
2166 strscpy(dev->mdev.serial, udev->serial, in uvc_probe()
2167 sizeof(dev->mdev.serial)); in uvc_probe()
2168 usb_make_path(udev, dev->mdev.bus_info, sizeof(dev->mdev.bus_info)); in uvc_probe()
2169 dev->mdev.hw_revision = le16_to_cpu(udev->descriptor.bcdDevice); in uvc_probe()
2170 media_device_init(&dev->mdev); in uvc_probe()
2172 dev->vdev.mdev = &dev->mdev; in uvc_probe()
2187 dev_info(&dev->udev->dev, "Found UVC %u.%02x device %s (%04x:%04x)\n", in uvc_probe()
2188 dev->uvc_version >> 8, dev->uvc_version & 0xff, in uvc_probe()
2189 udev->product ? udev->product : "<unnamed>", in uvc_probe()
2190 le16_to_cpu(udev->descriptor.idVendor), in uvc_probe()
2191 le16_to_cpu(udev->descriptor.idProduct)); in uvc_probe()
2193 if (dev->quirks != dev->info->quirks) { in uvc_probe()
2194 dev_info(&dev->udev->dev, in uvc_probe()
2196 dev->quirks); in uvc_probe()
2197 dev_info(&dev->udev->dev, in uvc_probe()
2198 "Please report required quirks to the linux-media mailing list.\n"); in uvc_probe()
2201 if (dev->info->uvc_version) { in uvc_probe()
2202 dev->uvc_version = dev->info->uvc_version; in uvc_probe()
2203 dev_info(&dev->udev->dev, "Forcing UVC version to %u.%02x\n", in uvc_probe()
2204 dev->uvc_version >> 8, dev->uvc_version & 0xff); in uvc_probe()
2208 if (v4l2_device_register(&intf->dev, &dev->vdev) < 0) in uvc_probe()
2225 if (media_device_register(&dev->mdev) < 0) in uvc_probe()
2234 dev_info(&dev->udev->dev, in uvc_probe()
2241 dev_err(&dev->udev->dev, in uvc_probe()
2242 "Unable to request privacy GPIO IRQ (%d)\n", ret); in uvc_probe()
2246 if (dev->quirks & UVC_QUIRK_NO_RESET_RESUME) in uvc_probe()
2247 udev->quirks &= ~USB_QUIRK_RESET_RESUME; in uvc_probe()
2249 if (!(dev->quirks & UVC_QUIRK_DISABLE_AUTOSUSPEND)) in uvc_probe()
2258 kref_put(&dev->ref, uvc_delete); in uvc_probe()
2259 return -ENODEV; in uvc_probe()
2272 if (intf->cur_altsetting->desc.bInterfaceSubClass == in uvc_disconnect()
2277 kref_put(&dev->ref, uvc_delete); in uvc_disconnect()
2286 intf->cur_altsetting->desc.bInterfaceNumber); in uvc_suspend()
2289 if (intf->cur_altsetting->desc.bInterfaceSubClass == in uvc_suspend()
2291 mutex_lock(&dev->lock); in uvc_suspend()
2292 if (dev->users) in uvc_suspend()
2294 mutex_unlock(&dev->lock); in uvc_suspend()
2298 list_for_each_entry(stream, &dev->streams, list) { in uvc_suspend()
2299 if (stream->intf == intf) in uvc_suspend()
2305 return -EINVAL; in uvc_suspend()
2315 intf->cur_altsetting->desc.bInterfaceNumber); in __uvc_resume()
2317 if (intf->cur_altsetting->desc.bInterfaceSubClass == in __uvc_resume()
2325 mutex_lock(&dev->lock); in __uvc_resume()
2326 if (dev->users) in __uvc_resume()
2328 mutex_unlock(&dev->lock); in __uvc_resume()
2333 list_for_each_entry(stream, &dev->streams, list) { in __uvc_resume()
2334 if (stream->intf == intf) { in __uvc_resume()
2337 uvc_queue_streamoff(&stream->queue, in __uvc_resume()
2338 stream->queue.queue.type); in __uvc_resume()
2345 return -EINVAL; in __uvc_resume()
2355 return __uvc_resume(intf, 1); in uvc_reset_resume()
2358 /* ------------------------------------------------------------------------
2380 return -EINVAL; in uvc_clock_param_set()
2399 /* ------------------------------------------------------------------------
2439 .bInterfaceSubClass = 1,
2450 .bInterfaceSubClass = 1,
2459 .bInterfaceSubClass = 1,
2462 /* Microsoft Lifecam NX-6000 */
2468 .bInterfaceSubClass = 1,
2471 /* Microsoft Lifecam NX-3000 */
2477 .bInterfaceSubClass = 1,
2480 /* Microsoft Lifecam VX-7000 */
2486 .bInterfaceSubClass = 1,
2495 .bInterfaceSubClass = 1,
2504 .bInterfaceSubClass = 1,
2513 .bInterfaceSubClass = 1,
2521 .bInterfaceSubClass = 1,
2529 .bInterfaceSubClass = 1,
2537 .bInterfaceSubClass = 1,
2545 .bInterfaceSubClass = 1,
2553 .bInterfaceSubClass = 1,
2561 .bInterfaceSubClass = 1,
2571 .bInterfaceSubClass = 1,
2580 .bInterfaceSubClass = 1,
2589 .bInterfaceSubClass = 1,
2598 .bInterfaceSubClass = 1,
2607 .bInterfaceSubClass = 1,
2616 .bInterfaceSubClass = 1,
2619 /* Dell XPS m1530 */
2625 .bInterfaceSubClass = 1,
2634 .bInterfaceSubClass = 1,
2643 .bInterfaceSubClass = 1,
2652 .bInterfaceSubClass = 1,
2655 /* Dell XPS M1330 (OmniVision OV7670 webcam) */
2661 .bInterfaceSubClass = 1,
2664 /* Apple Built-In iSight */
2670 .bInterfaceSubClass = 1,
2674 /* Apple FaceTime HD Camera (Built-In) */
2680 .bInterfaceSubClass = 1,
2683 /* Apple Built-In iSight via iBridge */
2689 .bInterfaceSubClass = 1,
2698 .bInterfaceSubClass = 1,
2707 .bInterfaceSubClass = 1,
2716 .bInterfaceSubClass = 1,
2725 .bInterfaceSubClass = 1,
2728 /* ViMicro - Minoru3D */
2734 .bInterfaceSubClass = 1,
2737 /* ViMicro Venus - Minoru3D */
2743 .bInterfaceSubClass = 1,
2746 /* Ophir Optronics - SPCAM 620U */
2752 .bInterfaceSubClass = 1,
2761 .bInterfaceSubClass = 1,
2771 .bInterfaceSubClass = 1,
2780 .bInterfaceSubClass = 1,
2789 .bInterfaceSubClass = 1,
2798 .bInterfaceSubClass = 1,
2807 .bInterfaceSubClass = 1,
2816 .bInterfaceSubClass = 1,
2825 .bInterfaceSubClass = 1,
2834 .bInterfaceSubClass = 1,
2843 .bInterfaceSubClass = 1,
2852 .bInterfaceSubClass = 1,
2861 .bInterfaceSubClass = 1,
2871 .bInterfaceSubClass = 1,
2879 .bInterfaceSubClass = 1,
2882 /* Manta MM-353 Plako */
2888 .bInterfaceSubClass = 1,
2897 .bInterfaceSubClass = 1,
2906 .bInterfaceSubClass = 1,
2915 .bInterfaceSubClass = 1,
2925 .bInterfaceSubClass = 1,
2934 .bInterfaceSubClass = 1,
2943 .bInterfaceSubClass = 1,
2952 .bInterfaceSubClass = 1,
2963 .bInterfaceSubClass = 1,
2973 .bInterfaceSubClass = 1,
2982 .bInterfaceSubClass = 1,
2991 .bInterfaceSubClass = 1,
3000 .bInterfaceSubClass = 1,
3009 .bInterfaceSubClass = 1,
3018 .bInterfaceSubClass = 1,
3027 .bInterfaceSubClass = 1,
3036 .bInterfaceSubClass = 1,
3045 .bInterfaceSubClass = 1,
3054 .bInterfaceSubClass = 1,
3063 .bInterfaceSubClass = 1,
3072 .bInterfaceSubClass = 1,
3076 { USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_UNDEFINED) },
3077 { USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_15) },
3092 .supports_autosuspend = 1,