aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/uvc/uvc_ctrl.c12
-rw-r--r--include/linux/usb/video.h7
2 files changed, 13 insertions, 6 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
index bd72100a21dd..fa06cf512ecf 100644
--- a/drivers/media/video/uvc/uvc_ctrl.c
+++ b/drivers/media/video/uvc/uvc_ctrl.c
@@ -1324,9 +1324,8 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev,
1324 /* Check if the device control information and length match 1324 /* Check if the device control information and length match
1325 * the user supplied information. 1325 * the user supplied information.
1326 */ 1326 */
1327 __u32 flags;
1328 __le16 size; 1327 __le16 size;
1329 __u8 inf; 1328 __u8 _info;
1330 1329
1331 ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id, 1330 ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id,
1332 dev->intfnum, info->selector, (__u8 *)&size, 2); 1331 dev->intfnum, info->selector, (__u8 *)&size, 2);
@@ -1345,7 +1344,7 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev,
1345 } 1344 }
1346 1345
1347 ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id, 1346 ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id,
1348 dev->intfnum, info->selector, &inf, 1); 1347 dev->intfnum, info->selector, &_info, 1);
1349 if (ret < 0) { 1348 if (ret < 0) {
1350 uvc_trace(UVC_TRACE_CONTROL, 1349 uvc_trace(UVC_TRACE_CONTROL,
1351 "GET_INFO failed on control %pUl/%u (%d).\n", 1350 "GET_INFO failed on control %pUl/%u (%d).\n",
@@ -1353,9 +1352,10 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev,
1353 return; 1352 return;
1354 } 1353 }
1355 1354
1356 flags = info->flags; 1355 if (((info->flags & UVC_CONTROL_GET_CUR) &&
1357 if (((flags & UVC_CONTROL_GET_CUR) && !(inf & (1 << 0))) || 1356 !(_info & UVC_CONTROL_CAP_GET)) ||
1358 ((flags & UVC_CONTROL_SET_CUR) && !(inf & (1 << 1)))) { 1357 ((info->flags & UVC_CONTROL_SET_CUR) &&
1358 !(_info & UVC_CONTROL_CAP_SET))) {
1359 uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u flags " 1359 uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u flags "
1360 "don't match supported operations.\n", 1360 "don't match supported operations.\n",
1361 info->entity, info->selector); 1361 info->entity, info->selector);
diff --git a/include/linux/usb/video.h b/include/linux/usb/video.h
index be436d9ee479..2d5b7fc6a265 100644
--- a/include/linux/usb/video.h
+++ b/include/linux/usb/video.h
@@ -160,5 +160,12 @@
160#define UVC_STATUS_TYPE_CONTROL 1 160#define UVC_STATUS_TYPE_CONTROL 1
161#define UVC_STATUS_TYPE_STREAMING 2 161#define UVC_STATUS_TYPE_STREAMING 2
162 162
163/* 4.1.2. Control Capabilities */
164#define UVC_CONTROL_CAP_GET (1 << 0)
165#define UVC_CONTROL_CAP_SET (1 << 1)
166#define UVC_CONTROL_CAP_DISABLED (1 << 2)
167#define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)
168#define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)
169
163#endif /* __LINUX_USB_VIDEO_H */ 170#endif /* __LINUX_USB_VIDEO_H */
164 171