aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/uvc/uvc_driver.c
AgeCommit message (Collapse)Author
2009-08-13V4L/DVB (12328): uvcvideo: Don't apply the FIX_BANDWIDTH quirk to all ↵Laurent Pinchart
ViMicro devices Commit 50144aeeb702ea105697ae5249f059ea3990b838 broke the Samsung NC10 netbook webcam. Instead of applying the FIX_BANDWIDTH quirk to all ViMicro devices, list the devices explicitly. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11948): uvcvideo: Ignore non-UVC trailing interface descriptors.Laurent Pinchart
Herton Ronaldo Krzesinski from Mandriva reported that one Bison Electronics webcam exposes a non-UVC interface descriptor. Instead of failing completely, ignore trailing non-UVC descriptors and move on. Thanks to Herton for reporting the problem and submitting a patch proposal. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11947): uvcvideo: Add support for FSC V30S webcamsLaurent Pinchart
The FSC WebCam V30S (18ec:3288) requires the MINMAX quirk. Add a corresponding entry in the device IDs list. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11946): uvcvideo: Add support for Aveo Technology webcamsLaurent Pinchart
The Aveo Technology USB 2.0 Camera (1871:0306) requires the PROBE_EXTRAFIELDS quirk. Add a corresponding entry in the device IDs list. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11944): uvcvideo: Add generic control blacklist.Laurent Pinchart
Another device (5986:0241) has been reported to advertise a UVC control it does not support. Rework the control blacklist to match devices by their VID:PID instead of trying to be clever about which controls might not be supported properly. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11838): uvcvideo: Add Lenovo Thinkpad SL400 to device list commentsFilipe Rosset
Update the 17ef:480b device comment to list Lenovo Thinkpad SL400. Signed-off-by: Filipe Rosset <rosset.filipe@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11837): uvcvideo: Start status polling on device openLaurent Pinchart
Most UVC camera include an interrupt endpoint to report control value changes, video streaming errors and camera button events. The USB controller continuously polls the interrupt endpoint to retrieve such events. This prevents the device from being auto-suspended, and thus consumes power. Reporting video streaming errors don't make sense when the V4L2 device is closed. Control value changes are probably useless as well if nobody listens to the events, although caching will probably have to be completely disabled then. No polling is thus be required when /dev/videoX is not opened. To enable auto-suspend and save power do not poll the interrupt endpoint until the device is open. We lose the ability to detect button events if no application is using the camera. http://bugzilla.kernel.org/show_bug.cgi?id=11948 Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11836): uvcvideo: Add missing whitespaces to multi-line format strings.Laurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11835): uvcvideo: Parse frame descriptors with non-continuous indexes.Laurent Pinchart
The UVC specification requires frame descriptors indexes to range from 1 to the number of frame descriptors. At least some Hercules Dualpix Infinite webcams erroneously use non-continuous index ranges. Make the driver support them. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-05-09V4L/DVB (11669): uvc: fix compile warningHans Verkuil
The 2.6.30 kernel generates this warning: uvc_driver.c:1729: warning: 'ret' may be used uninitialized in this function I guess some new warning flag must have been turned on since this warning didn't appear with older kernels (gcc version 4.3.1). It's also a bogus warning, but since this code didn't comply to the coding standard anyway I've modified it to 1) remove the warning and 2) conform to the coding standard. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (11292): uvcvideo: Add support for Syntek cameras found in JAOtech ↵Laurent Pinchart
Smart Terminals Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10652): uvcvideo: Add quirk to override wrong bandwidth value for ↵Laurent Pinchart
Vimicro devices At least 3 Vimicro cameras (0x332d, 0x3410 and 0x3420) fail to return correct bandwidth information. The first model rounds the value provided by the host to the nearest supported packet size, while the other two always request the maximum bandwidth. Introduce a device quirk to override the value returned by the device with an estimated bandwidth computed by the driver from the frame size and frame rate, and enable it for all Vimicro cameras. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10294): uvcvideo: Add support for the Alcor Micro AU3820 chipset.Laurent Pinchart
The Alcor Micro AU3820 chipset (found in the Future Boy PC USB webcam) requires the MINMAX quirk. Add a corresponding entry in the device IDs list. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10293): uvcvideo: replace strn{cpy,cat} with strl{cpy,cat}.Laurent Pinchart
strncpy is unsafe as it doesn't append a terminating NUL character when the source string doesn't fit in the destination buffer. Replace it with strlcpy. strncat is misused as its size argument refers to the source string, not the destination buffer. Replace it with strlcat. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-29V4L/DVB (10198): uvcvideo: Print the UVC version number in binary-coded decimal.Laurent Pinchart
The UVC specification release number is a binary-coded decimal number, print it as such. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-29V4L/DVB (10197): uvcvideo: Whitespace and comments cleanup, copyright updates.Laurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-29V4L/DVB (10193): removed unused #include <version.h>'sHuang Weiyi
Removed unused #include <version.h>'s in files below, drivers/media/video/cs5345.c drivers/media/video/pwc/pwc-if.c drivers/media/video/saa717x.c drivers/media/video/upd64031a.c drivers/media/video/upd64083.c drivers/media/video/uvc/uvc_ctrl.c drivers/media/video/uvc/uvc_driver.c drivers/media/video/uvc/uvc_queue.c drivers/media/video/uvc/uvc_video.c drivers/media/video/uvc/uvc_status.c Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (10104): uvcvideo: Add support for video output devicesLaurent Pinchart
Extend the range of supported UVC devices by allowing video output devices matching the following structure: TT_STREAMING -> VC_PROCESSING_UNIT -> VC_EXTENSION_UNIT{0,n} -> OTT_* Video output devices are reported with the V4L2_CAP_VIDEO_OUTPUT capability flag and are subject to the same restrictions as video input devices. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (10102): uvcvideo: Ignore interrupt endpoint for built-in iSight ↵Laurent Pinchart
webcams. Built-in iSight webcams have an interrupt endpoint but spit proprietary data that don't conform to the UVC status endpoint messages. Don't try to handle the interrupt endpoint for those cameras. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (9810): uvcvideo: Add a device quirk to prune bogus controls.Laurent Pinchart
Bogus controls currently include processing unit auto controls for which no corresponding manual control is available. Such auto controls make little sense if any, and are known to crash at least the SiGma Micro webcam. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (9809): uvcvideo: Add nodrop module parameter to turn incomplete ↵Laurent Pinchart
frame drop off. The driver drops incomplete uncompressed video frames to avoid confusing userspace with corrupt data. Add a nodrop module parameter to turn that behaviour off and make all frames available to userspace. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29V4L/DVB (9660): uvcvideo: Fix unaligned memory access.Michael Hennerich
Use the unaligned memory access macros when accessing unaligned memory. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29V4L/DVB (9570): uvcvideo: Handle failed video GET_{MIN|MAX|DEF} requests ↵Laurent Pinchart
more gracefully Failed requests will now generate a one-time warning message instead of the usual "Failed to query..." error, which should be more user-friendly. The driver will also recover automatically from failed GET_MIN/GET_MAX requests when the device is half-broken without requiring the MINMAX quirk (fully broken devices still need the quirk). Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29V4L/DVB (9569): uvcvideo: Sort the frame descriptors during parsingLaurent Pinchart
The UVC specification does not require frame descriptors to be sorted by bFrameIndex. At least one camera (145f:013e) is known not to sort the descriptors properly, so they need to be sorted during parsing as the driver then accesses them by index. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29V4L/DVB (9568): uvcvideo: Add support for Lenovo Thinkpad SL500 integrated ↵Laurent Pinchart
webcam Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29V4L/DVB (9567): uvcvideo: Add support for Samsung Q310 integrated webcamLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-13V4L/DVB (9169): uvcvideo: Support two new Bison Electronics webcams.Laurent Pinchart
This adds required quirks for the Compaq Presario B1200 and Acer Travelmate 7720 integrated webcams. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (9030): uvcvideo : Add support for Advent 4211 integrated webcamLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8847): uvcvideo: Add support for a Bison Electronics webcam found ↵Laurent Pinchart
in the Fujitsu Amilo SI2636. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8754): uvcvideo: Implement the USB power management reset_resume ↵Laurent Pinchart
method. When a suspended device has been reset instead of being resumed, USB core calls the reset_resume method if available instead of unbinding and rebinding the device. This patch implements reset_resume by reusing the current resume implementation and simplifies the resume method by skipping the controls restore stage. Resuming from autosuspend should be faster. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-08-06V4L/DVB (8616): uvcvideo: Add support for two Bison Electronics webcamsLaurent Pinchart
The Bison Electronics 5986:0300 and 5986:0303 webcams require the UVC_QUIRK_PROBE_MINMAX quirk. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-27V4L/DVB (8523): v4l2-dev: remove unused type and type2 field from video_deviceHans Verkuil
The type and type2 fields were unused and so could be removed. Instead add a vfl_type field that contains the type of the video device. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-23V4L/DVB (8428): videodev: rename 'dev' to 'parent'Hans Verkuil
The field 'dev' is not the video device, but the parent of the video device. Rename accordingly. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20V4L/DVB (8257): uvcvideo: Fix possible AB-BA deadlock with videodev_lock and ↵Laurent Pinchart
open_mutex The uvcvideo driver's uvc_v4l2_open() method is called from videodev's video_open() function, which means it is called with the videodev_lock mutex held. uvc_v4l2_open() then takes uvc_driver.open_mutex to check dev->state and avoid racing against a device disconnect, which means that open_mutex must nest inside videodev_lock. However uvc_disconnect() takes the open_mutex around setting dev->state and also around putting its device reference. However, if uvc_disconnect() ends up dropping the last reference, it will call uvc_delete(), which calls into the videodev code to unregister its device, and this will end up taking videodev_lock. This opens a (unlikely in practice) window for an AB-BA deadlock and also causes a lockdep warning because of the lock misordering. Fortunately there is no apparent reason to hold open_mutex when doing kref_put() in uvc_disconnect(): if uvc_v4l2_open() runs before the state is set to UVC_DEV_DISCONNECTED, then it will take another reference to the device and kref_put() won't call uvc_delete; if uvc_v4l2_open() runs after the state is set, it will run before uvc_delete(), see the state, and return immediately -- uvc_delete() does uvc_unregister_video() (and hence video_unregister_device(), which is synchronized with videodev_lock) as its first thing, so there is no risk of use-after-free in uvc_v4l2_open(). Bug diagnosed based on a lockdep warning reported by Romano Giannetti <romano@dea.icai.upcomillas.es>. Signed-off-by: Roland Dreier <roland@digitalvampire.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20V4L/DVB (8254): uvcvideo : Add support for Asus F9GS integrated webcamLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20V4L/DVB (8235): uvcvideo : Add support for Medion Akoya Mini E1210 ↵Laurent Pinchart
integrated webcam Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10Hans Verkuil
Also remove some blank lines that were used to split compat code at -devel tree. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20V4L/DVB (8207): uvcvideo: Fix a buffer overflow in format descriptor parsingLaurent Pinchart
Thanks to Oliver Neukum for catching and reporting this bug. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-30V4L/DVB (8145a): USB Video Class driverLaurent Pinchart
This driver supports video input devices compliant with the USB Video Class specification. This means lots of currently manufactured webcams, and probably most of the future ones. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>