mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ricardo Ribalda <ribalda@chromium.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	 Hans de Goede <hansg@kernel.org>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Ricardo Ribalda <ribalda@chromium.org>
Subject: [PATCH 2/3] media: uvcvideo: Convert one quirk to a per_device check
Date: Fri, 02 Oct 2026 15:29:06 +0000	[thread overview]
Message-ID: <20261002-uvc-sorted-v1-2-65f52e4d7e16@chromium.org> (raw)
In-Reply-To: <20261002-uvc-sorted-v1-0-65f52e4d7e16@chromium.org>

It is the only quirk that does not use USB_DEVICE_AND_INTERFACE_INFO...,
convert it to a usb_match_one_id in uvc_status.

We could probably just use normal USB_DEVICE_AND_INTERFACE_INFO and
ignore the bcdDevice version, because the code already checks that
interval needs to be > 16, and I would expect that the newer versions
have fixed that.

Since I do not have access to the hardware this is the most conservative
approach.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/usb/uvc/uvc_driver.c | 11 -----------
 drivers/media/usb/uvc/uvc_status.c |  7 ++++++-
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index b789bc55e02b..049566a4e5f7 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2740,17 +2740,6 @@ static const struct usb_device_id uvc_ids[] = {
 	/* 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 },
diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c
index 97c939206302..6f8eaecad3dc 100644
--- a/drivers/media/usb/uvc/uvc_status.c
+++ b/drivers/media/usb/uvc/uvc_status.c
@@ -254,6 +254,10 @@ static void uvc_status_complete(struct urb *urb)
 
 int uvc_status_init(struct uvc_device *dev)
 {
+	/* Bodelin ProScopeHR */
+	static const struct usb_device_id bodelin_proscope = {
+		USB_DEVICE_VER(0x19ab, 0x1000, 0, 0x0126)
+	};
 	struct usb_host_endpoint *ep = dev->int_ep;
 	unsigned int pipe;
 	int interval;
@@ -282,7 +286,8 @@ int uvc_status_init(struct uvc_device *dev)
 	 */
 	interval = ep->desc.bInterval;
 	if (interval > 16 && dev->udev->speed == USB_SPEED_HIGH &&
-	    (dev->quirks & UVC_QUIRK_STATUS_INTERVAL))
+	    ((dev->quirks & UVC_QUIRK_STATUS_INTERVAL) ||
+	      usb_match_one_id(dev->intf, &bodelin_proscope)))
 		interval = fls(interval) - 1;
 
 	usb_fill_int_urb(dev->int_urb, dev->udev, pipe,

-- 
2.56.0.rc1.315.gc6ed9934b7-goog


  parent reply	other threads:[~2026-10-02 15:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 15:29 [PATCH 0/3] media: uvcvideo: Automate quirk sorting Ricardo Ribalda
2026-10-02 15:29 ` [PATCH 1/3] media: uvcvideo: Use USB_DEVICE_AND_INTERFACE_INFO macro Ricardo Ribalda
2026-11-30 13:05   ` Hans de Goede
2026-11-30 13:34   ` Laurent Pinchart
2026-11-30 13:50     ` Ricardo Ribalda
2026-11-30 14:16       ` Hans de Goede
2026-10-02 15:29 ` Ricardo Ribalda [this message]
2026-11-30 13:07   ` [PATCH 2/3] media: uvcvideo: Convert one quirk to a per_device check Hans de Goede
2026-11-30 13:23   ` Laurent Pinchart
2026-11-30 13:26     ` Ricardo Ribalda
2026-11-30 13:37       ` Laurent Pinchart
2026-11-30 13:41     ` Hans de Goede
2026-11-30 13:50       ` Laurent Pinchart
2026-10-02 15:29 ` [PATCH 3/3] media: uvcvideo: Sort all the uvc_ids quirks Ricardo Ribalda
2026-11-30 13:25   ` Laurent Pinchart
2026-11-30 13:31   ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261002-uvc-sorted-v1-2-65f52e4d7e16@chromium.org \
    --to=ribalda@chromium.org \
    --cc=hansg@kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®