aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-31 06:38:04 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-31 06:38:04 -0400
commit5fbf24659b75356e2142e1f1b88f67b34cbc3e75 (patch)
tree0e470e4cc89b72e3d74939f8c39396a6a0bebb3a /drivers/media/video/uvc
parentd89961e2dc87b6e30b8e3f60bd2af5cd92cf4643 (diff)
parent6e86841d05f371b5b9b86ce76c02aaee83352298 (diff)
Merge branch 'linus' into x86/xen
Diffstat (limited to 'drivers/media/video/uvc')
-rw-r--r--drivers/media/video/uvc/uvc_ctrl.c15
-rw-r--r--drivers/media/video/uvc/uvc_driver.c4
-rw-r--r--drivers/media/video/uvc/uvc_v4l2.c1
3 files changed, 15 insertions, 5 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
index 3ae95512666f..626f4ad7e876 100644
--- a/drivers/media/video/uvc/uvc_ctrl.c
+++ b/drivers/media/video/uvc/uvc_ctrl.c
@@ -195,8 +195,8 @@ static struct uvc_menu_info power_line_frequency_controls[] = {
195}; 195};
196 196
197static struct uvc_menu_info exposure_auto_controls[] = { 197static struct uvc_menu_info exposure_auto_controls[] = {
198 { 1, "Manual Mode" },
199 { 2, "Auto Mode" }, 198 { 2, "Auto Mode" },
199 { 1, "Manual Mode" },
200 { 4, "Shutter Priority Mode" }, 200 { 4, "Shutter Priority Mode" },
201 { 8, "Aperture Priority Mode" }, 201 { 8, "Aperture Priority Mode" },
202}; 202};
@@ -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) {
diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c
index f2b2983fe062..b3c4d75e8490 100644
--- a/drivers/media/video/uvc/uvc_driver.c
+++ b/drivers/media/video/uvc/uvc_driver.c
@@ -1458,9 +1458,7 @@ static int uvc_register_video(struct uvc_device *dev)
1458 * unregistered before the reference is released, so we don't need to 1458 * unregistered before the reference is released, so we don't need to
1459 * get another one. 1459 * get another one.
1460 */ 1460 */
1461 vdev->dev = &dev->intf->dev; 1461 vdev->parent = &dev->intf->dev;
1462 vdev->type = 0;
1463 vdev->type2 = 0;
1464 vdev->minor = -1; 1462 vdev->minor = -1;
1465 vdev->fops = &uvc_fops; 1463 vdev->fops = &uvc_fops;
1466 vdev->release = video_device_release; 1464 vdev->release = video_device_release;
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c
index b5a11eb8f9fa..d7bd71be40a9 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -23,6 +23,7 @@
23#include <asm/atomic.h> 23#include <asm/atomic.h>
24 24
25#include <media/v4l2-common.h> 25#include <media/v4l2-common.h>
26#include <media/v4l2-ioctl.h>
26 27
27#include "uvcvideo.h" 28#include "uvcvideo.h"
28 29