| From 9a9117b85ee716ea46b3beabcab0aa9b729dc8ce Mon Sep 17 00:00:00 2001 |
| From: Ricardo Ribalda <ribalda@chromium.org> |
| Date: Fri, 4 Nov 2022 10:42:50 +0100 |
| Subject: [PATCH] BACKPORT: FROMLIST: media: uvcvideo: Limit power line control |
| for Lenovo Integrated Camera |
| |
| The device does not implement the power line control correctly. Add a |
| corresponding control mapping override. |
| |
| Bus 003 Device 002: ID 30c9:0093 Lenovo Integrated Camera |
| Device Descriptor: |
| bLength 18 |
| bDescriptorType 1 |
| bcdUSB 2.01 |
| bDeviceClass 239 Miscellaneous Device |
| bDeviceSubClass 2 |
| bDeviceProtocol 1 Interface Association |
| bMaxPacketSize0 64 |
| idVendor 0x30c9 |
| idProduct 0x0093 |
| bcdDevice 0.07 |
| iManufacturer 3 Lenovo |
| iProduct 1 Integrated Camera |
| iSerial 2 8SSC21J75356V1SR2830069 |
| bNumConfigurations 1 |
| |
| Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> |
| (am from https://patchwork.kernel.org/patch/13031551/) |
| (also found at https://lore.kernel.org/r/20221101-easycam-v2-2-5956414a608c@chromium.org) |
| |
| UPSTREAM-TASK=b:255969015 |
| BUG=b:233211200 |
| TEST=v4l2-compliance on pujjoteen15w |
| |
| Change-Id: I70363ae01f5f83949acef4ffaadfd1f0d4de03ad |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4003335 |
| Commit-Queue: Ricardo Ribalda <ribalda@chromium.org> |
| Tested-by: Ricardo Ribalda <ribalda@chromium.org> |
| Auto-Submit: Ricardo Ribalda <ribalda@chromium.org> |
| Reviewed-by: Yunke Cao <yunkec@chromium.org> |
| --- |
| drivers/media/usb/uvc/uvc_driver.c | 16 ++++++++++++++++ |
| 1 file changed, 16 insertions(+) |
| |
| diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c |
| index 503403e964f4ada99360679e018deb95937e0d8e..81f987951c72627781d0a9d2e9aedd6e04284569 100644 |
| --- a/drivers/media/usb/uvc/uvc_driver.c |
| +++ b/drivers/media/usb/uvc/uvc_driver.c |
| @@ -2379,6 +2379,22 @@ static const struct uvc_device_info uvc_ctrl_power_line_limited = { |
| NULL, /* Sentinel */ |
| }, |
| }; |
| +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_uvc11 = { |
| .mappings = (const struct uvc_control_mapping *[]) { |
| -- |
| 2.34.1 |
| |