]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
sound: usb-audio: handle wMaxPacketSize for FIXED_ENDPOINT devices
authorClemens Ladisch <clemens@ladisch.de>
Fri, 6 Feb 2009 07:13:07 +0000 (08:13 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 6 Feb 2009 08:47:12 +0000 (09:47 +0100)
For audio devices that do not have proper audio descriptors (e.g.,
Edirol UA-20), we use hardcoded parameters from our quirks list.
However, we must still read the maximum packet size from the standard
endpoint descriptor; otherwise, we might use packets that are too big
and therefore rejected by the USB core.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/usbaudio.c

index c709b9563226c0b343f98588f4bc91345c5bf185..2ab83129d9b04b846c7fd15a076a53cdef1d1c21 100644 (file)
@@ -2966,6 +2966,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
                return -EINVAL;
        }
        alts = &iface->altsetting[fp->altset_idx];
+       fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
        usb_set_interface(chip->dev, fp->iface, 0);
        init_usb_pitch(chip->dev, fp->iface, alts, fp);
        init_usb_sample_rate(chip->dev, fp->iface, alts, fp, fp->rate_max);