Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250271
b: refs/heads/master
c: f411f10
h: refs/heads/master
i:
  250269: 17d1b94
  250267: d827236
  250263: 8f2efea
  250255: b685c43
  250239: 745c185
v: v3
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent 9f19578 commit b5df8ab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc2d573fb4e65393688d32bc128c70ddd8ecccc6
refs/heads/master: f411f103822379bab356345430f097bdae3440e5
17 changes: 17 additions & 0 deletions trunk/drivers/media/video/uvc/uvc_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,23 @@ int uvc_ctrl_set(struct uvc_video_chain *chain,
if (xctrl->value < 0 || xctrl->value >= mapping->menu_count)
return -ERANGE;
value = mapping->menu_info[xctrl->value].value;

/* Valid menu indices are reported by the GET_RES request for
* UVC controls that support it.
*/
if (ctrl->info.flags & UVC_CTRL_FLAG_GET_RES) {
if (!ctrl->cached) {
ret = uvc_ctrl_populate_cache(chain, ctrl);
if (ret < 0)
return ret;
}

step = mapping->get(mapping, UVC_GET_RES,
uvc_ctrl_data(ctrl, UVC_CTRL_DATA_RES));
if (!(step & value))
return -ERANGE;
}

break;

default:
Expand Down

0 comments on commit b5df8ab

Please sign in to comment.