qubes-linux-kernel/patches.suse/uvcvideo-ignore-hue-control-for-5986-0241.patch
2011-04-19 22:09:59 +02:00

58 lines
1.9 KiB
Diff

From: Brandon Philips <bphilips@suse.de>
Subject: uvcvideo: ignore hue control for 5986:0241
References: bnc#499152
Patch-mainline: Never? I will submit upstream but there is probably a better fix
Querying the hue control on Bison 5986:0241 causes the chipset to
lockup. So, create a quirk that will avoid offering V4L2_CID_HUE to user
space.
Signed-off-by: Brandon Philips <bphilips@suse.de>
---
drivers/media/video/uvc/uvc_ctrl.c | 4 ++++
drivers/media/video/uvc/uvc_driver.c | 8 ++++++++
drivers/media/video/uvc/uvcvideo.h | 1 +
3 files changed, 13 insertions(+)
--- a/drivers/media/video/uvc/uvc_ctrl.c
+++ b/drivers/media/video/uvc/uvc_ctrl.c
@@ -862,6 +862,10 @@ int uvc_query_v4l2_ctrl(struct uvc_video
if (ret < 0)
return -ERESTARTSYS;
+ if ((chain->dev->quirks & UVC_QUIRK_HUE_EPIPE) &&
+ (v4l2_ctrl->id == V4L2_CID_HUE))
+ return -EINVAL;
+
ctrl = uvc_find_control(chain, v4l2_ctrl->id, &mapping);
if (ctrl == NULL) {
ret = -EINVAL;
--- a/drivers/media/video/uvc/uvc_driver.c
+++ b/drivers/media/video/uvc/uvc_driver.c
@@ -2239,6 +2239,14 @@ static struct usb_device_id uvc_ids[] =
.bInterfaceProtocol = 0,
.driver_info = UVC_QUIRK_PROBE_MINMAX
| UVC_QUIRK_IGNORE_SELECTOR_UNIT },
+ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
+ | USB_DEVICE_ID_MATCH_INT_INFO,
+ .idVendor = 0x5986,
+ .idProduct = 0x0241,
+ .bInterfaceClass = USB_CLASS_VIDEO,
+ .bInterfaceSubClass = 1,
+ .bInterfaceProtocol = 0,
+ .driver_info = UVC_QUIRK_HUE_EPIPE },
/* Generic USB Video Class */
{ USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, 0) },
{}
--- a/drivers/media/video/uvc/uvcvideo.h
+++ b/drivers/media/video/uvc/uvcvideo.h
@@ -182,6 +182,7 @@ struct uvc_xu_control {
#define UVC_QUIRK_FIX_BANDWIDTH 0x00000080
#define UVC_QUIRK_PROBE_DEF 0x00000100
#define UVC_QUIRK_RESTRICT_FRAME_RATE 0x00000200
+#define UVC_QUIRK_HUE_EPIPE 0x00000400
/* Format flags */
#define UVC_FMT_FLAG_COMPRESSED 0x00000001