summaryrefslogtreecommitdiff
path: root/sys/dev/usb/uvideo.c
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2021-04-05 20:45:50 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2021-04-05 20:45:50 +0000
commit806c252d73d7e87e49dff2cdbeed47027fcf8faa (patch)
treed16c9e919920055c2825c6b3ff92a04681e08f28 /sys/dev/usb/uvideo.c
parentb9bea725d4006d6c1ab10594f1e701de74708387 (diff)
Add a new quirk flag to not attach video devices which aren't supported by
uvideo(4) currently, like the Chicony Integrated IR Camera. This is especially helpful when you have two video devices of which the unsupported one is attached first as reported by martijn@. OK gnezdo@
Diffstat (limited to 'sys/dev/usb/uvideo.c')
-rw-r--r--sys/dev/usb/uvideo.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index d18827d5b0c..79297d8935f 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.c,v 1.211 2021/01/27 17:28:19 mglocker Exp $ */
+/* $OpenBSD: uvideo.c,v 1.212 2021/04/05 20:45:49 mglocker Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -307,6 +307,7 @@ struct video_hw_if uvideo_hw_if = {
#define UVIDEO_FLAG_ISIGHT_STREAM_HEADER 0x1
#define UVIDEO_FLAG_REATTACH 0x2
#define UVIDEO_FLAG_VENDOR_CLASS 0x4
+#define UVIDEO_FLAG_NOATTACH 0x8
struct uvideo_devs {
struct usb_devno uv_dev;
char *ucode_name;
@@ -382,6 +383,12 @@ struct uvideo_devs {
NULL,
UVIDEO_FLAG_VENDOR_CLASS
},
+ { /* Infrared camera not supported */
+ { USB_VENDOR_CHICONY, USB_PRODUCT_CHICONY_IRCAMERA },
+ NULL,
+ NULL,
+ UVIDEO_FLAG_NOATTACH
+ },
};
#define uvideo_lookup(v, p) \
((struct uvideo_devs *)usb_lookup(uvideo_devs, v, p))
@@ -480,13 +487,12 @@ uvideo_match(struct device *parent, void *match, void *aux)
if (id == NULL)
return (UMATCH_NONE);
- if (id->bInterfaceClass == UICLASS_VIDEO &&
- id->bInterfaceSubClass == UISUBCLASS_VIDEOCONTROL)
- return (UMATCH_VENDOR_PRODUCT_CONF_IFACE);
-
- /* quirk devices which we want to attach */
+ /* quirk devices */
quirk = uvideo_lookup(uaa->vendor, uaa->product);
if (quirk != NULL) {
+ if (quirk->flags & UVIDEO_FLAG_NOATTACH)
+ return (UMATCH_NONE);
+
if (quirk->flags & UVIDEO_FLAG_REATTACH)
return (UMATCH_VENDOR_PRODUCT_CONF_IFACE);
@@ -496,6 +502,10 @@ uvideo_match(struct device *parent, void *match, void *aux)
return (UMATCH_VENDOR_PRODUCT_CONF_IFACE);
}
+ if (id->bInterfaceClass == UICLASS_VIDEO &&
+ id->bInterfaceSubClass == UISUBCLASS_VIDEOCONTROL)
+ return (UMATCH_VENDOR_PRODUCT_CONF_IFACE);
+
return (UMATCH_NONE);
}