aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-02-08 13:44:25 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-02-18 09:15:17 -0500
commit3687e1e67e4920a202d53cc24678fb34fcda8fc5 (patch)
tree690923e60041a813ffbe4c03a9c0822ecb0402b8 /drivers/media/video/em28xx/em28xx-video.c
parent92ea42f442c4895e38f525a097d7d8ce2a55b9b9 (diff)
V4L/DVB (7179): Allow more than one em28xx board
em28xx driver is capable of handling more than one usb device. However, isoc transfers require a large amount of data to be transfered. Before this patch, just one em28xx board were enough to allocate more than 50% URBs: T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 8 B: Alloc=480/800 us (60%), #Int= 0, #Iso= 2 D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1 So, only one board could use an USB host at the same time. After the patch, it is possible to use more than one em28xx at the same time, on the same usb host, if the image size is slower or equal to 345600, since those images will require about 30% of the URBs: T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 8 B: Alloc=232/800 us (29%), #Int= 0, #Iso= 2 D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1 So, in thesis, after the patch, it would be possible to use up to 3 boards by each usb host, if the devices are generating small images. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index eeda3b2faec8..4abe6701a770 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1352,8 +1352,6 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
1352 filp->private_data = fh; 1352 filp->private_data = fh;
1353 1353
1354 if (dev->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && dev->users == 0) { 1354 if (dev->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && dev->users == 0) {
1355 em28xx_set_alternate(dev);
1356
1357 dev->width = norm_maxw(dev); 1355 dev->width = norm_maxw(dev);
1358 dev->height = norm_maxh(dev); 1356 dev->height = norm_maxh(dev);
1359 dev->frame_size = dev->width * dev->height * 2; 1357 dev->frame_size = dev->width * dev->height * 2;
@@ -1362,6 +1360,7 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
1362 dev->hscale = 0; 1360 dev->hscale = 0;
1363 dev->vscale = 0; 1361 dev->vscale = 0;
1364 1362
1363 em28xx_set_alternate(dev);
1365 em28xx_capture_start(dev, 1); 1364 em28xx_capture_start(dev, 1);
1366 em28xx_resolution_set(dev); 1365 em28xx_resolution_set(dev);
1367 1366
@@ -2129,6 +2128,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
2129 snprintf(dev->name, 29, "em28xx #%d", nr); 2128 snprintf(dev->name, 29, "em28xx #%d", nr);
2130 dev->devno = nr; 2129 dev->devno = nr;
2131 dev->model = id->driver_info; 2130 dev->model = id->driver_info;
2131 dev->alt = -1;
2132 2132
2133 /* Checks if audio is provided by some interface */ 2133 /* Checks if audio is provided by some interface */
2134 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) { 2134 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {