diff options
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/format.c | 5 | ||||
-rw-r--r-- | sound/usb/midi.c | 19 | ||||
-rw-r--r-- | sound/usb/mixer.c | 11 | ||||
-rw-r--r-- | sound/usb/quirks-table.h | 4 | ||||
-rw-r--r-- | sound/usb/usx2y/us122l.c | 41 |
5 files changed, 38 insertions, 42 deletions
diff --git a/sound/usb/format.c b/sound/usb/format.c index 69148212aa70..5b792d2c8061 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c | |||
@@ -76,7 +76,10 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, | |||
76 | format = 1 << UAC_FORMAT_TYPE_I_PCM; | 76 | format = 1 << UAC_FORMAT_TYPE_I_PCM; |
77 | } | 77 | } |
78 | if (format & (1 << UAC_FORMAT_TYPE_I_PCM)) { | 78 | if (format & (1 << UAC_FORMAT_TYPE_I_PCM)) { |
79 | if (sample_width > sample_bytes * 8) { | 79 | if (chip->usb_id == USB_ID(0x0582, 0x0016) /* Edirol SD-90 */ && |
80 | sample_width == 24 && sample_bytes == 2) | ||
81 | sample_bytes = 3; | ||
82 | else if (sample_width > sample_bytes * 8) { | ||
80 | snd_printk(KERN_INFO "%d:%u:%d : sample bitwidth %d in over sample bytes %d\n", | 83 | snd_printk(KERN_INFO "%d:%u:%d : sample bitwidth %d in over sample bytes %d\n", |
81 | chip->dev->devnum, fp->iface, fp->altsetting, | 84 | chip->dev->devnum, fp->iface, fp->altsetting, |
82 | sample_width, sample_bytes); | 85 | sample_width, sample_bytes); |
diff --git a/sound/usb/midi.c b/sound/usb/midi.c index 25bce7e5b1af..db2dc5ffe6dd 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c | |||
@@ -850,8 +850,8 @@ static void snd_usbmidi_us122l_output(struct snd_usb_midi_out_endpoint *ep, | |||
850 | return; | 850 | return; |
851 | } | 851 | } |
852 | 852 | ||
853 | memset(urb->transfer_buffer + count, 0xFD, 9 - count); | 853 | memset(urb->transfer_buffer + count, 0xFD, ep->max_transfer - count); |
854 | urb->transfer_buffer_length = count; | 854 | urb->transfer_buffer_length = ep->max_transfer; |
855 | } | 855 | } |
856 | 856 | ||
857 | static struct usb_protocol_ops snd_usbmidi_122l_ops = { | 857 | static struct usb_protocol_ops snd_usbmidi_122l_ops = { |
@@ -1295,6 +1295,13 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi, | |||
1295 | case USB_ID(0x1a86, 0x752d): /* QinHeng CH345 "USB2.0-MIDI" */ | 1295 | case USB_ID(0x1a86, 0x752d): /* QinHeng CH345 "USB2.0-MIDI" */ |
1296 | ep->max_transfer = 4; | 1296 | ep->max_transfer = 4; |
1297 | break; | 1297 | break; |
1298 | /* | ||
1299 | * Some devices only work with 9 bytes packet size: | ||
1300 | */ | ||
1301 | case USB_ID(0x0644, 0x800E): /* Tascam US-122L */ | ||
1302 | case USB_ID(0x0644, 0x800F): /* Tascam US-144 */ | ||
1303 | ep->max_transfer = 9; | ||
1304 | break; | ||
1298 | } | 1305 | } |
1299 | for (i = 0; i < OUTPUT_URBS; ++i) { | 1306 | for (i = 0; i < OUTPUT_URBS; ++i) { |
1300 | buffer = usb_alloc_coherent(umidi->dev, | 1307 | buffer = usb_alloc_coherent(umidi->dev, |
@@ -1729,13 +1736,7 @@ static int roland_load_info(struct snd_kcontrol *kcontrol, | |||
1729 | { | 1736 | { |
1730 | static const char *const names[] = { "High Load", "Light Load" }; | 1737 | static const char *const names[] = { "High Load", "Light Load" }; |
1731 | 1738 | ||
1732 | info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 1739 | return snd_ctl_enum_info(info, 1, 2, names); |
1733 | info->count = 1; | ||
1734 | info->value.enumerated.items = 2; | ||
1735 | if (info->value.enumerated.item > 1) | ||
1736 | info->value.enumerated.item = 1; | ||
1737 | strcpy(info->value.enumerated.name, names[info->value.enumerated.item]); | ||
1738 | return 0; | ||
1739 | } | 1740 | } |
1740 | 1741 | ||
1741 | static int roland_load_get(struct snd_kcontrol *kcontrol, | 1742 | static int roland_load_get(struct snd_kcontrol *kcontrol, |
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index f2d74d654b3c..7df89b3d7ded 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c | |||
@@ -1633,18 +1633,11 @@ static int parse_audio_extension_unit(struct mixer_build *state, int unitid, voi | |||
1633 | static int mixer_ctl_selector_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 1633 | static int mixer_ctl_selector_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1634 | { | 1634 | { |
1635 | struct usb_mixer_elem_info *cval = kcontrol->private_data; | 1635 | struct usb_mixer_elem_info *cval = kcontrol->private_data; |
1636 | char **itemlist = (char **)kcontrol->private_value; | 1636 | const char **itemlist = (const char **)kcontrol->private_value; |
1637 | 1637 | ||
1638 | if (snd_BUG_ON(!itemlist)) | 1638 | if (snd_BUG_ON(!itemlist)) |
1639 | return -EINVAL; | 1639 | return -EINVAL; |
1640 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 1640 | return snd_ctl_enum_info(uinfo, 1, cval->max, itemlist); |
1641 | uinfo->count = 1; | ||
1642 | uinfo->value.enumerated.items = cval->max; | ||
1643 | if (uinfo->value.enumerated.item >= cval->max) | ||
1644 | uinfo->value.enumerated.item = cval->max - 1; | ||
1645 | strlcpy(uinfo->value.enumerated.name, itemlist[uinfo->value.enumerated.item], | ||
1646 | sizeof(uinfo->value.enumerated.name)); | ||
1647 | return 0; | ||
1648 | } | 1641 | } |
1649 | 1642 | ||
1650 | /* get callback for selector unit */ | 1643 | /* get callback for selector unit */ |
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index ad7079d1676c..35999874d301 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h | |||
@@ -705,11 +705,11 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
705 | .data = (const struct snd_usb_audio_quirk[]) { | 705 | .data = (const struct snd_usb_audio_quirk[]) { |
706 | { | 706 | { |
707 | .ifnum = 0, | 707 | .ifnum = 0, |
708 | .type = QUIRK_IGNORE_INTERFACE | 708 | .type = QUIRK_AUDIO_STANDARD_INTERFACE |
709 | }, | 709 | }, |
710 | { | 710 | { |
711 | .ifnum = 1, | 711 | .ifnum = 1, |
712 | .type = QUIRK_IGNORE_INTERFACE | 712 | .type = QUIRK_AUDIO_STANDARD_INTERFACE |
713 | }, | 713 | }, |
714 | { | 714 | { |
715 | .ifnum = 2, | 715 | .ifnum = 2, |
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index 6ef68e42138e..084e6fc8d5bf 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c | |||
@@ -273,29 +273,26 @@ static unsigned int usb_stream_hwdep_poll(struct snd_hwdep *hw, | |||
273 | struct file *file, poll_table *wait) | 273 | struct file *file, poll_table *wait) |
274 | { | 274 | { |
275 | struct us122l *us122l = hw->private_data; | 275 | struct us122l *us122l = hw->private_data; |
276 | struct usb_stream *s = us122l->sk.s; | ||
277 | unsigned *polled; | 276 | unsigned *polled; |
278 | unsigned int mask; | 277 | unsigned int mask; |
279 | 278 | ||
280 | poll_wait(file, &us122l->sk.sleep, wait); | 279 | poll_wait(file, &us122l->sk.sleep, wait); |
281 | 280 | ||
282 | switch (s->state) { | 281 | mask = POLLIN | POLLOUT | POLLWRNORM | POLLERR; |
283 | case usb_stream_ready: | 282 | if (mutex_trylock(&us122l->mutex)) { |
284 | if (us122l->first == file) | 283 | struct usb_stream *s = us122l->sk.s; |
285 | polled = &s->periods_polled; | 284 | if (s && s->state == usb_stream_ready) { |
286 | else | 285 | if (us122l->first == file) |
287 | polled = &us122l->second_periods_polled; | 286 | polled = &s->periods_polled; |
288 | if (*polled != s->periods_done) { | 287 | else |
289 | *polled = s->periods_done; | 288 | polled = &us122l->second_periods_polled; |
290 | mask = POLLIN | POLLOUT | POLLWRNORM; | 289 | if (*polled != s->periods_done) { |
291 | break; | 290 | *polled = s->periods_done; |
291 | mask = POLLIN | POLLOUT | POLLWRNORM; | ||
292 | } else | ||
293 | mask = 0; | ||
292 | } | 294 | } |
293 | /* Fall through */ | 295 | mutex_unlock(&us122l->mutex); |
294 | mask = 0; | ||
295 | break; | ||
296 | default: | ||
297 | mask = POLLIN | POLLOUT | POLLWRNORM | POLLERR; | ||
298 | break; | ||
299 | } | 296 | } |
300 | return mask; | 297 | return mask; |
301 | } | 298 | } |
@@ -381,6 +378,7 @@ static int usb_stream_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, | |||
381 | { | 378 | { |
382 | struct usb_stream_config *cfg; | 379 | struct usb_stream_config *cfg; |
383 | struct us122l *us122l = hw->private_data; | 380 | struct us122l *us122l = hw->private_data; |
381 | struct usb_stream *s; | ||
384 | unsigned min_period_frames; | 382 | unsigned min_period_frames; |
385 | int err = 0; | 383 | int err = 0; |
386 | bool high_speed; | 384 | bool high_speed; |
@@ -426,18 +424,18 @@ static int usb_stream_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, | |||
426 | snd_power_wait(hw->card, SNDRV_CTL_POWER_D0); | 424 | snd_power_wait(hw->card, SNDRV_CTL_POWER_D0); |
427 | 425 | ||
428 | mutex_lock(&us122l->mutex); | 426 | mutex_lock(&us122l->mutex); |
427 | s = us122l->sk.s; | ||
429 | if (!us122l->master) | 428 | if (!us122l->master) |
430 | us122l->master = file; | 429 | us122l->master = file; |
431 | else if (us122l->master != file) { | 430 | else if (us122l->master != file) { |
432 | if (memcmp(cfg, &us122l->sk.s->cfg, sizeof(*cfg))) { | 431 | if (!s || memcmp(cfg, &s->cfg, sizeof(*cfg))) { |
433 | err = -EIO; | 432 | err = -EIO; |
434 | goto unlock; | 433 | goto unlock; |
435 | } | 434 | } |
436 | us122l->slave = file; | 435 | us122l->slave = file; |
437 | } | 436 | } |
438 | if (!us122l->sk.s || | 437 | if (!s || memcmp(cfg, &s->cfg, sizeof(*cfg)) || |
439 | memcmp(cfg, &us122l->sk.s->cfg, sizeof(*cfg)) || | 438 | s->state == usb_stream_xrun) { |
440 | us122l->sk.s->state == usb_stream_xrun) { | ||
441 | us122l_stop(us122l); | 439 | us122l_stop(us122l); |
442 | if (!us122l_start(us122l, cfg->sample_rate, cfg->period_frames)) | 440 | if (!us122l_start(us122l, cfg->sample_rate, cfg->period_frames)) |
443 | err = -EIO; | 441 | err = -EIO; |
@@ -448,6 +446,7 @@ unlock: | |||
448 | mutex_unlock(&us122l->mutex); | 446 | mutex_unlock(&us122l->mutex); |
449 | free: | 447 | free: |
450 | kfree(cfg); | 448 | kfree(cfg); |
449 | wake_up_all(&us122l->sk.sleep); | ||
451 | return err; | 450 | return err; |
452 | } | 451 | } |
453 | 452 | ||