Re: [PATCH] usb: Add USB_QUIRK_RESET_RESUME for all Logitech UVC webcams

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 17 Jul 2012, Laurent Pinchart wrote:

> Most Logitech UVC webcams (both early models that don't advertise UVC
> compatibility and newer UVC-advertised devices) require the RESET_RESUME
> quirk. Instead of listing each and every model, match the devices based
> on the UVC interface information.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> ---
>  drivers/usb/core/quirks.c |   86 +++++++++++++--------------------------------
>  1 files changed, 24 insertions(+), 61 deletions(-)
> 
> Alan, what do you think about this approach ? I'm not sure whether we need to
> include the early UVC models that advertise a vendor-specific class in the
> list.

The general approach is okay.  The details aren't quite right.

Are the 0x08c2 - 0x08c7 products the ones with a vendor-specific class?

> @@ -153,31 +116,31 @@ static const struct usb_device_id usb_quirk_list[] = {
>  	/* INTEL VALUE SSD */
>  	{ USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
>  
> +	/* Logitech UVC Cameras */
> +	{ .match_flags		= USB_DEVICE_ID_MATCH_VENDOR
> +				| USB_DEVICE_ID_MATCH_INT_INFO,
> +	  .idVendor		= 0x046d,
> +	  .bInterfaceClass	= USB_CLASS_VIDEO,
> +	  .bInterfaceSubClass	= 1,
> +	  .bInterfaceProtocol	= 0,
> +	  .driver_info		= USB_QUIRK_RESET_RESUME },
> +

usb_match_device() doesn't pay attention to the MATCH_INT_INFO flag.  
Therefore this entry would end up matching every Logitech device.

In fact, at the time usb_detect_quirks() gets called we haven't yet
read in the device's config descriptors, so matching based on interface
info won't work.  It looks like we need a second routine,
usb_detect_interface_quirks(), which would be called at the end of
usb_enumerate_device(), along with a second id table.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux