The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v3 0/3] media: uvcvideo: Automate quirk sorting
@ 2026-12-01  6:20 Ricardo Ribalda
  2026-12-01  6:20 ` [PATCH v3 1/3] media: uvcvideo: Use USB_DEVICE_AND_INTERFACE_INFO macro Ricardo Ribalda
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ricardo Ribalda @ 2026-12-01  6:20 UTC (permalink / raw)
  To: Laurent Pinchart, Hans de Goede, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Ricardo Ribalda, Hans de Goede

As the number of quirks grows it becomes more complicated to keep them
sorted.

Let's rely on automation to check that all the quirks are where they are
supposed to be, so we can focus on reviewing the more fun code.

We use this opportunity to modernize a bit the quirks.

An LLM has figured out the regex for the second group of devices (it is
more clever than me writing regex). I have tested it.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
Changes in v3:
- Squash "media: uvcvideo: Relax the 80 columns rules for the quirk db"
  into "media: uvcvideo: Use USB_DEVICE_AND_INTERFACE_INFO macro".
- Align multi-line UVC_INFO_QUIRK() entries per Laurent's review.
- Collect Reviewed-by tags from Laurent Pinchart.
- Add a new patch to fix a checkpatch warning.
- Link to v2: https://lore.kernel.org/r/20261130-uvc-sorted-v2-0-795f47fbb703@chromium.org

Changes in v2:
- Drop the patch converting Bodelin ProScopeHR to a per-device check in
  uvc_status.c; keep it in uvc_ids[] under a separate open-coded
  matching keep-sorted block and update the uvc_ids[] comments to
  document the grouping.
- Remove --- from the commit message of "media: uvcvideo: Use
  USB_DEVICE_AND_INTERFACE_INFO macro".
- Allow longer lines for quirks.
- Link to v1: https://lore.kernel.org/r/20261002-uvc-sorted-v1-0-65f52e4d7e16@chromium.org

---
Ricardo Ribalda (3):
      media: uvcvideo: Use USB_DEVICE_AND_INTERFACE_INFO macro
      media: uvcvideo: Sort all the uvc_ids quirks
      media: uvcvideo: Enclose UVC_INFO_* macros in parentheses

 drivers/media/usb/uvc/uvc_driver.c | 754 +++++++------------------------------
 1 file changed, 131 insertions(+), 623 deletions(-)
---
base-commit: 79dd149ff9244884f7c62356a9e499a934ed6071
change-id: 20261002-uvc-sorted-9be5e3e605f4

Best regards,
-- 
Ricardo Ribalda <ribalda@chromium.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 1/3] media: uvcvideo: Use USB_DEVICE_AND_INTERFACE_INFO macro
  2026-12-01  6:20 [PATCH v3 0/3] media: uvcvideo: Automate quirk sorting Ricardo Ribalda
@ 2026-12-01  6:20 ` Ricardo Ribalda
  2026-12-01  6:20 ` [PATCH v3 2/3] media: uvcvideo: Sort all the uvc_ids quirks Ricardo Ribalda
  2026-12-01  6:20 ` [PATCH v3 3/3] media: uvcvideo: Enclose UVC_INFO_* macros in parentheses Ricardo Ribalda
  2 siblings, 0 replies; 5+ messages in thread
From: Ricardo Ribalda @ 2026-12-01  6:20 UTC (permalink / raw)
  To: Laurent Pinchart, Hans de Goede, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Ricardo Ribalda, Hans de Goede

It makes the code arguably nicer and also adds some structure that we can
later use to automate checking the quirks ordering.

Relax the 80-column rule for the quirk table so each
USB_DEVICE_AND_INTERFACE_INFO() entry fits on a single line.

It also introduces a new macro UVC_INFO_VERSION to make the code even
nicer.

This does not introduce any change in the code:
$ diff <(objdump -S drivers/media/usb/uvc/uvc_driver.o) \
       <(objdump -S drivers/media/usb/uvc/uvc_driver.o.patched)
2c2
< drivers/media/usb/uvc/uvc_driver.o:     file format elf64-x86-64
> drivers/media/usb/uvc/uvc_driver.o.patched:     file format elf64-x86-64
$

Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/usb/uvc/uvc_driver.c | 706 ++++++-------------------------------
 1 file changed, 101 insertions(+), 605 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index cbc14569716b..8963c9f452f6 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2539,6 +2539,8 @@ static const struct uvc_device_info uvc_quirk_force_y8 = {
 #define UVC_INFO_QUIRK(q) (kernel_ulong_t)&(struct uvc_device_info){.quirks = q}
 #define UVC_INFO_META(m) (kernel_ulong_t)&(struct uvc_device_info) \
 	{.meta_format = m}
+#define UVC_INFO_VERSION(v) \
+	((kernel_ulong_t)&(const struct uvc_device_info){ .uvc_version = (v) })
 
 /*
  * The Logitech cameras listed below have their interface class set to
@@ -2549,556 +2551,184 @@ static const struct uvc_device_info uvc_quirk_force_y8 = {
  */
 static const struct usb_device_id uvc_ids[] = {
 	/* HP Webcam HD 2300 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x03f0,
-	  .idProduct		= 0xe207,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xe207, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_stream_no_fid },
 	/* Quanta ACER HD User Facing */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x0408,
-	  .idProduct		= 0x4033,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= UVC_PC_PROTOCOL_15,
-	  .driver_info		= (kernel_ulong_t)&(const struct uvc_device_info){
-		.uvc_version = 0x010a,
-	  } },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x0408, 0x4033, USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_15),
+	  .driver_info		= UVC_INFO_VERSION(0x010a) },
 	/* Quanta ACER HD User Facing */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x0408,
-	  .idProduct		= 0x4035,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= UVC_PC_PROTOCOL_15,
-	  .driver_info		= (kernel_ulong_t)&(const struct uvc_device_info){
-		.uvc_version = 0x010a,
-	  } },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x0408, 0x4035, USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_15),
+	  .driver_info		= UVC_INFO_VERSION(0x010a) },
 	/* LogiLink Wireless Webcam */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x0416,
-	  .idProduct		= 0xa91a,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x0416, 0xa91a, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
 	/* Genius eFace 2025 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x0458,
-	  .idProduct		= 0x706e,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x0458, 0x706e, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
 	/* Microsoft Lifecam NX-6000 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x045e,
-	  .idProduct		= 0x00f8,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x045e, 0x00f8, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
 	/* Microsoft Lifecam NX-3000 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x045e,
-	  .idProduct		= 0x0721,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x045e, 0x0721, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_def },
 	/* Microsoft Lifecam VX-7000 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x045e,
-	  .idProduct		= 0x0723,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x045e, 0x0723, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
 	/* Logitech, Webcam C910 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x0821,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_WAKE_AUTOSUSPEND)},
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x0821, USB_CLASS_VIDEO, 1, 0),
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_WAKE_AUTOSUSPEND) },
 	/* Logitech, Webcam B910 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x0823,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_WAKE_AUTOSUSPEND)},
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x0823, USB_CLASS_VIDEO, 1, 0),
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_WAKE_AUTOSUSPEND) },
 	/* Logitech Quickcam Fusion */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x08c1,
-	  .bInterfaceClass	= USB_CLASS_VENDOR_SPEC,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0 },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c1, USB_CLASS_VENDOR_SPEC, 1, 0) },
 	/* Logitech Quickcam Orbit MP */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x08c2,
-	  .bInterfaceClass	= USB_CLASS_VENDOR_SPEC,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0 },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c2, USB_CLASS_VENDOR_SPEC, 1, 0) },
 	/* Logitech Quickcam Pro for Notebook */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x08c3,
-	  .bInterfaceClass	= USB_CLASS_VENDOR_SPEC,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0 },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c3, USB_CLASS_VENDOR_SPEC, 1, 0) },
 	/* Logitech Quickcam Pro 5000 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x08c5,
-	  .bInterfaceClass	= USB_CLASS_VENDOR_SPEC,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0 },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c5, USB_CLASS_VENDOR_SPEC, 1, 0) },
 	/* Logitech Quickcam OEM Dell Notebook */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x08c6,
-	  .bInterfaceClass	= USB_CLASS_VENDOR_SPEC,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0 },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c6, USB_CLASS_VENDOR_SPEC, 1, 0) },
 	/* Logitech Quickcam OEM Cisco VT Camera II */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x08c7,
-	  .bInterfaceClass	= USB_CLASS_VENDOR_SPEC,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0 },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c7, USB_CLASS_VENDOR_SPEC, 1, 0) },
 	/* Logitech HD Pro Webcam C920 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x082d,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_RESTORE_CTRLS_ON_INIT
-					       | UVC_QUIRK_INVALID_DEVICE_SOF) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x082d, USB_CLASS_VIDEO, 1, 0),
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_RESTORE_CTRLS_ON_INIT |
+						 UVC_QUIRK_INVALID_DEVICE_SOF) },
 	/* Logitech HD Pro Webcam C925e */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x085b,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x085b, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_INVALID_DEVICE_SOF) },
 	/* Logitech HD Pro Webcam C922 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x085c,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x085c, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_INVALID_DEVICE_SOF) },
 	/* Logitech Rally Bar Huddle */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x087c,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x087c, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_NO_RESET_RESUME) },
 	/* Logitech Rally Bar */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x089b,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x089b, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_NO_RESET_RESUME) },
 	/* Logitech Rally Bar Mini */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x046d,
-	  .idProduct		= 0x08d3,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08d3, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_NO_RESET_RESUME) },
 	/* Chicony CNF7129 (Asus EEE 100HE) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x04f2,
-	  .idProduct		= 0xb071,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x04f2, 0xb071, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_RESTRICT_FRAME_RATE) },
 	/* Alcor Micro AU3820 (Future Boy PC USB Webcam) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x058f,
-	  .idProduct		= 0x3820,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x058f, 0x3820, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
 	/* Dell XPS m1530 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x05a9,
-	  .idProduct		= 0x2640,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x05a9, 0x2640, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_def },
 	/* Dell SP2008WFP Monitor */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x05a9,
-	  .idProduct		= 0x2641,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x05a9, 0x2641, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_def },
 	/* Dell Alienware X51 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x05a9,
-	  .idProduct		= 0x2643,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x05a9, 0x2643, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_def },
 	/* Dell Studio Hybrid 140g (OmniVision webcam) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x05a9,
-	  .idProduct		= 0x264a,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x05a9, 0x264a, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_def },
 	/* Dell XPS M1330 (OmniVision OV7670 webcam) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x05a9,
-	  .idProduct		= 0x7670,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x05a9, 0x7670, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_def },
 	/* Apple Built-In iSight */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x05ac,
-	  .idProduct		= 0x8501,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
-					| UVC_QUIRK_BUILTIN_ISIGHT) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x05ac, 0x8501, USB_CLASS_VIDEO, 1, 0),
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX |
+						 UVC_QUIRK_BUILTIN_ISIGHT) },
 	/* Apple FaceTime HD Camera (Built-In) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x05ac,
-	  .idProduct		= 0x8514,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x05ac, 0x8514, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_def },
 	/* Apple Built-In iSight via iBridge */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x05ac,
-	  .idProduct		= 0x8600,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x05ac, 0x8600, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_def },
 	/* Foxlink ("HP Webcam" on HP Mini 5103) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x05c8,
-	  .idProduct		= 0x0403,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x05c8, 0x0403, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_fix_bandwidth },
 	/* Genesys Logic USB 2.0 PC Camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x05e3,
-	  .idProduct		= 0x0505,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x05e3, 0x0505, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_stream_no_fid },
 	/* Hercules Classic Silver */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x06f8,
-	  .idProduct		= 0x300c,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x06f8, 0x300c, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_fix_bandwidth },
 	/* Avermedia GC515 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x07ca,
-	  .idProduct		= 0x1515,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= UVC_PC_PROTOCOL_15,
-	  .driver_info		= (kernel_ulong_t)&(const struct uvc_device_info){
-		.uvc_version = 0x0110,
-	  } },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x07ca, 0x1515, USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_15),
+	  .driver_info		= UVC_INFO_VERSION(0x0110) },
 	/* AVerMedia Live Gamer HD 2 capture card */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x07ca,
-	  .idProduct		= 0x1570,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x07ca, 0x1570, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_DISABLE_AUTOSUSPEND) },
 	/* ViMicro Vega */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x0ac8,
-	  .idProduct		= 0x332d,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x0ac8, 0x332d, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_fix_bandwidth },
 	/* ViMicro - Minoru3D */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x0ac8,
-	  .idProduct		= 0x3410,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x0ac8, 0x3410, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_fix_bandwidth },
 	/* ViMicro Venus - Minoru3D */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x0ac8,
-	  .idProduct		= 0x3420,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x0ac8, 0x3420, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_fix_bandwidth },
 	/* Ophir Optronics - SPCAM 620U */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x0bd3,
-	  .idProduct		= 0x0555,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x0bd3, 0x0555, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
 	/* Sonix Technology Co. Ltd. - 292A IPC AR0330 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x0c45,
-	  .idProduct		= 0x6366,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x0c45, 0x6366, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_MJPEG_NO_EOF) },
 	/* MT6227 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x0e8d,
-	  .idProduct		= 0x0004,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
-					| UVC_QUIRK_PROBE_DEF) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x0e8d, 0x0004, USB_CLASS_VIDEO, 1, 0),
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX |
+						 UVC_QUIRK_PROBE_DEF) },
 	/* IMC Networks (Medion Akoya) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x13d3,
-	  .idProduct		= 0x5103,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x13d3, 0x5103, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_stream_no_fid },
 	/* JMicron USB2.0 XGA WebCam */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x152d,
-	  .idProduct		= 0x0310,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x152d, 0x0310, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
 	/* Kurokesu C1 PRO */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x16d0,
-	  .idProduct		= 0x0ed1,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x16d0, 0x0ed1, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_MJPEG_NO_EOF) },
 	/* Syntek (HP Spartan) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x174f,
-	  .idProduct		= 0x5212,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x174f, 0x5212, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_stream_no_fid },
 	/* Syntek (Samsung Q310) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x174f,
-	  .idProduct		= 0x5931,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x174f, 0x5931, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_stream_no_fid },
 	/* Syntek (Packard Bell EasyNote MX52 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x174f,
-	  .idProduct		= 0x8a12,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x174f, 0x8a12, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_stream_no_fid },
 	/* Syntek (Asus F9SG) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x174f,
-	  .idProduct		= 0x8a31,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x174f, 0x8a31, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_stream_no_fid },
 	/* Syntek (Asus U3S) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x174f,
-	  .idProduct		= 0x8a33,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x174f, 0x8a33, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_stream_no_fid },
 	/* Syntek (JAOtech Smart Terminal) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x174f,
-	  .idProduct		= 0x8a34,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x174f, 0x8a34, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_stream_no_fid },
 	/* Miricle 307K */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x17dc,
-	  .idProduct		= 0x0202,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x17dc, 0x0202, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_stream_no_fid },
 	/* Lenovo Thinkpad SL400/SL500 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x17ef,
-	  .idProduct		= 0x480b,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x17ef, 0x480b, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_stream_no_fid },
 	/* Aveo Technology USB 2.0 Camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x1871,
-	  .idProduct		= 0x0306,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
-					| UVC_QUIRK_PROBE_EXTRAFIELDS) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x1871, 0x0306, USB_CLASS_VIDEO, 1, 0),
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX |
+						 UVC_QUIRK_PROBE_EXTRAFIELDS) },
 	/* Aveo Technology USB 2.0 Camera (Tasco USB Microscope) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x1871,
-	  .idProduct		= 0x0516,
-	  .bInterfaceClass	= USB_CLASS_VENDOR_SPEC,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0 },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x1871, 0x0516, USB_CLASS_VENDOR_SPEC, 1, 0) },
 	/* Ecamm Pico iMage */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x18cd,
-	  .idProduct		= 0xcafe,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x18cd, 0xcafe, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_EXTRAFIELDS) },
 	/* Manta MM-353 Plako */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x18ec,
-	  .idProduct		= 0x3188,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x18ec, 0x3188, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
 	/* FSC WebCam V30S */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x18ec,
-	  .idProduct		= 0x3288,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x18ec, 0x3288, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
 	/* Arkmicro unbranded */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x18ec,
-	  .idProduct		= 0x3290,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x18ec, 0x3290, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_def },
 	/* The Imaging Source USB CCD cameras */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x199e,
-	  .idProduct		= 0x8102,
-	  .bInterfaceClass	= USB_CLASS_VENDOR_SPEC,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0 },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x199e, 0x8102, USB_CLASS_VENDOR_SPEC, 1, 0) },
 	/* Bodelin ProScopeHR */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_DEV_HI
@@ -3111,205 +2741,71 @@ static const struct usb_device_id uvc_ids[] = {
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_STATUS_INTERVAL) },
 	/* MSI StarCam 370i */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x1b3b,
-	  .idProduct		= 0x2951,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x1b3b, 0x2951, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
 	/* Generalplus Technology Inc. 808 Camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x1b3f,
-	  .idProduct		= 0x2002,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x1b3f, 0x2002, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
 	/* Shenzhen Aoni Electronic Co.,Ltd 2K FHD camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x1bcf,
-	  .idProduct		= 0x0b40,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
-	  .driver_info		= (kernel_ulong_t)&(const struct uvc_device_info){
-		.uvc_version = 0x010a,
-	  } },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x1bcf, 0x0b40, USB_CLASS_VIDEO, 1, 0),
+	  .driver_info		= UVC_INFO_VERSION(0x010a) },
 	/* SiGma Micro USB Web Camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x1c4f,
-	  .idProduct		= 0x3000,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
-					| UVC_QUIRK_IGNORE_SELECTOR_UNIT) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x1c4f, 0x3000, USB_CLASS_VIDEO, 1, 0),
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX |
+						 UVC_QUIRK_IGNORE_SELECTOR_UNIT) },
 	/* Actions Microelectronics Co. Display capture-UVC05 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x1de1,
-	  .idProduct		= 0xf105,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x1de1, 0xf105, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_DISABLE_AUTOSUSPEND) },
 	/* NXP Semiconductors IR VIDEO */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x1fc9,
-	  .idProduct		= 0x009b,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x1fc9, 0x009b, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
 	/* Oculus VR Positional Tracker DK2 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x2833,
-	  .idProduct		= 0x0201,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x2833, 0x0201, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_force_y8 },
 	/* Oculus VR Rift Sensor */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x2833,
-	  .idProduct		= 0x0211,
-	  .bInterfaceClass	= USB_CLASS_VENDOR_SPEC,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x2833, 0x0211, USB_CLASS_VENDOR_SPEC, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_force_y8 },
 	/* GEO Semiconductor GC6500 */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x29fe,
-	  .idProduct		= 0x4d53,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x29fe, 0x4d53, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_FORCE_BPP) },
 	/* Insta360 Link */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x2e1a,
-	  .idProduct		= 0x4c01,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x2e1a, 0x4c01, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_DISABLE_AUTOSUSPEND) },
 	/* Luxvisions Innotech Integrated RGB Camera (Lenovo laptops) */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x30c9,
-	  .idProduct		= 0x0122,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x30c9, 0x0122, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_DISABLE_AUTOSUSPEND) },
 	/* Intel Realsense D410/ASR depth camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x8086,
-	  .idProduct		= 0x0ad2,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x8086, 0x0ad2, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_META(V4L2_META_FMT_D4XX) },
 	/* Intel Realsense D415/ASRC depth camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x8086,
-	  .idProduct		= 0x0ad3,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x8086, 0x0ad3, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_META(V4L2_META_FMT_D4XX) },
 	/* Intel Realsense D430/AWG depth camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x8086,
-	  .idProduct		= 0x0ad4,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x8086, 0x0ad4, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_META(V4L2_META_FMT_D4XX) },
 	/* Intel Realsense RealSense D4M */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x8086,
-	  .idProduct		= 0x0b03,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x8086, 0x0b03, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_META(V4L2_META_FMT_D4XX) },
 	/* Intel Realsense D435/AWGC depth camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x8086,
-	  .idProduct		= 0x0b07,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x8086, 0x0b07, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_META(V4L2_META_FMT_D4XX) },
 	/* Intel Realsense D435i depth camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x8086,
-	  .idProduct		= 0x0b3a,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x8086, 0x0b3a, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_META(V4L2_META_FMT_D4XX) },
 	/* Intel Realsense D555 Depth Camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x8086,
-	  .idProduct		= 0x0b56,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= UVC_PC_PROTOCOL_15,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x8086, 0x0b56, USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_15),
 	  .driver_info		= UVC_INFO_META(V4L2_META_FMT_D4XX) },
 	/* Intel Realsense D405 Depth Camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x8086,
-	  .idProduct		= 0x0b5b,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x8086, 0x0b5b, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_META(V4L2_META_FMT_D4XX) },
 	/* Intel Realsense D455 Depth Camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x8086,
-	  .idProduct		= 0x0b5c,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x8086, 0x0b5c, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_META(V4L2_META_FMT_D4XX) },
 	/* Intel Realsense D421 Depth Module */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x8086,
-	  .idProduct		= 0x1155,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x8086, 0x1155, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_META(V4L2_META_FMT_D4XX) },
 	/* Intel Realsense D436 Camera */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x8086,
-	  .idProduct		= 0x1156,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= UVC_PC_PROTOCOL_UNDEFINED,
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x8086, 0x1156, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_META(V4L2_META_FMT_D4XX) },
 	/* Generic USB Video Class */
 	{ USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_UNDEFINED) },

-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 2/3] media: uvcvideo: Sort all the uvc_ids quirks
  2026-12-01  6:20 [PATCH v3 0/3] media: uvcvideo: Automate quirk sorting Ricardo Ribalda
  2026-12-01  6:20 ` [PATCH v3 1/3] media: uvcvideo: Use USB_DEVICE_AND_INTERFACE_INFO macro Ricardo Ribalda
@ 2026-12-01  6:20 ` Ricardo Ribalda
  2026-12-01  6:20 ` [PATCH v3 3/3] media: uvcvideo: Enclose UVC_INFO_* macros in parentheses Ricardo Ribalda
  2 siblings, 0 replies; 5+ messages in thread
From: Ricardo Ribalda @ 2026-12-01  6:20 UTC (permalink / raw)
  To: Laurent Pinchart, Hans de Goede, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Ricardo Ribalda

Create two sections of quirks, one that can use
USB_DEVICE_AND_INTERFACE_INFO() and the other that cannot.

We seemed to have some devices out of order. Fix them.

Also, add keep-sorted comments to help the CI identify what parts
need to be sorted.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/usb/uvc/uvc_driver.c | 59 ++++++++++++++++++++++----------------
 1 file changed, 35 insertions(+), 24 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 8963c9f452f6..81373cafad2c 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2547,9 +2547,14 @@ static const struct uvc_device_info uvc_quirk_force_y8 = {
  * VENDOR_SPEC because they don't announce themselves as UVC devices, even
  * though they are compliant.
  *
- * Sort these by vendor/product ID.
+ * Use USB_DEVICE_AND_INTERFACE_INFO() instead of open-coded matching whenever
+ * possible. Sort the entries by vendor/product ID, grouped into:
+ * - Devices matched with USB_DEVICE_AND_INTERFACE_INFO()
+ * - Devices that require open-coded matching
+ * - Generic USB Video Class entries
  */
 static const struct usb_device_id uvc_ids[] = {
+	/* keep-sorted start block=yes */
 	/* HP Webcam HD 2300 */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xe207, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_stream_no_fid },
@@ -2580,18 +2585,6 @@ static const struct usb_device_id uvc_ids[] = {
 	/* Logitech, Webcam B910 */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x0823, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_WAKE_AUTOSUSPEND) },
-	/* Logitech Quickcam Fusion */
-	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c1, USB_CLASS_VENDOR_SPEC, 1, 0) },
-	/* Logitech Quickcam Orbit MP */
-	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c2, USB_CLASS_VENDOR_SPEC, 1, 0) },
-	/* Logitech Quickcam Pro for Notebook */
-	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c3, USB_CLASS_VENDOR_SPEC, 1, 0) },
-	/* Logitech Quickcam Pro 5000 */
-	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c5, USB_CLASS_VENDOR_SPEC, 1, 0) },
-	/* Logitech Quickcam OEM Dell Notebook */
-	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c6, USB_CLASS_VENDOR_SPEC, 1, 0) },
-	/* Logitech Quickcam OEM Cisco VT Camera II */
-	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c7, USB_CLASS_VENDOR_SPEC, 1, 0) },
 	/* Logitech HD Pro Webcam C920 */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x082d, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_RESTORE_CTRLS_ON_INIT |
@@ -2608,6 +2601,18 @@ static const struct usb_device_id uvc_ids[] = {
 	/* Logitech Rally Bar */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x089b, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_NO_RESET_RESUME) },
+	/* Logitech Quickcam Fusion */
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c1, USB_CLASS_VENDOR_SPEC, 1, 0) },
+	/* Logitech Quickcam Orbit MP */
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c2, USB_CLASS_VENDOR_SPEC, 1, 0) },
+	/* Logitech Quickcam Pro for Notebook */
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c3, USB_CLASS_VENDOR_SPEC, 1, 0) },
+	/* Logitech Quickcam Pro 5000 */
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c5, USB_CLASS_VENDOR_SPEC, 1, 0) },
+	/* Logitech Quickcam OEM Dell Notebook */
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c6, USB_CLASS_VENDOR_SPEC, 1, 0) },
+	/* Logitech Quickcam OEM Cisco VT Camera II */
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08c7, USB_CLASS_VENDOR_SPEC, 1, 0) },
 	/* Logitech Rally Bar Mini */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0x08d3, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_NO_RESET_RESUME) },
@@ -2729,17 +2734,6 @@ static const struct usb_device_id uvc_ids[] = {
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_def },
 	/* The Imaging Source USB CCD cameras */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x199e, 0x8102, USB_CLASS_VENDOR_SPEC, 1, 0) },
-	/* Bodelin ProScopeHR */
-	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
-				| USB_DEVICE_ID_MATCH_DEV_HI
-				| USB_DEVICE_ID_MATCH_INT_INFO,
-	  .idVendor		= 0x19ab,
-	  .idProduct		= 0x1000,
-	  .bcdDevice_hi		= 0x0126,
-	  .bInterfaceClass	= USB_CLASS_VIDEO,
-	  .bInterfaceSubClass	= 1,
-	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_STATUS_INTERVAL) },
 	/* MSI StarCam 370i */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x1b3b, 0x2951, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
@@ -2807,6 +2801,23 @@ static const struct usb_device_id uvc_ids[] = {
 	/* Intel Realsense D436 Camera */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x8086, 0x1156, USB_CLASS_VIDEO, 1, 0),
 	  .driver_info		= UVC_INFO_META(V4L2_META_FMT_D4XX) },
+	/* keep-sorted end */
+
+	/* Devices that cannot use USB_DEVICE_AND_INTERFACE_INFO() */
+	/* keep-sorted start block=yes by_regex=\.idVendor\s*=\s*(\w+),\.idProduct\s*=\s*(\w+) */
+	/* Bodelin ProScopeHR */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_DEV_HI
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x19ab,
+	  .idProduct		= 0x1000,
+	  .bcdDevice_hi		= 0x0126,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_STATUS_INTERVAL) },
+	/* keep-sorted end */
+
 	/* Generic USB Video Class */
 	{ USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_UNDEFINED) },
 	{ USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_15) },

-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 3/3] media: uvcvideo: Enclose UVC_INFO_* macros in parentheses
  2026-12-01  6:20 [PATCH v3 0/3] media: uvcvideo: Automate quirk sorting Ricardo Ribalda
  2026-12-01  6:20 ` [PATCH v3 1/3] media: uvcvideo: Use USB_DEVICE_AND_INTERFACE_INFO macro Ricardo Ribalda
  2026-12-01  6:20 ` [PATCH v3 2/3] media: uvcvideo: Sort all the uvc_ids quirks Ricardo Ribalda
@ 2026-12-01  6:20 ` Ricardo Ribalda
  2026-12-01  6:32   ` Laurent Pinchart
  2 siblings, 1 reply; 5+ messages in thread
From: Ricardo Ribalda @ 2026-12-01  6:20 UTC (permalink / raw)
  To: Laurent Pinchart, Hans de Goede, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Ricardo Ribalda

Wrap the values around UVC_INFO_QUIRK() and UVC_INFO_META() in
parentheses to fix checkpatch.pl errors:

  ERROR: Macros with complex values should be enclosed in parentheses

No functional change intended.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/usb/uvc/uvc_driver.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 81373cafad2c..4ca3502df2a2 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2536,9 +2536,10 @@ static const struct uvc_device_info uvc_quirk_force_y8 = {
 	.quirks = UVC_QUIRK_FORCE_Y8,
 };
 
-#define UVC_INFO_QUIRK(q) (kernel_ulong_t)&(struct uvc_device_info){.quirks = q}
-#define UVC_INFO_META(m) (kernel_ulong_t)&(struct uvc_device_info) \
-	{.meta_format = m}
+#define UVC_INFO_QUIRK(q) \
+	((kernel_ulong_t)&(struct uvc_device_info){ .quirks = (q) })
+#define UVC_INFO_META(m) \
+	((kernel_ulong_t)&(struct uvc_device_info){ .meta_format = (m) })
 #define UVC_INFO_VERSION(v) \
 	((kernel_ulong_t)&(const struct uvc_device_info){ .uvc_version = (v) })
 

-- 
2.56.1.839.g22a8290db9-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 3/3] media: uvcvideo: Enclose UVC_INFO_* macros in parentheses
  2026-12-01  6:20 ` [PATCH v3 3/3] media: uvcvideo: Enclose UVC_INFO_* macros in parentheses Ricardo Ribalda
@ 2026-12-01  6:32   ` Laurent Pinchart
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2026-12-01  6:32 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Hans de Goede, Mauro Carvalho Chehab, linux-media, linux-kernel

On Tue, Dec 01, 2026 at 06:20:45AM +0000, Ricardo Ribalda wrote:
> Wrap the values around UVC_INFO_QUIRK() and UVC_INFO_META() in
> parentheses to fix checkpatch.pl errors:
> 
>   ERROR: Macros with complex values should be enclosed in parentheses

It's one of those cases where I would have ignored checkpatch, as those
macros are used in very specific contexts that should make them safe
without parentheses. If you think parentheses are better, I don't mind.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> No functional change intended.
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
>  drivers/media/usb/uvc/uvc_driver.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index 81373cafad2c..4ca3502df2a2 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -2536,9 +2536,10 @@ static const struct uvc_device_info uvc_quirk_force_y8 = {
>  	.quirks = UVC_QUIRK_FORCE_Y8,
>  };
>  
> -#define UVC_INFO_QUIRK(q) (kernel_ulong_t)&(struct uvc_device_info){.quirks = q}
> -#define UVC_INFO_META(m) (kernel_ulong_t)&(struct uvc_device_info) \
> -	{.meta_format = m}
> +#define UVC_INFO_QUIRK(q) \
> +	((kernel_ulong_t)&(struct uvc_device_info){ .quirks = (q) })
> +#define UVC_INFO_META(m) \
> +	((kernel_ulong_t)&(struct uvc_device_info){ .meta_format = (m) })
>  #define UVC_INFO_VERSION(v) \
>  	((kernel_ulong_t)&(const struct uvc_device_info){ .uvc_version = (v) })
>  

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-01  6:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01  6:20 [PATCH v3 0/3] media: uvcvideo: Automate quirk sorting Ricardo Ribalda
2026-12-01  6:20 ` [PATCH v3 1/3] media: uvcvideo: Use USB_DEVICE_AND_INTERFACE_INFO macro Ricardo Ribalda
2026-12-01  6:20 ` [PATCH v3 2/3] media: uvcvideo: Sort all the uvc_ids quirks Ricardo Ribalda
2026-12-01  6:20 ` [PATCH v3 3/3] media: uvcvideo: Enclose UVC_INFO_* macros in parentheses Ricardo Ribalda
2026-12-01  6:32   ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox