Commit 71d848ca authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Jaroslav Kysela

[ALSA] usb-audio: make nrpacks parameter writeable

USB generic driver
The nrpacks module parameter is used only when initializing a playback
stream, so it doesn't hurt to make it writeable.
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
parent d6db392e
...@@ -79,7 +79,7 @@ module_param_array(vid, int, NULL, 0444); ...@@ -79,7 +79,7 @@ module_param_array(vid, int, NULL, 0444);
MODULE_PARM_DESC(vid, "Vendor ID for the USB audio device."); MODULE_PARM_DESC(vid, "Vendor ID for the USB audio device.");
module_param_array(pid, int, NULL, 0444); module_param_array(pid, int, NULL, 0444);
MODULE_PARM_DESC(pid, "Product ID for the USB audio device."); MODULE_PARM_DESC(pid, "Product ID for the USB audio device.");
module_param(nrpacks, int, 0444); module_param(nrpacks, int, 0644);
MODULE_PARM_DESC(nrpacks, "Max. number of packets per URB."); MODULE_PARM_DESC(nrpacks, "Max. number of packets per URB.");
module_param(async_unlink, bool, 0444); module_param(async_unlink, bool, 0444);
MODULE_PARM_DESC(async_unlink, "Use async unlink mode."); MODULE_PARM_DESC(async_unlink, "Use async unlink mode.");
...@@ -920,9 +920,11 @@ static int init_substream_urbs(snd_usb_substream_t *subs, unsigned int period_by ...@@ -920,9 +920,11 @@ static int init_substream_urbs(snd_usb_substream_t *subs, unsigned int period_by
else else
subs->curpacksize = maxsize; subs->curpacksize = maxsize;
if (is_playback) if (is_playback) {
urb_packs = nrpacks; urb_packs = nrpacks;
else urb_packs = max(urb_packs, (unsigned int)MIN_PACKS_URB);
urb_packs = min(urb_packs, (unsigned int)MAX_PACKS);
} else
urb_packs = 1; urb_packs = 1;
if (snd_usb_get_speed(subs->dev) == USB_SPEED_HIGH) if (snd_usb_get_speed(subs->dev) == USB_SPEED_HIGH)
urb_packs = (urb_packs * 8) >> subs->datainterval; urb_packs = (urb_packs * 8) >> subs->datainterval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment