Skip to content

Commit

Permalink
USB: musb: use right poll limit for low speed devices
Browse files Browse the repository at this point in the history
Remove wrongly applied upper limit on the interrupt transfer
interval for low speed devices (not much of an error per se,
according to USB specs).

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Sergei Shtylyov authored and Greg Kroah-Hartman committed Feb 27, 2009
1 parent 3ecdb9a commit 136733d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions drivers/usb/musb/musb_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -1863,19 +1863,21 @@ static int musb_urb_enqueue(
}
qh->type_reg = type_reg;

/* precompute rxinterval/txinterval register */
interval = min((u8)16, epd->bInterval); /* log encoding */
/* Precompute RXINTERVAL/TXINTERVAL register */
switch (qh->type) {
case USB_ENDPOINT_XFER_INT:
/* fullspeed uses linear encoding */
if (USB_SPEED_FULL == urb->dev->speed) {
interval = epd->bInterval;
if (!interval)
interval = 1;
/*
* Full/low speeds use the linear encoding,
* high speed uses the logarithmic encoding.
*/
if (urb->dev->speed <= USB_SPEED_FULL) {
interval = max_t(u8, epd->bInterval, 1);
break;
}
/* FALLTHROUGH */
case USB_ENDPOINT_XFER_ISOC:
/* iso always uses log encoding */
/* ISO always uses logarithmic encoding */
interval = min_t(u8, epd->bInterval, 16);
break;
default:
/* REVISIT we actually want to use NAK limits, hinting to the
Expand Down

0 comments on commit 136733d

Please sign in to comment.