Allow people to test quirks without recompiling but strongly discourage
the use with a kernel log message. Example:
modprobe uvcvideo testquirk=10 # UVC_QUIRK_STREAM_NO_FID
Signed-off-by: Brandon Philips <[EMAIL PROTECTED]>
---
uvc_driver.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
Index: uvc/uvc_driver.c
===================================================================
--- uvc.orig/uvc_driver.c
+++ uvc/uvc_driver.c
@@ -51,6 +51,8 @@
#define DRIVER_VERSION "v0.1.0"
#endif
+static unsigned int uvc_testquirk_param;
+
/* ------------------------------------------------------------------------
* Control, formats, ...
*/
@@ -1539,7 +1541,7 @@ static int uvc_probe(struct usb_interfac
dev->udev = usb_get_dev(udev);
dev->intf = usb_get_intf(intf);
dev->intfnum = intf->cur_altsetting->desc.bInterfaceNumber;
- dev->quirks = id->driver_info;
+ dev->quirks = id->driver_info | uvc_testquirk_param;
/* Parse the Video Class control descriptor */
if (uvc_parse_control(dev) < 0) {
@@ -1553,6 +1555,14 @@ static int uvc_probe(struct usb_interfac
le16_to_cpu(udev->descriptor.idVendor),
le16_to_cpu(udev->descriptor.idProduct));
+ if (uvc_testquirk_param != 0) {
+ uvc_printk(KERN_INFO, "WARNING: testquirk param (%d) is set, "
+ "this is for testing only.\nPlease "
+ "report required quirks to the "
+ "linux-uvc mailing list.\n",
+ uvc_testquirk_param);
+ }
+
/* Initialize controls */
if (uvc_ctrl_init_device(dev) < 0)
goto error;
@@ -1877,6 +1887,8 @@ module_exit(uvc_cleanup);
unsigned int uvc_trace_param = 0;
module_param_named(trace, uvc_trace_param, uint, S_IRUGO|S_IWUSR);
+module_param_named(testquirk, uvc_testquirk_param, uint, S_IRUGO|S_IWUSR);
+
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel