Skip to content

Commit

Permalink
[media] em28xx: add module parameter for selection of the preferred U…
Browse files Browse the repository at this point in the history
…SB transfer type

By default, isoc transfers are used if possible.
With the new module parameter, bulk can be selected as the
preferred USB transfer type.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Frank Schaefer authored and Mauro Carvalho Chehab committed Dec 22, 2012
1 parent c647a91 commit 454fe92
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/media/usb/em28xx/em28xx-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = UNSET };
module_param_array(card, int, NULL, 0444);
MODULE_PARM_DESC(card, "card type");

static unsigned int prefer_bulk;
module_param(prefer_bulk, int, 0644);
MODULE_PARM_DESC(prefer_bulk, "prefer USB bulk transfers");


/* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS - 1 */
static unsigned long em28xx_devused;

Expand Down Expand Up @@ -3332,9 +3337,11 @@ static int em28xx_usb_probe(struct usb_interface *interface,
}

/* Select USB transfer types to use */
if (has_video && !dev->analog_ep_isoc)
if (has_video &&
(!dev->analog_ep_isoc || (prefer_bulk && dev->analog_ep_bulk)))
dev->analog_xfer_bulk = 1;
if (has_dvb && !dev->dvb_ep_isoc)
if (has_dvb &&
(!dev->dvb_ep_isoc || (prefer_bulk && dev->dvb_ep_bulk)))
dev->dvb_xfer_bulk = 1;

snprintf(dev->name, sizeof(dev->name), "em28xx #%d", nr);
Expand Down

0 comments on commit 454fe92

Please sign in to comment.