diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2009-12-10 08:00:39 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:25 -0500 |
commit | 73de3592c0da2313b25bac7789e9ea02c4b9f082 (patch) | |
tree | 04c9c0ba36b98007700fd0c1c71e9b76c45b19dd /drivers/media/video/uvc/uvc_driver.c | |
parent | 310fe52461e6244b01a04b011c2e886d6b69de16 (diff) |
V4L/DVB (13828): uvcvideo: Make the quirks module parameter override the built-in quirks
The quirks module parameter is or'ed with the built-in quirks for the
device being probed. This make it impossible to disable a built-in quirk
without recompiling the driver.
Replace the built-in quirks with the quirks module parameter instead of
or'ing the values.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvc_driver.c')
-rw-r--r-- | drivers/media/video/uvc/uvc_driver.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c index 05ac2774d3b9..c0e4fbd8f894 100644 --- a/drivers/media/video/uvc/uvc_driver.c +++ b/drivers/media/video/uvc/uvc_driver.c | |||
@@ -45,7 +45,7 @@ | |||
45 | 45 | ||
46 | unsigned int uvc_clock_param = CLOCK_MONOTONIC; | 46 | unsigned int uvc_clock_param = CLOCK_MONOTONIC; |
47 | unsigned int uvc_no_drop_param; | 47 | unsigned int uvc_no_drop_param; |
48 | static unsigned int uvc_quirks_param; | 48 | static unsigned int uvc_quirks_param = -1; |
49 | unsigned int uvc_trace_param; | 49 | unsigned int uvc_trace_param; |
50 | unsigned int uvc_timeout_param = UVC_CTRL_STREAMING_TIMEOUT; | 50 | unsigned int uvc_timeout_param = UVC_CTRL_STREAMING_TIMEOUT; |
51 | 51 | ||
@@ -1751,7 +1751,8 @@ static int uvc_probe(struct usb_interface *intf, | |||
1751 | dev->udev = usb_get_dev(udev); | 1751 | dev->udev = usb_get_dev(udev); |
1752 | dev->intf = usb_get_intf(intf); | 1752 | dev->intf = usb_get_intf(intf); |
1753 | dev->intfnum = intf->cur_altsetting->desc.bInterfaceNumber; | 1753 | dev->intfnum = intf->cur_altsetting->desc.bInterfaceNumber; |
1754 | dev->quirks = id->driver_info | uvc_quirks_param; | 1754 | dev->quirks = (uvc_quirks_param == -1) |
1755 | ? id->driver_info : uvc_quirks_param; | ||
1755 | 1756 | ||
1756 | if (udev->product != NULL) | 1757 | if (udev->product != NULL) |
1757 | strlcpy(dev->name, udev->product, sizeof dev->name); | 1758 | strlcpy(dev->name, udev->product, sizeof dev->name); |
@@ -1774,9 +1775,9 @@ static int uvc_probe(struct usb_interface *intf, | |||
1774 | le16_to_cpu(udev->descriptor.idVendor), | 1775 | le16_to_cpu(udev->descriptor.idVendor), |
1775 | le16_to_cpu(udev->descriptor.idProduct)); | 1776 | le16_to_cpu(udev->descriptor.idProduct)); |
1776 | 1777 | ||
1777 | if (uvc_quirks_param != 0) { | 1778 | if (dev->quirks != id->driver_info) { |
1778 | uvc_printk(KERN_INFO, "Forcing device quirks 0x%x by module " | 1779 | uvc_printk(KERN_INFO, "Forcing device quirks to 0x%x by module " |
1779 | "parameter for testing purpose.\n", uvc_quirks_param); | 1780 | "parameter for testing purpose.\n", dev->quirks); |
1780 | uvc_printk(KERN_INFO, "Please report required quirks to the " | 1781 | uvc_printk(KERN_INFO, "Please report required quirks to the " |
1781 | "linux-uvc-devel mailing list.\n"); | 1782 | "linux-uvc-devel mailing list.\n"); |
1782 | } | 1783 | } |