diff options
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/6fire/firmware.c | 2 | ||||
-rw-r--r-- | sound/usb/card.h | 1 | ||||
-rw-r--r-- | sound/usb/pcm.c | 21 | ||||
-rw-r--r-- | sound/usb/stream.c | 7 |
4 files changed, 18 insertions, 13 deletions
diff --git a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c index 6f9715ab32fe..56ad923bf6b5 100644 --- a/sound/usb/6fire/firmware.c +++ b/sound/usb/6fire/firmware.c | |||
@@ -209,7 +209,7 @@ static int usb6fire_fw_ezusb_upload( | |||
209 | int ret; | 209 | int ret; |
210 | u8 data; | 210 | u8 data; |
211 | struct usb_device *device = interface_to_usbdev(intf); | 211 | struct usb_device *device = interface_to_usbdev(intf); |
212 | const struct firmware *fw = 0; | 212 | const struct firmware *fw = NULL; |
213 | struct ihex_record *rec = kmalloc(sizeof(struct ihex_record), | 213 | struct ihex_record *rec = kmalloc(sizeof(struct ihex_record), |
214 | GFP_KERNEL); | 214 | GFP_KERNEL); |
215 | 215 | ||
diff --git a/sound/usb/card.h b/sound/usb/card.h index 0d37238b8457..2b9fffff23b6 100644 --- a/sound/usb/card.h +++ b/sound/usb/card.h | |||
@@ -119,6 +119,7 @@ struct snd_usb_substream { | |||
119 | unsigned long unlink_mask; /* bitmask of unlinked urbs */ | 119 | unsigned long unlink_mask; /* bitmask of unlinked urbs */ |
120 | 120 | ||
121 | /* data and sync endpoints for this stream */ | 121 | /* data and sync endpoints for this stream */ |
122 | unsigned int ep_num; /* the endpoint number */ | ||
122 | struct snd_usb_endpoint *data_endpoint; | 123 | struct snd_usb_endpoint *data_endpoint; |
123 | struct snd_usb_endpoint *sync_endpoint; | 124 | struct snd_usb_endpoint *sync_endpoint; |
124 | unsigned long flags; | 125 | unsigned long flags; |
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index cdf8b7601973..54607f8c4f66 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c | |||
@@ -354,17 +354,21 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt) | |||
354 | (get_endpoint(alts, 1)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && | 354 | (get_endpoint(alts, 1)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && |
355 | get_endpoint(alts, 1)->bSynchAddress != 0 && | 355 | get_endpoint(alts, 1)->bSynchAddress != 0 && |
356 | !implicit_fb)) { | 356 | !implicit_fb)) { |
357 | snd_printk(KERN_ERR "%d:%d:%d : invalid synch pipe\n", | 357 | snd_printk(KERN_ERR "%d:%d:%d : invalid sync pipe. bmAttributes %02x, bLength %d, bSynchAddress %02x\n", |
358 | dev->devnum, fmt->iface, fmt->altsetting); | 358 | dev->devnum, fmt->iface, fmt->altsetting, |
359 | get_endpoint(alts, 1)->bmAttributes, | ||
360 | get_endpoint(alts, 1)->bLength, | ||
361 | get_endpoint(alts, 1)->bSynchAddress); | ||
359 | return -EINVAL; | 362 | return -EINVAL; |
360 | } | 363 | } |
361 | ep = get_endpoint(alts, 1)->bEndpointAddress; | 364 | ep = get_endpoint(alts, 1)->bEndpointAddress; |
362 | if (get_endpoint(alts, 0)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && | 365 | if (!implicit_fb && |
366 | get_endpoint(alts, 0)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && | ||
363 | (( is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress | USB_DIR_IN)) || | 367 | (( is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress | USB_DIR_IN)) || |
364 | (!is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress & ~USB_DIR_IN)) || | 368 | (!is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress & ~USB_DIR_IN)))) { |
365 | ( is_playback && !implicit_fb))) { | 369 | snd_printk(KERN_ERR "%d:%d:%d : invalid sync pipe. is_playback %d, ep %02x, bSynchAddress %02x\n", |
366 | snd_printk(KERN_ERR "%d:%d:%d : invalid synch pipe\n", | 370 | dev->devnum, fmt->iface, fmt->altsetting, |
367 | dev->devnum, fmt->iface, fmt->altsetting); | 371 | is_playback, ep, get_endpoint(alts, 0)->bSynchAddress); |
368 | return -EINVAL; | 372 | return -EINVAL; |
369 | } | 373 | } |
370 | 374 | ||
@@ -1147,7 +1151,8 @@ static int snd_usb_substream_playback_trigger(struct snd_pcm_substream *substrea | |||
1147 | return -EINVAL; | 1151 | return -EINVAL; |
1148 | } | 1152 | } |
1149 | 1153 | ||
1150 | int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream, int cmd) | 1154 | static int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream, |
1155 | int cmd) | ||
1151 | { | 1156 | { |
1152 | int err; | 1157 | int err; |
1153 | struct snd_usb_substream *subs = substream->runtime->private_data; | 1158 | struct snd_usb_substream *subs = substream->runtime->private_data; |
diff --git a/sound/usb/stream.c b/sound/usb/stream.c index 6b7d7a2b7baa..083ed81160e5 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c | |||
@@ -97,6 +97,7 @@ static void snd_usb_init_substream(struct snd_usb_stream *as, | |||
97 | subs->formats |= fp->formats; | 97 | subs->formats |= fp->formats; |
98 | subs->num_formats++; | 98 | subs->num_formats++; |
99 | subs->fmt_type = fp->fmt_type; | 99 | subs->fmt_type = fp->fmt_type; |
100 | subs->ep_num = fp->endpoint; | ||
100 | } | 101 | } |
101 | 102 | ||
102 | /* | 103 | /* |
@@ -119,9 +120,7 @@ int snd_usb_add_audio_stream(struct snd_usb_audio *chip, | |||
119 | if (as->fmt_type != fp->fmt_type) | 120 | if (as->fmt_type != fp->fmt_type) |
120 | continue; | 121 | continue; |
121 | subs = &as->substream[stream]; | 122 | subs = &as->substream[stream]; |
122 | if (!subs->data_endpoint) | 123 | if (subs->ep_num == fp->endpoint) { |
123 | continue; | ||
124 | if (subs->data_endpoint->ep_num == fp->endpoint) { | ||
125 | list_add_tail(&fp->list, &subs->fmt_list); | 124 | list_add_tail(&fp->list, &subs->fmt_list); |
126 | subs->num_formats++; | 125 | subs->num_formats++; |
127 | subs->formats |= fp->formats; | 126 | subs->formats |= fp->formats; |
@@ -134,7 +133,7 @@ int snd_usb_add_audio_stream(struct snd_usb_audio *chip, | |||
134 | if (as->fmt_type != fp->fmt_type) | 133 | if (as->fmt_type != fp->fmt_type) |
135 | continue; | 134 | continue; |
136 | subs = &as->substream[stream]; | 135 | subs = &as->substream[stream]; |
137 | if (subs->data_endpoint) | 136 | if (subs->ep_num) |
138 | continue; | 137 | continue; |
139 | err = snd_pcm_new_stream(as->pcm, stream, 1); | 138 | err = snd_pcm_new_stream(as->pcm, stream, 1); |
140 | if (err < 0) | 139 | if (err < 0) |