Skip to contentSkip to conversation

media: uvcvideo: Fix power line control for a Chicony camera

PATCH In review Ricardo Ribalda 2 participants 3 messages Sep 5, 2023 – Sep 6, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 media: uvcvideo: Fix power line control for a Chicony camera

The device does not implement the control properly.

Fixes v4l2-compliance error:

info: checking control 'Power Line Frequency' (0x00980918)
fail: v4l2-test-controls.cpp(552): could not set valid menu item 3

---
This camera, like other Chicony devices, do not implement properly the Power Line Frequency control.

This time, I do not have direct access to the device, just to the
report, but since other devices from the same family are showing the
same error, it is safe to assume that the same fix will work here.
---
Changes in v2:
- Fix IntefaceProtocol, the camera is uvc1.5
- I managed to write 0 to the control, so the proper quirk is uvc11 not limited
- Changes by Laurent:
- Rename device
- s/v4l/v4l2
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 drivers/media/usb/uvc/uvc_driver.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +9 -0
index 08fcd2ffa727..4b5ea3501753 100644
@@ -2592,6 +2592,15 @@ static const struct usb_device_id uvc_ids[] = {
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= (kernel_ulong_t)&uvc_ctrl_power_line_limited },
+	/* Chicony Electronics Co., Ltd Integrated Camera */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x04f2,
+	  .idProduct		= 0xb67c,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= UVC_PC_PROTOCOL_15,
+	  .driver_info		= (kernel_ulong_t)&uvc_ctrl_power_line_uvc11 },
 	/* Chicony EasyCamera */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,

---
base-commit: 4853c74bd7ab7fdb83f319bd9ace8a08c031e9b6
change-id: 20230817-chicony-9c35f2046c6f

Best regards,

Signature · 1 line
Ricardo Ribalda <[email protected]>
maintainer
#1 lore raw

Hi Ricardo,

Quoted 9 lines · Ricardo Ribalda

The device does not implement the control properly.

Fixes v4l2-compliance error:

info: checking control 'Power Line Frequency' (0x00980918)
fail: v4l2-test-controls.cpp(552): could not set valid menu item 3

This still applies :-)

I've taken the patch in my tree and will push it for v6.7.

Quoted 44 lines

---
This camera, like other Chicony devices, do not implement properly the Power Line Frequency control.

This time, I do not have direct access to the device, just to the
report, but since other devices from the same family are showing the
same error, it is safe to assume that the same fix will work here.
---
Changes in v2:
- Fix IntefaceProtocol, the camera is uvc1.5
- I managed to write 0 to the control, so the proper quirk is uvc11 not limited
- Changes by Laurent:
- Rename device
- s/v4l/v4l2
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 drivers/media/usb/uvc/uvc_driver.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +9 -1
index 08fcd2ffa727..4b5ea3501753 100644
@@ -2592,6 +2592,15 @@ static const struct usb_device_id uvc_ids[] = {
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= (kernel_ulong_t)&uvc_ctrl_power_line_limited },
+	/* Chicony Electronics Co., Ltd Integrated Camera */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x04f2,
+	  .idProduct		= 0xb67c,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= UVC_PC_PROTOCOL_15,
+	  .driver_info		= (kernel_ulong_t)&uvc_ctrl_power_line_uvc11 },
 	/* Chicony EasyCamera */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
 
---

base-commit: 4853c74bd7ab7fdb83f319bd9ace8a08c031e9b6
change-id: 20230817-chicony-9c35f2046c6f

Signature · 3 lines
Regards,

Laurent Pinchart
#2 lore raw

Hi Laurent

Quoted 11 lines · Laurent Pinchart

Hi Ricardo,

Quoted 7 lines · Ricardo Ribalda

The device does not implement the control properly.

Fixes v4l2-compliance error:

info: checking control 'Power Line Frequency' (0x00980918)
fail: v4l2-test-controls.cpp(552): could not set valid menu item 3

Quoted 6 lines
Quoted 2 lines

This still applies :-)

I've taken the patch in my tree and will push it for v6.7.

Thanks!

Quoted 50 lines
Quoted 43 lines

---
This camera, like other Chicony devices, do not implement properly the Power Line Frequency control.

This time, I do not have direct access to the device, just to the
report, but since other devices from the same family are showing the
same error, it is safe to assume that the same fix will work here.
---
Changes in v2:
- Fix IntefaceProtocol, the camera is uvc1.5
- I managed to write 0 to the control, so the proper quirk is uvc11 not limited
- Changes by Laurent:
- Rename device
- s/v4l/v4l2
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 drivers/media/usb/uvc/uvc_driver.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +9 -1
index 08fcd2ffa727..4b5ea3501753 100644
@@ -2592,6 +2592,15 @@ static const struct usb_device_id uvc_ids[] = {
        .bInterfaceSubClass   = 1,
        .bInterfaceProtocol   = 0,
        .driver_info          = (kernel_ulong_t)&uvc_ctrl_power_line_limited },
+     /* Chicony Electronics Co., Ltd Integrated Camera */
+     { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+                             | USB_DEVICE_ID_MATCH_INT_INFO,
+       .idVendor             = 0x04f2,
+       .idProduct            = 0xb67c,
+       .bInterfaceClass      = USB_CLASS_VIDEO,
+       .bInterfaceSubClass   = 1,
+       .bInterfaceProtocol   = UVC_PC_PROTOCOL_15,
+       .driver_info          = (kernel_ulong_t)&uvc_ctrl_power_line_uvc11 },
      /* Chicony EasyCamera */
      { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                              | USB_DEVICE_ID_MATCH_INT_INFO,
 
---
Quoted 2 lines

base-commit: 4853c74bd7ab7fdb83f319bd9ace8a08c031e9b6
change-id: 20230817-chicony-9c35f2046c6f

--
Regards,

Laurent Pinchart

Signature · 1 line
Ricardo Ribalda