Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202080
b: refs/heads/master
c: 1b4e21c
h: refs/heads/master
v: v3
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed Aug 2, 2010
1 parent c01cb2c commit a877b8b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 561474c2d2a1e212ea186e0b65cc69fb330e7bd5
refs/heads/master: 1b4e21c4f62eae6bdcb3e7bfdfc52171a24f3689
12 changes: 6 additions & 6 deletions trunk/drivers/media/video/uvc/uvc_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1324,9 +1324,8 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev,
/* Check if the device control information and length match
* the user supplied information.
*/
__u32 flags;
__le16 size;
__u8 inf;
__u8 _info;

ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id,
dev->intfnum, info->selector, (__u8 *)&size, 2);
Expand All @@ -1345,17 +1344,18 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev,
}

ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id,
dev->intfnum, info->selector, &inf, 1);
dev->intfnum, info->selector, &_info, 1);
if (ret < 0) {
uvc_trace(UVC_TRACE_CONTROL,
"GET_INFO failed on control %pUl/%u (%d).\n",
info->entity, info->selector, ret);
return;
}

flags = info->flags;
if (((flags & UVC_CONTROL_GET_CUR) && !(inf & (1 << 0))) ||
((flags & UVC_CONTROL_SET_CUR) && !(inf & (1 << 1)))) {
if (((info->flags & UVC_CONTROL_GET_CUR) &&
!(_info & UVC_CONTROL_CAP_GET)) ||
((info->flags & UVC_CONTROL_SET_CUR) &&
!(_info & UVC_CONTROL_CAP_SET))) {
uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u flags "
"don't match supported operations.\n",
info->entity, info->selector);
Expand Down
7 changes: 7 additions & 0 deletions trunk/include/linux/usb/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,12 @@
#define UVC_STATUS_TYPE_CONTROL 1
#define UVC_STATUS_TYPE_STREAMING 2

/* 4.1.2. Control Capabilities */
#define UVC_CONTROL_CAP_GET (1 << 0)
#define UVC_CONTROL_CAP_SET (1 << 1)
#define UVC_CONTROL_CAP_DISABLED (1 << 2)
#define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)
#define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)

#endif /* __LINUX_USB_VIDEO_H */

0 comments on commit a877b8b

Please sign in to comment.