diff options
author | Mauro Carvalho Chehab <devnull@localhost> | 2005-11-06 05:50:01 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <devnull@localhost> | 2005-11-06 05:50:01 +0000 |
commit | 94aacf31922e599622b662c95ffe5fb5cccf372d (patch) | |
tree | 8a934fa0523e34ce638f1b077db4a977ef9ad028 /linux/drivers/media/video/em28xx/em28xx-core.c | |
parent | 0ca5f95393da32065c0ed630d5e4d4c9c749c5c8 (diff) | |
download | mediapointer-dvb-s2-94aacf31922e599622b662c95ffe5fb5cccf372d.tar.gz mediapointer-dvb-s2-94aacf31922e599622b662c95ffe5fb5cccf372d.tar.bz2 |
- Fixed autodetection of max size by if alternate setting
- Fixed some debug messages
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media/video/em28xx/em28xx-core.c')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-core.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-core.c b/linux/drivers/media/video/em28xx/em28xx-core.c index 5b71078e5..8491dbd0a 100644 --- a/linux/drivers/media/video/em28xx/em28xx-core.c +++ b/linux/drivers/media/video/em28xx/em28xx-core.c @@ -806,20 +806,20 @@ int em28xx_set_alternate(struct em28xx *dev) if (dev->alt == 0) { int i; #if 1 /* Always try to get the maximum size value */ - for(i=0;i< EM28XX_MAX_ALT; i++) + for(i=0;i< dev->num_alt; i++) if(dev->alt_max_pkt_size[i]>dev->alt_max_pkt_size[dev->alt]) dev->alt=i; #endif #if 0 /* Should be dependent of horizontal size */ if(dev->is_em2800){ /* always use the max packet size for em2800 based devices */ - for(i=0;i< EM28XX_MAX_ALT; i++) + for(i=0;i< dev->num_alt; i++) if(dev->alt_max_pkt_size[i]>dev->alt_max_pkt_size[dev->alt]) dev->alt=i; }else{ unsigned int min_pkt_size = dev->field_size / 137; /* FIXME: empiric magic number */ em28xx_coredbg("minimum isoc packet size: %u", min_pkt_size); dev->alt = 7; - for (i = 1; i < EM28XX_MAX_ALT; i += 2) /* FIXME: skip even alternate: why do they not work? */ + for (i = 0; i < dev->num_alt; i ++) if (dev->alt_max_pkt_size[i] >= min_pkt_size) { dev->alt = i; break; @@ -830,13 +830,12 @@ int em28xx_set_alternate(struct em28xx *dev) if (dev->alt != prev_alt) { dev->max_pkt_size = dev->alt_max_pkt_size[dev->alt]; - em28xx_coredbg("setting alternate %d with wMaxPacketSize=%u", dev->alt, + em28xx_coredbg("setting alternate %d with wMaxPacketSize=%u\n", dev->alt, dev->max_pkt_size); errCode = usb_set_interface(dev->udev, 0, dev->alt); if (errCode < 0) { - em28xx_errdev - ("cannot change alternate number to %d (error=%i)\n", - dev->alt, errCode); + em28xx_errdev ("cannot change alternate number to %d (error=%i)\n", + dev->alt, errCode); return errCode; } } |