diff options
author | Ricardo Ribalda <ribalda@chromium.org> | 2022-06-07 14:44:00 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-07-16 08:51:04 +0100 |
commit | 382075604a688b926aa90de7c857d58c53cd4854 (patch) | |
tree | 36286168129cf016b4ea324678bc384b4177ecca /drivers/media/usb | |
parent | 86f7ef77315687df144042762325c53d9a3a28c9 (diff) | |
download | linux-stable-382075604a688b926aa90de7c857d58c53cd4854.tar.gz linux-stable-382075604a688b926aa90de7c857d58c53cd4854.tar.bz2 linux-stable-382075604a688b926aa90de7c857d58c53cd4854.zip |
media: uvcvideo: Limit power line control for Quanta UVC Webcam
The device does not implement the power line control correctly. Add a
corresponding control mapping override.
Bus 001 Device 003: ID 0408:3090 Quanta Computer, Inc. USB2.0 HD UVC WebCam
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x0408 Quanta Computer, Inc.
idProduct 0x3090
bcdDevice 0.04
iManufacturer 3 Quanta
iProduct 1 USB2.0 HD UVC WebCam
iSerial 2 0x0001
bNumConfigurations 1
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r-- | drivers/media/usb/uvc/uvc_driver.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 20d80d810d1f..c4f26b446c26 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -2661,6 +2661,30 @@ MODULE_PARM_DESC(timeout, "Streaming control requests timeout"); * Driver initialization and cleanup */ +static const struct uvc_menu_info power_line_frequency_controls_limited[] = { + { 1, "50 Hz" }, + { 2, "60 Hz" }, +}; + +static const struct uvc_control_mapping uvc_ctrl_power_line_mapping_limited = { + .id = V4L2_CID_POWER_LINE_FREQUENCY, + .entity = UVC_GUID_UVC_PROCESSING, + .selector = UVC_PU_POWER_LINE_FREQUENCY_CONTROL, + .size = 2, + .offset = 0, + .v4l2_type = V4L2_CTRL_TYPE_MENU, + .data_type = UVC_CTRL_DATA_TYPE_ENUM, + .menu_info = power_line_frequency_controls_limited, + .menu_count = ARRAY_SIZE(power_line_frequency_controls_limited), +}; + +static const struct uvc_device_info uvc_ctrl_power_line_limited = { + .mappings = (const struct uvc_control_mapping *[]) { + &uvc_ctrl_power_line_mapping_limited, + NULL, /* Sentinel */ + }, +}; + static const struct uvc_device_info uvc_quirk_probe_minmax = { .quirks = UVC_QUIRK_PROBE_MINMAX, }; @@ -2691,6 +2715,15 @@ static const struct uvc_device_info uvc_quirk_force_y8 = { * though they are compliant. */ static const struct usb_device_id uvc_ids[] = { + /* Quanta USB2.0 HD UVC Webcam */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x0408, + .idProduct = 0x3090, + .bInterfaceClass = USB_CLASS_VIDEO, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .driver_info = (kernel_ulong_t)&uvc_ctrl_power_line_limited }, /* LogiLink Wireless Webcam */ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, |