diff options
author | Hans de Goede <hdegoede@redhat.com> | 2010-05-19 19:15:00 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 14:33:25 -0400 |
commit | 3653639e5daf2ac5f4763e4f1b6cb57538184be9 (patch) | |
tree | d80eb99b2e9ab315de40f3068af8a790b1378261 /drivers | |
parent | e56be916660da811fe4e830dfb958f13af361d59 (diff) |
V4L/DVB: uvcvideo: Make button controls work properly
According to the v4l2 spec, writing any value to a button control should
result in the action belonging to the button control being triggered.
UVC cams however want to see a 1 written, this patch fixes this by
overriding whatever value user space passed in with -1 (0xffffffff) when
the control is a button control.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/uvc/uvc_ctrl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index fcfcfbce0a2d..4e6d484911fe 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c | |||
@@ -698,6 +698,14 @@ static void uvc_set_le_value(struct uvc_control_mapping *mapping, | |||
698 | int offset = mapping->offset; | 698 | int offset = mapping->offset; |
699 | __u8 mask; | 699 | __u8 mask; |
700 | 700 | ||
701 | /* According to the v4l2 spec, writing any value to a button control | ||
702 | * should result in the action belonging to the button control being | ||
703 | * triggered. UVC devices however want to see a 1 written -> override | ||
704 | * value. | ||
705 | */ | ||
706 | if (mapping->v4l2_type == V4L2_CTRL_TYPE_BUTTON) | ||
707 | value = -1; | ||
708 | |||
701 | data += offset / 8; | 709 | data += offset / 8; |
702 | offset &= 7; | 710 | offset &= 7; |
703 | 711 | ||