From 6823582c9efa696e4ec1d6532727a845038d215e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 23 Jul 2010 10:06:08 -0300 Subject: [PATCH] --- yaml --- r: 219311 b: refs/heads/master c: fa34168bd8979ef00dbc35dbca6d7564d4e42798 h: refs/heads/master i: 219309: 77b0b05c5c38a0801c42d8ad9fa40abb8db909cc 219307: be69d587567b36b5d816e38cd0306e8f8b5485b6 219303: 5bd2e322b153e33eb9d8c00b34f44978f8a2085b 219295: d6da1cba2f6a35dc9c78fd1b8cb84670cf05fd6f v: v3 --- [refs] | 2 +- trunk/drivers/media/video/uvc/uvc_ctrl.c | 36 ++++++++++++++++++------ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index a6e4a913778b..12926a06abda 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9c84d89bf13b702ca0e0db5eb3880300c4bd58f4 +refs/heads/master: fa34168bd8979ef00dbc35dbca6d7564d4e42798 diff --git a/trunk/drivers/media/video/uvc/uvc_ctrl.c b/trunk/drivers/media/video/uvc/uvc_ctrl.c index a350fad0db43..bce29fdde52d 100644 --- a/trunk/drivers/media/video/uvc/uvc_ctrl.c +++ b/trunk/drivers/media/video/uvc/uvc_ctrl.c @@ -1499,26 +1499,46 @@ int uvc_ctrl_add_mapping(struct uvc_control_mapping *mapping) static void uvc_ctrl_prune_entity(struct uvc_device *dev, struct uvc_entity *entity) { - static const struct { + struct uvc_ctrl_blacklist { struct usb_device_id id; u8 index; - } blacklist[] = { + }; + + static const struct uvc_ctrl_blacklist processing_blacklist[] = { { { USB_DEVICE(0x13d3, 0x509b) }, 9 }, /* Gain */ { { USB_DEVICE(0x1c4f, 0x3000) }, 6 }, /* WB Temperature */ { { USB_DEVICE(0x5986, 0x0241) }, 2 }, /* Hue */ }; + static const struct uvc_ctrl_blacklist camera_blacklist[] = { + { { USB_DEVICE(0x06f8, 0x3005) }, 9 }, /* Zoom, Absolute */ + }; - u8 *controls; + const struct uvc_ctrl_blacklist *blacklist; unsigned int size; + unsigned int count; unsigned int i; + u8 *controls; - if (UVC_ENTITY_TYPE(entity) != UVC_VC_PROCESSING_UNIT) - return; + switch (UVC_ENTITY_TYPE(entity)) { + case UVC_VC_PROCESSING_UNIT: + blacklist = processing_blacklist; + count = ARRAY_SIZE(processing_blacklist); + controls = entity->processing.bmControls; + size = entity->processing.bControlSize; + break; + + case UVC_ITT_CAMERA: + blacklist = camera_blacklist; + count = ARRAY_SIZE(camera_blacklist); + controls = entity->camera.bmControls; + size = entity->camera.bControlSize; + break; - controls = entity->processing.bmControls; - size = entity->processing.bControlSize; + default: + return; + } - for (i = 0; i < ARRAY_SIZE(blacklist); ++i) { + for (i = 0; i < count; ++i) { if (!usb_match_one_id(dev->intf, &blacklist[i].id)) continue;