diff options
Diffstat (limited to 'sound/usb/endpoint.c')
-rw-r--r-- | sound/usb/endpoint.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index b9ba0fcc45df..83aabea259d7 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c | |||
@@ -636,8 +636,22 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep, | |||
636 | if (usb_pipein(ep->pipe) || | 636 | if (usb_pipein(ep->pipe) || |
637 | snd_usb_endpoint_implicit_feedback_sink(ep)) { | 637 | snd_usb_endpoint_implicit_feedback_sink(ep)) { |
638 | 638 | ||
639 | urb_packs = packs_per_ms; | ||
640 | /* | ||
641 | * Wireless devices can poll at a max rate of once per 4ms. | ||
642 | * For dataintervals less than 5, increase the packet count to | ||
643 | * allow the host controller to use bursting to fill in the | ||
644 | * gaps. | ||
645 | */ | ||
646 | if (snd_usb_get_speed(ep->chip->dev) == USB_SPEED_WIRELESS) { | ||
647 | int interval = ep->datainterval; | ||
648 | while (interval < 5) { | ||
649 | urb_packs <<= 1; | ||
650 | ++interval; | ||
651 | } | ||
652 | } | ||
639 | /* make capture URBs <= 1 ms and smaller than a period */ | 653 | /* make capture URBs <= 1 ms and smaller than a period */ |
640 | urb_packs = min(max_packs_per_urb, packs_per_ms); | 654 | urb_packs = min(max_packs_per_urb, urb_packs); |
641 | while (urb_packs > 1 && urb_packs * maxsize >= period_bytes) | 655 | while (urb_packs > 1 && urb_packs * maxsize >= period_bytes) |
642 | urb_packs >>= 1; | 656 | urb_packs >>= 1; |
643 | ep->nurbs = MAX_URBS; | 657 | ep->nurbs = MAX_URBS; |