diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2005-08-12 09:18:00 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-08-30 02:45:14 -0400 |
commit | 71d848ca00a16179b17e58e5f51c2d9a6c4f97a2 (patch) | |
tree | 5dd195f2e30f6dbc225b97c03cc52d49a31033b7 | |
parent | d6db392e9235c48bb945624798e9beede7b85b12 (diff) |
[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: Clemens Ladisch <clemens@ladisch.de>
-rw-r--r-- | sound/usb/usbaudio.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index d28106e390c4..49075f06f846 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c | |||
@@ -79,7 +79,7 @@ module_param_array(vid, int, NULL, 0444); | |||
79 | MODULE_PARM_DESC(vid, "Vendor ID for the USB audio device."); | 79 | MODULE_PARM_DESC(vid, "Vendor ID for the USB audio device."); |
80 | module_param_array(pid, int, NULL, 0444); | 80 | module_param_array(pid, int, NULL, 0444); |
81 | MODULE_PARM_DESC(pid, "Product ID for the USB audio device."); | 81 | MODULE_PARM_DESC(pid, "Product ID for the USB audio device."); |
82 | module_param(nrpacks, int, 0444); | 82 | module_param(nrpacks, int, 0644); |
83 | MODULE_PARM_DESC(nrpacks, "Max. number of packets per URB."); | 83 | MODULE_PARM_DESC(nrpacks, "Max. number of packets per URB."); |
84 | module_param(async_unlink, bool, 0444); | 84 | module_param(async_unlink, bool, 0444); |
85 | MODULE_PARM_DESC(async_unlink, "Use async unlink mode."); | 85 | 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 | else | 920 | else |
921 | subs->curpacksize = maxsize; | 921 | subs->curpacksize = maxsize; |
922 | 922 | ||
923 | if (is_playback) | 923 | if (is_playback) { |
924 | urb_packs = nrpacks; | 924 | urb_packs = nrpacks; |
925 | else | 925 | urb_packs = max(urb_packs, (unsigned int)MIN_PACKS_URB); |
926 | urb_packs = min(urb_packs, (unsigned int)MAX_PACKS); | ||
927 | } else | ||
926 | urb_packs = 1; | 928 | urb_packs = 1; |
927 | if (snd_usb_get_speed(subs->dev) == USB_SPEED_HIGH) | 929 | if (snd_usb_get_speed(subs->dev) == USB_SPEED_HIGH) |
928 | urb_packs = (urb_packs * 8) >> subs->datainterval; | 930 | urb_packs = (urb_packs * 8) >> subs->datainterval; |