Skip to content

Commit

Permalink
[media] uvcvideo: GET_RES should only be checked for BITMAP type menu…
Browse files Browse the repository at this point in the history
… controls

Currently it is also being checked for non BITMAP type menu controls,
breaking the logitech LED control menu added by uvcdynctrl, as well as
potentially breaking the powerline frequency menu.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Nov 7, 2011
1 parent b3f4e1e commit 241fa6e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/media/video/uvc/uvc_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,8 @@ int uvc_query_v4l2_menu(struct uvc_video_chain *chain,

menu_info = &mapping->menu_info[query_menu->index];

if (ctrl->info.flags & UVC_CTRL_FLAG_GET_RES) {
if (mapping->data_type == UVC_CTRL_DATA_TYPE_BITMASK &&
(ctrl->info.flags & UVC_CTRL_FLAG_GET_RES)) {
s32 bitmap;

if (!ctrl->cached) {
Expand Down Expand Up @@ -1225,7 +1226,8 @@ int uvc_ctrl_set(struct uvc_video_chain *chain,
/* 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 (mapping->data_type == UVC_CTRL_DATA_TYPE_BITMASK &&
(ctrl->info.flags & UVC_CTRL_FLAG_GET_RES)) {
if (!ctrl->cached) {
ret = uvc_ctrl_populate_cache(chain, ctrl);
if (ret < 0)
Expand Down

0 comments on commit 241fa6e

Please sign in to comment.