diff options
Diffstat (limited to 'drivers/media/video/uvc')
-rw-r--r-- | drivers/media/video/uvc/uvc_ctrl.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index f54d06a8af92..626f4ad7e876 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c | |||
@@ -592,6 +592,7 @@ int uvc_query_v4l2_ctrl(struct uvc_video_device *video, | |||
592 | if (ctrl == NULL) | 592 | if (ctrl == NULL) |
593 | return -EINVAL; | 593 | return -EINVAL; |
594 | 594 | ||
595 | memset(v4l2_ctrl, 0, sizeof *v4l2_ctrl); | ||
595 | v4l2_ctrl->id = mapping->id; | 596 | v4l2_ctrl->id = mapping->id; |
596 | v4l2_ctrl->type = mapping->v4l2_type; | 597 | v4l2_ctrl->type = mapping->v4l2_type; |
597 | strncpy(v4l2_ctrl->name, mapping->name, sizeof v4l2_ctrl->name); | 598 | strncpy(v4l2_ctrl->name, mapping->name, sizeof v4l2_ctrl->name); |
@@ -608,7 +609,8 @@ int uvc_query_v4l2_ctrl(struct uvc_video_device *video, | |||
608 | v4l2_ctrl->default_value = uvc_get_le_value(data, mapping); | 609 | v4l2_ctrl->default_value = uvc_get_le_value(data, mapping); |
609 | } | 610 | } |
610 | 611 | ||
611 | if (mapping->v4l2_type == V4L2_CTRL_TYPE_MENU) { | 612 | switch (mapping->v4l2_type) { |
613 | case V4L2_CTRL_TYPE_MENU: | ||
612 | v4l2_ctrl->minimum = 0; | 614 | v4l2_ctrl->minimum = 0; |
613 | v4l2_ctrl->maximum = mapping->menu_count - 1; | 615 | v4l2_ctrl->maximum = mapping->menu_count - 1; |
614 | v4l2_ctrl->step = 1; | 616 | v4l2_ctrl->step = 1; |
@@ -622,6 +624,15 @@ int uvc_query_v4l2_ctrl(struct uvc_video_device *video, | |||
622 | } | 624 | } |
623 | 625 | ||
624 | return 0; | 626 | return 0; |
627 | |||
628 | case V4L2_CTRL_TYPE_BOOLEAN: | ||
629 | v4l2_ctrl->minimum = 0; | ||
630 | v4l2_ctrl->maximum = 1; | ||
631 | v4l2_ctrl->step = 1; | ||
632 | return 0; | ||
633 | |||
634 | default: | ||
635 | break; | ||
625 | } | 636 | } |
626 | 637 | ||
627 | if (ctrl->info->flags & UVC_CONTROL_GET_MIN) { | 638 | if (ctrl->info->flags & UVC_CONTROL_GET_MIN) { |