summaryrefslogtreecommitdiff
path: root/drivers/media/usb/uvc/uvc_driver.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 12:09:57 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 12:09:57 -0700
commit858655116bfc722837e3aec0909b8e9d08f96996 (patch)
treeef9171d51ffcd01e40d1131d62be32e5a7d371dc /drivers/media/usb/uvc/uvc_driver.c
parent239dab4636f7f5f971ac39b5ca84254cff112cac (diff)
parent1b2c14b44adcb7836528640bfdc40bf7499d987d (diff)
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab: "This series contain: - new i2c video drivers: ml86v7667 (video decoder), ths8200 (video encoder) - a new video driver for EasyCap cards based on Fushicai USBTV007 - Improved support for OF and embedded systems, with V4L2 async initialization and a better support for clocks - API cleanups on the ioctls used by the v4l2 debug tool - Lots of cleanups - As usual, several driver improvements and new cards additions - Revert two changesets that change the minimal symbol rate for stv0399, as request by Manu - Update MAINTAINERS and other files to point to my new e-mail" * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (378 commits) MAINTAINERS & ABI: Update to point to my new email [media] stb0899: restore minimal rate to 5Mbauds [media] exynos4-is: Correct colorspace handling at FIMC-LITE [media] exynos4-is: Set valid initial format on FIMC.n subdevs [media] exynos4-is: Set valid initial format on FIMC-IS-ISP subdev pads [media] exynos4-is: Fix format propagation on FIMC-IS-ISP subdev [media] exynos4-is: Set valid initial format at FIMC-LITE [media] exynos4-is: Fix format propagation on FIMC-LITE.n subdevs [media] MAINTAINERS: Update S5P/Exynos FIMC driver entry [media] Documentation: Update driver's directory in video4linux/fimc.txt [media] exynos4-is: Change fimc-is firmware file names [media] exynos4-is: Add support for Exynos5250 MIPI-CSIS [media] exynos4-is: Add Exynos5250 SoC support to fimc-lite driver [media] exynos4-is: Drop drvdata handling in fimc-lite for non-dt platforms [media] media: i2c: tvp514x: remove manual setting of subdev name [media] media: i2c: tvp7002: remove manual setting of subdev name [media] mem2mem: set missing v4l2_dev pointer [media] wl128x: add missing struct v4l2_device [media] tvp514x: Fix init seqeunce [media] saa7134: Fix sparse warnings by adding __user annotation ...
Diffstat (limited to 'drivers/media/usb/uvc/uvc_driver.c')
-rw-r--r--drivers/media/usb/uvc/uvc_driver.c41
1 files changed, 35 insertions, 6 deletions
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 5dbefa68b1d2..81695d48c13e 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1836,8 +1836,8 @@ static int uvc_probe(struct usb_interface *intf,
INIT_LIST_HEAD(&dev->chains);
INIT_LIST_HEAD(&dev->streams);
atomic_set(&dev->nstreams, 0);
- atomic_set(&dev->users, 0);
atomic_set(&dev->nmappings, 0);
+ mutex_init(&dev->lock);
dev->udev = usb_get_dev(udev);
dev->intf = usb_get_intf(intf);
@@ -1950,8 +1950,13 @@ static int uvc_suspend(struct usb_interface *intf, pm_message_t message)
/* Controls are cached on the fly so they don't need to be saved. */
if (intf->cur_altsetting->desc.bInterfaceSubClass ==
- UVC_SC_VIDEOCONTROL)
- return uvc_status_suspend(dev);
+ UVC_SC_VIDEOCONTROL) {
+ mutex_lock(&dev->lock);
+ if (dev->users)
+ uvc_status_stop(dev);
+ mutex_unlock(&dev->lock);
+ return 0;
+ }
list_for_each_entry(stream, &dev->streams, list) {
if (stream->intf == intf)
@@ -1973,14 +1978,20 @@ static int __uvc_resume(struct usb_interface *intf, int reset)
if (intf->cur_altsetting->desc.bInterfaceSubClass ==
UVC_SC_VIDEOCONTROL) {
- if (reset) {
- int ret = uvc_ctrl_resume_device(dev);
+ int ret = 0;
+ if (reset) {
+ ret = uvc_ctrl_resume_device(dev);
if (ret < 0)
return ret;
}
- return uvc_status_resume(dev);
+ mutex_lock(&dev->lock);
+ if (dev->users)
+ ret = uvc_status_start(dev, GFP_NOIO);
+ mutex_unlock(&dev->lock);
+
+ return ret;
}
list_for_each_entry(stream, &dev->streams, list) {
@@ -2163,6 +2174,24 @@ static struct usb_device_id uvc_ids[] = {
.bInterfaceSubClass = 1,
.bInterfaceProtocol = 0,
.driver_info = UVC_QUIRK_PROBE_DEF },
+ /* Dell Alienware X51 */
+ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
+ | USB_DEVICE_ID_MATCH_INT_INFO,
+ .idVendor = 0x05a9,
+ .idProduct = 0x2643,
+ .bInterfaceClass = USB_CLASS_VIDEO,
+ .bInterfaceSubClass = 1,
+ .bInterfaceProtocol = 0,
+ .driver_info = UVC_QUIRK_PROBE_DEF },
+ /* Dell Studio Hybrid 140g (OmniVision webcam) */
+ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
+ | USB_DEVICE_ID_MATCH_INT_INFO,
+ .idVendor = 0x05a9,
+ .idProduct = 0x264a,
+ .bInterfaceClass = USB_CLASS_VIDEO,
+ .bInterfaceSubClass = 1,
+ .bInterfaceProtocol = 0,
+ .driver_info = UVC_QUIRK_PROBE_DEF },
/* Apple Built-In iSight */
{ .match_flags = USB_DEVICE_ID_MATCH_DEVICE
| USB_DEVICE_ID_MATCH_INT_INFO,