Laurent,

The problem with usb_match_id is that the second argument must be a
0/NULL terminated array of struct usb_device_id and you are only
passing a single struct.
The attached patch makes your code work with usb_match_id.
I still think the first patch is better, but since both of them are
working, it doesn't really matter :D.

Best regards,
Paulo

2009/12/5 Paulo Assis <pj.as...@gmail.com>:
> OK,
> The following patch works for me.
> usb_match_id doesn't seem to be working properly, so I'm using
> dev->udev->descriptor instead.
> I'm  also not a big fan of "continue" so I change it to a simple
> if..else statement, this shouldn't make any difference (it's just easy
> for read, at least for me :D)
>
> Best regards
> Paulo
>
> ---------- Forwarded message ----------
> From: Paulo Assis <pj.as...@gmail.com>
> Date: 2009/12/5
> Subject: control black list
> To: linux-uvc development discussions <linux-uvc-devel@lists.berlios.de>
>
>
> Laurent Hi,
>
> I've just discovered that all my camera models have the WB Temperature
> and Hue controls black listed, I would suppose that the control black
> list was device specific.
> For some reason the device id's are not taken into account and the
> controls get blacklisted in all models.
> If I have time today, I'll check the reason and post a patch to fix the issue.
>
> Best regards,
> Paulo
>
--- v4l-dvb/linux/drivers/media/video/uvc/uvc_ctrl.c	2009-12-05 14:56:27.218222463 +0000
+++ v4l-dvb_patched/linux/drivers/media/video/uvc/uvc_ctrl.c	2009-12-05 21:58:38.413223478 +0000
@@ -1377,11 +1377,11 @@
 uvc_ctrl_prune_entity(struct uvc_device *dev, struct uvc_entity *entity)
 {
 	static const struct {
-		struct usb_device_id id;
+		struct usb_device_id id[2];
 		u8 index;
 	} blacklist[] = {
-		{ { USB_DEVICE(0x1c4f, 0x3000) }, 6 }, /* WB Temperature */
-		{ { USB_DEVICE(0x5986, 0x0241) }, 2 }, /* Hue */
+		{ { { USB_DEVICE(0x1c4f, 0x3000) },  }, 6 }, /* WB Temperature */
+		{ { { USB_DEVICE(0x5986, 0x0241) },  }, 2 }, /* Hue */
 	};
 
 	u8 *controls;
@@ -1395,7 +1395,7 @@
 	size = entity->processing.bControlSize;
 
 	for (i = 0; i < ARRAY_SIZE(blacklist); ++i) {
-		if (!usb_match_id(dev->intf, &blacklist[i].id))
+		if (!usb_match_id(dev->intf, blacklist[i].id))
 			continue;
 
 		if (blacklist[i].index >= 8 * size ||
_______________________________________________
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to