aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/pcm.c')
-rw-r--r--sound/usb/pcm.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 24839d932648..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
@@ -788,6 +792,9 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime,
788 int count = 0, needs_knot = 0; 792 int count = 0, needs_knot = 0;
789 int err; 793 int err;
790 794
795 kfree(subs->rate_list.list);
796 subs->rate_list.list = NULL;
797
791 list_for_each_entry(fp, &subs->fmt_list, list) { 798 list_for_each_entry(fp, &subs->fmt_list, list) {
792 if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS) 799 if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS)
793 return 0; 800 return 0;
@@ -1144,7 +1151,8 @@ static int snd_usb_substream_playback_trigger(struct snd_pcm_substream *substrea
1144 return -EINVAL; 1151 return -EINVAL;
1145} 1152}
1146 1153
1147int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream, int cmd) 1154static int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream,
1155 int cmd)
1148{ 1156{
1149 int err; 1157 int err;
1150 struct snd_usb_substream *subs = substream->runtime->private_data; 1158 struct snd_usb_substream *subs = substream->runtime->private_data;