aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorMark Hills <mark@xwax.org>2013-03-17 07:07:54 -0400
committerTakashi Iwai <tiwai@suse.de>2013-03-18 03:46:37 -0400
commit59ea586f54f27fde1202214f1525713356a44918 (patch)
tree1034019a282b04f4007ee1c49916d70fbf4073a5 /sound/usb
parent5e212332cc7eed0ffbf91fbe5bab6e2a44b83de6 (diff)
ALSA: usb-audio: Trust fields given in the quirk
The maxpacksize field is given in some quirks, but it gets ignored (in favour of wMaxPacketSize from the first endpoint.) This patch favours the one in the quirk. Digidesign Mbox and Mbox 2 are the only affected quirks and the devices are assumed to be working without this patch. So for safety against the values in the quirk being incorrect, remove them. The datainterval is also ignored but there are not currently any quirks which choose to override this. Cc: Damien Zammit <damien@zamaudio.com> Cc: Chris J Arges <christopherarges@gmail.com> Signed-off-by: Mark Hills <mark@xwax.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/quirks-table.h3
-rw-r--r--sound/usb/quirks.c6
2 files changed, 4 insertions, 5 deletions
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index a620c239caed..86e4b8c17dad 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -3036,7 +3036,6 @@ YAMAHA_DEVICE(0x7010, "UB99"),
3036 .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE, 3036 .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
3037 .endpoint = 0x02, 3037 .endpoint = 0x02,
3038 .ep_attr = 0x01, 3038 .ep_attr = 0x01,
3039 .maxpacksize = 0x130,
3040 .rates = SNDRV_PCM_RATE_44100 | 3039 .rates = SNDRV_PCM_RATE_44100 |
3041 SNDRV_PCM_RATE_48000, 3040 SNDRV_PCM_RATE_48000,
3042 .rate_min = 44100, 3041 .rate_min = 44100,
@@ -3084,7 +3083,6 @@ YAMAHA_DEVICE(0x7010, "UB99"),
3084 .attributes = 0x00, 3083 .attributes = 0x00,
3085 .endpoint = 0x03, 3084 .endpoint = 0x03,
3086 .ep_attr = USB_ENDPOINT_SYNC_ASYNC, 3085 .ep_attr = USB_ENDPOINT_SYNC_ASYNC,
3087 .maxpacksize = 0x128,
3088 .rates = SNDRV_PCM_RATE_48000, 3086 .rates = SNDRV_PCM_RATE_48000,
3089 .rate_min = 48000, 3087 .rate_min = 48000,
3090 .rate_max = 48000, 3088 .rate_max = 48000,
@@ -3110,7 +3108,6 @@ YAMAHA_DEVICE(0x7010, "UB99"),
3110 .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE, 3108 .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
3111 .endpoint = 0x85, 3109 .endpoint = 0x85,
3112 .ep_attr = USB_ENDPOINT_SYNC_SYNC, 3110 .ep_attr = USB_ENDPOINT_SYNC_SYNC,
3113 .maxpacksize = 0x128,
3114 .rates = SNDRV_PCM_RATE_48000, 3111 .rates = SNDRV_PCM_RATE_48000,
3115 .rate_min = 48000, 3112 .rate_min = 48000,
3116 .rate_max = 48000, 3113 .rate_max = 48000,
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 7c4fe5a634f0..a2ac004bbd9a 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -165,8 +165,10 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
165 return -EINVAL; 165 return -EINVAL;
166 } 166 }
167 alts = &iface->altsetting[fp->altset_idx]; 167 alts = &iface->altsetting[fp->altset_idx];
168 fp->datainterval = snd_usb_parse_datainterval(chip, alts); 168 if (fp->datainterval == 0)
169 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); 169 fp->datainterval = snd_usb_parse_datainterval(chip, alts);
170 if (fp->maxpacksize == 0)
171 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
170 usb_set_interface(chip->dev, fp->iface, 0); 172 usb_set_interface(chip->dev, fp->iface, 0);
171 snd_usb_init_pitch(chip, fp->iface, alts, fp); 173 snd_usb_init_pitch(chip, fp->iface, alts, fp);
172 snd_usb_init_sample_rate(chip, fp->iface, alts, fp, fp->rate_max); 174 snd_usb_init_sample_rate(chip, fp->iface, alts, fp, fp->rate_max);