aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pwc/pwc-v4l.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-11-16 09:39:25 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 05:16:52 -0500
commit3751e288bcf3d77652ef979edc0b3ea8b21d8b97 (patch)
treed0a628cd8c555f186ef402bdd936ad27b7c0c82d /drivers/media/video/pwc/pwc-v4l.c
parenta931910d3be6f63464befb2dde94ec58a6eaf5c1 (diff)
[media] pwc: do not start isoc stream on /dev/video open
pwc was starting streaming on /dev/video# open rather then on STREAM_ON. Now that the v4l1 compat code is removed from the pwc driver there is no reason left to do this. So this patch changes the pwc driver to delay starting the isoc stream (and thus using valuable usb bandwidth) until the application does a STREAM_ON Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pwc/pwc-v4l.c')
-rw-r--r--drivers/media/video/pwc/pwc-v4l.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/video/pwc/pwc-v4l.c b/drivers/media/video/pwc/pwc-v4l.c
index 7061a03f5cf1..2ef1668638f9 100644
--- a/drivers/media/video/pwc/pwc-v4l.c
+++ b/drivers/media/video/pwc/pwc-v4l.c
@@ -309,7 +309,10 @@ static int pwc_vidioc_set_fmt(struct pwc_device *pdev, struct v4l2_format *f)
309 pixelformat != V4L2_PIX_FMT_PWC2) 309 pixelformat != V4L2_PIX_FMT_PWC2)
310 return -EINVAL; 310 return -EINVAL;
311 311
312 PWC_DEBUG_IOCTL("Try to change format to: width=%d height=%d fps=%d " 312 if (pdev->iso_init)
313 return -EBUSY;
314
315 PWC_DEBUG_IOCTL("Trying to set format to: width=%d height=%d fps=%d "
313 "compression=%d snapshot=%d format=%c%c%c%c\n", 316 "compression=%d snapshot=%d format=%c%c%c%c\n",
314 f->fmt.pix.width, f->fmt.pix.height, fps, 317 f->fmt.pix.width, f->fmt.pix.height, fps,
315 compression, snapshot, 318 compression, snapshot,
@@ -318,14 +321,14 @@ static int pwc_vidioc_set_fmt(struct pwc_device *pdev, struct v4l2_format *f)
318 (pixelformat>>16)&255, 321 (pixelformat>>16)&255,
319 (pixelformat>>24)&255); 322 (pixelformat>>24)&255);
320 323
321 ret = pwc_try_video_mode(pdev, 324 ret = pwc_set_video_mode(pdev,
322 f->fmt.pix.width, 325 f->fmt.pix.width,
323 f->fmt.pix.height, 326 f->fmt.pix.height,
324 fps, 327 fps,
325 compression, 328 compression,
326 snapshot); 329 snapshot);
327 330
328 PWC_DEBUG_IOCTL("pwc_try_video_mode(), return=%d\n", ret); 331 PWC_DEBUG_IOCTL("pwc_set_video_mode(), return=%d\n", ret);
329 332
330 if (ret) 333 if (ret)
331 return ret; 334 return ret;
@@ -882,9 +885,7 @@ long pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg)
882 885
883 case VIDIOC_STREAMON: 886 case VIDIOC_STREAMON:
884 { 887 {
885 /* WARNING: pwc_try_video_mode() called pwc_isoc_init */ 888 return pwc_isoc_init(pdev);
886 pwc_isoc_init(pdev);
887 return 0;
888 } 889 }
889 890
890 case VIDIOC_STREAMOFF: 891 case VIDIOC_STREAMOFF: