diff options
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/usbaudio.c | 168 | ||||
-rw-r--r-- | sound/usb/usbaudio.h | 4 | ||||
-rw-r--r-- | sound/usb/usbmidi.c | 10 | ||||
-rw-r--r-- | sound/usb/usbmixer.c | 2 | ||||
-rw-r--r-- | sound/usb/usbmixer_maps.c | 20 | ||||
-rw-r--r-- | sound/usb/usbquirks.h | 103 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2y.c | 2 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2y.h | 2 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2yaudio.c | 8 | ||||
-rw-r--r-- | sound/usb/usx2y/usx2yhwdeppcm.c | 12 |
10 files changed, 257 insertions, 74 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index d5013383fad7..4e614ac39f21 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c @@ -47,6 +47,7 @@ #include <linux/usb.h> #include <linux/vmalloc.h> #include <linux/moduleparam.h> +#include <linux/mutex.h> #include <sound/core.h> #include <sound/info.h> #include <sound/pcm.h> @@ -69,6 +70,7 @@ static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; /* Vendor ID for static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; /* Product ID for this card */ static int nrpacks = 4; /* max. number of packets per urb */ static int async_unlink = 1; +static int device_setup[SNDRV_CARDS]; /* device parameter for this card*/ module_param_array(index, int, NULL, 0444); MODULE_PARM_DESC(index, "Index value for the USB audio adapter."); @@ -84,6 +86,8 @@ module_param(nrpacks, int, 0644); MODULE_PARM_DESC(nrpacks, "Max. number of packets per URB."); module_param(async_unlink, bool, 0444); MODULE_PARM_DESC(async_unlink, "Use async unlink mode."); +module_param_array(device_setup, int, NULL, 0444); +MODULE_PARM_DESC(device_setup, "Specific device setup (if needed)."); /* @@ -202,7 +206,7 @@ struct snd_usb_stream { * the all interfaces on the same card as one sound device. */ -static DECLARE_MUTEX(register_mutex); +static DEFINE_MUTEX(register_mutex); static struct snd_usb_audio *usb_chip[SNDRV_CARDS]; @@ -475,6 +479,18 @@ static int retire_playback_sync_urb_hs(struct snd_usb_substream *subs, return 0; } +/* determine the number of frames in the next packet */ +static int snd_usb_audio_next_packet_size(struct snd_usb_substream *subs) +{ + if (subs->fill_max) + return subs->maxframesize; + else { + subs->phase = (subs->phase & 0xffff) + + (subs->freqm << subs->datainterval); + return min(subs->phase >> 16, subs->maxframesize); + } +} + /* * Prepare urb for streaming before playback starts. * @@ -492,16 +508,7 @@ static int prepare_startup_playback_urb(struct snd_usb_substream *subs, urb->dev = ctx->subs->dev; urb->number_of_packets = subs->packs_per_ms; for (i = 0; i < subs->packs_per_ms; ++i) { - /* calculate the size of a packet */ - if (subs->fill_max) - counts = subs->maxframesize; /* fixed */ - else { - subs->phase = (subs->phase & 0xffff) - + (subs->freqm << subs->datainterval); - counts = subs->phase >> 16; - if (counts > subs->maxframesize) - counts = subs->maxframesize; - } + counts = snd_usb_audio_next_packet_size(subs); urb->iso_frame_desc[i].offset = offs * stride; urb->iso_frame_desc[i].length = counts * stride; offs += counts; @@ -538,16 +545,7 @@ static int prepare_playback_urb(struct snd_usb_substream *subs, urb->number_of_packets = 0; spin_lock_irqsave(&subs->lock, flags); for (i = 0; i < ctx->packets; i++) { - /* calculate the size of a packet */ - if (subs->fill_max) - counts = subs->maxframesize; /* fixed */ - else { - subs->phase = (subs->phase & 0xffff) - + (subs->freqm << subs->datainterval); - counts = subs->phase >> 16; - if (counts > subs->maxframesize) - counts = subs->maxframesize; - } + counts = snd_usb_audio_next_packet_size(subs); /* set up descriptor */ urb->iso_frame_desc[i].offset = offs * stride; urb->iso_frame_desc[i].length = counts * stride; @@ -725,10 +723,9 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs) { struct snd_pcm_runtime *runtime = subs->runtime; - if (runtime->dma_area) { - vfree(runtime->dma_area); - runtime->dma_area = NULL; - } + + vfree(runtime->dma_area); + runtime->dma_area = NULL; return 0; } @@ -779,6 +776,35 @@ static int deactivate_urbs(struct snd_usb_substream *subs, int force, int can_sl } +static const char *usb_error_string(int err) +{ + switch (err) { + case -ENODEV: + return "no device"; + case -ENOENT: + return "endpoint not enabled"; + case -EPIPE: + return "endpoint stalled"; + case -ENOSPC: + return "not enough bandwidth"; + case -ESHUTDOWN: + return "device disabled"; + case -EHOSTUNREACH: + return "device suspended"; +#ifndef CONFIG_USB_EHCI_SPLIT_ISO + case -ENOSYS: + return "enable CONFIG_USB_EHCI_SPLIT_ISO to play through a hub"; +#endif + case -EINVAL: + case -EAGAIN: + case -EFBIG: + case -EMSGSIZE: + return "internal error"; + default: + return "unknown error"; + } +} + /* * set up and start data/sync urbs */ @@ -811,16 +837,22 @@ static int start_urbs(struct snd_usb_substream *subs, struct snd_pcm_runtime *ru subs->unlink_mask = 0; subs->running = 1; for (i = 0; i < subs->nurbs; i++) { - if ((err = usb_submit_urb(subs->dataurb[i].urb, GFP_ATOMIC)) < 0) { - snd_printk(KERN_ERR "cannot submit datapipe for urb %d, err = %d\n", i, err); + err = usb_submit_urb(subs->dataurb[i].urb, GFP_ATOMIC); + if (err < 0) { + snd_printk(KERN_ERR "cannot submit datapipe " + "for urb %d, error %d: %s\n", + i, err, usb_error_string(err)); goto __error; } set_bit(i, &subs->active_mask); } if (subs->syncpipe) { for (i = 0; i < SYNC_URBS; i++) { - if ((err = usb_submit_urb(subs->syncurb[i].urb, GFP_ATOMIC)) < 0) { - snd_printk(KERN_ERR "cannot submit syncpipe for urb %d, err = %d\n", i, err); + err = usb_submit_urb(subs->syncurb[i].urb, GFP_ATOMIC); + if (err < 0) { + snd_printk(KERN_ERR "cannot submit syncpipe " + "for urb %d, error %d: %s\n", + i, err, usb_error_string(err)); goto __error; } set_bit(i + 16, &subs->active_mask); @@ -1390,8 +1422,8 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream, channels = params_channels(hw_params); fmt = find_format(subs, format, rate, channels); if (! fmt) { - snd_printd(KERN_DEBUG "cannot set format: format = %s, rate = %d, channels = %d\n", - snd_pcm_format_name(format), rate, channels); + snd_printd(KERN_DEBUG "cannot set format: format = 0x%x, rate = %d, channels = %d\n", + format, rate, channels); return -EINVAL; } @@ -2017,6 +2049,8 @@ static struct usb_driver usb_audio_driver = { }; +#if defined(CONFIG_PROCFS) && defined(CONFIG_SND_VERBOSE_PROCFS) + /* * proc interface for list the supported pcm formats */ @@ -2032,7 +2066,7 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct s fp = list_entry(p, struct audioformat, list); snd_iprintf(buffer, " Interface %d\n", fp->iface); snd_iprintf(buffer, " Altset %d\n", fp->altsetting); - snd_iprintf(buffer, " Format: %s\n", snd_pcm_format_name(fp->format)); + snd_iprintf(buffer, " Format: 0x%x\n", fp->format); snd_iprintf(buffer, " Channels: %d\n", fp->channels); snd_iprintf(buffer, " Endpoint: %d %s (%s)\n", fp->endpoint & USB_ENDPOINT_NUMBER_MASK, @@ -2107,6 +2141,13 @@ static void proc_pcm_format_add(struct snd_usb_stream *stream) snd_info_set_text_ops(entry, stream, 1024, proc_pcm_format_read); } +#else + +static inline void proc_pcm_format_add(struct snd_usb_stream *stream) +{ +} + +#endif /* * initialize the substream instance. @@ -2509,6 +2550,8 @@ static int parse_audio_format(struct snd_usb_audio *chip, struct audioformat *fp return 0; } +static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip, + int iface, int altno); static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) { struct usb_device *dev; @@ -2543,6 +2586,12 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) stream = (get_endpoint(alts, 0)->bEndpointAddress & USB_DIR_IN) ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; altno = altsd->bAlternateSetting; + + /* audiophile usb: skip altsets incompatible with device_setup + */ + if (chip->usb_id == USB_ID(0x0763, 0x2003) && + audiophile_skip_setting_quirk(chip, iface_no, altno)) + continue; /* get audio formats */ fmt = snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, AS_GENERAL); @@ -2637,7 +2686,7 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) continue; } - snd_printdd(KERN_INFO "%d:%u:%d: add audio endpoint 0x%x\n", dev->devnum, iface_no, i, fp->endpoint); + snd_printdd(KERN_INFO "%d:%u:%d: add audio endpoint 0x%x\n", dev->devnum, iface_no, altno, fp->endpoint); err = add_audio_endpoint(chip, stream, fp); if (err < 0) { kfree(fp->rate_table); @@ -3045,6 +3094,45 @@ static int snd_usb_audigy2nx_boot_quirk(struct usb_device *dev) return 0; } +/* + * Setup quirks + */ +#define AUDIOPHILE_SET 0x01 /* if set, parse device_setup */ +#define AUDIOPHILE_SET_DTS 0x02 /* if set, enable DTS Digital Output */ +#define AUDIOPHILE_SET_96K 0x04 /* 48-96KHz rate if set, 8-48KHz otherwise */ +#define AUDIOPHILE_SET_24B 0x08 /* 24bits sample if set, 16bits otherwise */ +#define AUDIOPHILE_SET_DI 0x10 /* if set, enable Digital Input */ +#define AUDIOPHILE_SET_MASK 0x1F /* bit mask for setup value */ +#define AUDIOPHILE_SET_24B_48K_DI 0x19 /* value for 24bits+48KHz+Digital Input */ +#define AUDIOPHILE_SET_24B_48K_NOTDI 0x09 /* value for 24bits+48KHz+No Digital Input */ +#define AUDIOPHILE_SET_16B_48K_DI 0x11 /* value for 16bits+48KHz+Digital Input */ +#define AUDIOPHILE_SET_16B_48K_NOTDI 0x01 /* value for 16bits+48KHz+No Digital Input */ + +static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip, + int iface, int altno) +{ + if (device_setup[chip->index] & AUDIOPHILE_SET) { + if ((device_setup[chip->index] & AUDIOPHILE_SET_DTS) + && altno != 6) + return 1; /* skip this altsetting */ + if ((device_setup[chip->index] & AUDIOPHILE_SET_96K) + && altno != 1) + return 1; /* skip this altsetting */ + if ((device_setup[chip->index] & AUDIOPHILE_SET_MASK) == + AUDIOPHILE_SET_24B_48K_DI && altno != 2) + return 1; /* skip this altsetting */ + if ((device_setup[chip->index] & AUDIOPHILE_SET_MASK) == + AUDIOPHILE_SET_24B_48K_NOTDI && altno != 3) + return 1; /* skip this altsetting */ + if ((device_setup[chip->index] & AUDIOPHILE_SET_MASK) == + AUDIOPHILE_SET_16B_48K_DI && altno != 4) + return 1; /* skip this altsetting */ + if ((device_setup[chip->index] & AUDIOPHILE_SET_MASK) == + AUDIOPHILE_SET_16B_48K_NOTDI && altno != 5) + return 1; /* skip this altsetting */ + } + return 0; /* keep this altsetting */ +} /* * audio-interface quirks @@ -3070,7 +3158,7 @@ static int snd_usb_create_quirk(struct snd_usb_audio *chip, [QUIRK_MIDI_NOVATION] = snd_usb_create_midi_interface, [QUIRK_MIDI_RAW] = snd_usb_create_midi_interface, [QUIRK_MIDI_EMAGIC] = snd_usb_create_midi_interface, - [QUIRK_MIDI_MIDITECH] = snd_usb_create_midi_interface, + [QUIRK_MIDI_CME] = snd_usb_create_midi_interface, [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk, [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk, [QUIRK_AUDIO_EDIROL_UA700_UA25] = create_ua700_ua25_quirk, @@ -3282,7 +3370,7 @@ static void *snd_usb_audio_probe(struct usb_device *dev, /* check whether it's already registered */ chip = NULL; - down(®ister_mutex); + mutex_lock(®ister_mutex); for (i = 0; i < SNDRV_CARDS; i++) { if (usb_chip[i] && usb_chip[i]->dev == dev) { if (usb_chip[i]->shutdown) { @@ -3335,13 +3423,13 @@ static void *snd_usb_audio_probe(struct usb_device *dev, usb_chip[chip->index] = chip; chip->num_interfaces++; - up(®ister_mutex); + mutex_unlock(®ister_mutex); return chip; __error: if (chip && !chip->num_interfaces) snd_card_free(chip->card); - up(®ister_mutex); + mutex_unlock(®ister_mutex); __err_val: return NULL; } @@ -3361,7 +3449,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr) chip = ptr; card = chip->card; - down(®ister_mutex); + mutex_lock(®ister_mutex); chip->shutdown = 1; chip->num_interfaces--; if (chip->num_interfaces <= 0) { @@ -3379,10 +3467,10 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr) snd_usb_mixer_disconnect(p); } usb_chip[chip->index] = NULL; - up(®ister_mutex); + mutex_unlock(®ister_mutex); snd_card_free(card); } else { - up(®ister_mutex); + mutex_unlock(®ister_mutex); } } diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index ecd724bfe5a5..88733524d0fb 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h @@ -161,7 +161,7 @@ enum quirk_type { QUIRK_MIDI_NOVATION, QUIRK_MIDI_RAW, QUIRK_MIDI_EMAGIC, - QUIRK_MIDI_MIDITECH, + QUIRK_MIDI_CME, QUIRK_AUDIO_STANDARD_INTERFACE, QUIRK_AUDIO_FIXED_ENDPOINT, QUIRK_AUDIO_EDIROL_UA700_UA25, @@ -209,7 +209,7 @@ struct snd_usb_midi_endpoint_info { /* for QUIRK_MIDI_EMAGIC, data points to a snd_usb_midi_endpoint_info * structure (out_cables and in_cables only) */ -/* for QUIRK_MIDI_MIDITECH, data is NULL */ +/* for QUIRK_MIDI_CME, data is NULL */ /* */ diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c index f15b021c3ce8..2b9d940c8064 100644 --- a/sound/usb/usbmidi.c +++ b/sound/usb/usbmidi.c @@ -871,10 +871,10 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi* umidi, static unsigned int snd_usbmidi_count_bits(unsigned int x) { - unsigned int bits = 0; + unsigned int bits; - for (; x; x >>= 1) - bits += x & 1; + for (bits = 0; x; ++bits) + x &= x - 1; return bits; } @@ -1082,6 +1082,8 @@ static struct { { USB_ID(0x0582, 0x004d), 0, "%s MIDI" }, { USB_ID(0x0582, 0x004d), 1, "%s 1" }, { USB_ID(0x0582, 0x004d), 2, "%s 2" }, + /* Edirol UM-3EX */ + { USB_ID(0x0582, 0x009a), 3, "%s Control" }, /* M-Audio MidiSport 8x8 */ { USB_ID(0x0763, 0x1031), 8, "%s Control" }, { USB_ID(0x0763, 0x1033), 8, "%s Control" }, @@ -1574,7 +1576,7 @@ int snd_usb_create_midi_interface(struct snd_usb_audio* chip, sizeof(struct snd_usb_midi_endpoint_info)); err = snd_usbmidi_detect_endpoints(umidi, &endpoints[0], 1); break; - case QUIRK_MIDI_MIDITECH: + case QUIRK_MIDI_CME: err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); break; default: diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c index 678dac2d4dba..8d08b34a1cb5 100644 --- a/sound/usb/usbmixer.c +++ b/sound/usb/usbmixer.c @@ -434,7 +434,6 @@ static int add_control_to_empty(struct mixer_build *state, struct snd_kcontrol * kctl->id.index++; if ((err = snd_ctl_add(state->chip->card, kctl)) < 0) { snd_printd(KERN_ERR "cannot add control (err = %d)\n", err); - snd_ctl_free_one(kctl); return err; } cval->elem_id = &kctl->id; @@ -1469,6 +1468,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, unsi kctl = snd_ctl_new1(&mixer_selectunit_ctl, cval); if (! kctl) { snd_printk(KERN_ERR "cannot malloc kcontrol\n"); + kfree(namelist); kfree(cval); return -ENOMEM; } diff --git a/sound/usb/usbmixer_maps.c b/sound/usb/usbmixer_maps.c index c1264434e50a..37accb68652d 100644 --- a/sound/usb/usbmixer_maps.c +++ b/sound/usb/usbmixer_maps.c @@ -195,6 +195,22 @@ static struct usbmix_name_map linex_map[] = { { 0 } /* terminator */ }; +static struct usbmix_name_map maya44_map[] = { + /* 1: IT line */ + { 2, "Line Playback" }, /* FU */ + /* 3: IT line */ + { 4, "Line Playback" }, /* FU */ + /* 5: IT pcm playback */ + /* 6: MU */ + { 7, "Master Playback" }, /* FU */ + /* 8: OT speaker */ + /* 9: IT line */ + { 10, "Line Capture" }, /* FU */ + /* 11: MU */ + /* 12: OT pcm capture */ + { } +}; + /* Section "justlink_map" below added by James Courtier-Dutton <James@superbug.demon.co.uk> * sourced from Maplin Electronics (http://www.maplin.co.uk), part number A56AK * Part has 2 connectors that act as a single output. (TOSLINK Optical for digital out, and 3.5mm Jack for Analogue out.) @@ -253,6 +269,10 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = { .ignore_ctl_error = 1, }, { + .id = USB_ID(0x0a92, 0x0091), + .map = maya44_map, + }, + { .id = USB_ID(0x0c45, 0x1158), .map = justlink_map, }, diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h index 6190ada00e38..0992a0923f1a 100644 --- a/sound/usb/usbquirks.h +++ b/sound/usb/usbquirks.h @@ -82,6 +82,7 @@ YAMAHA_DEVICE(0x1012, "TYROS"), YAMAHA_DEVICE(0x1013, "PF-500"), YAMAHA_DEVICE(0x1014, "S90"), YAMAHA_DEVICE(0x1015, "MOTIF-R"), +YAMAHA_DEVICE(0x1016, "MDP-5"), YAMAHA_DEVICE(0x1017, "CVP-204"), YAMAHA_DEVICE(0x1018, "CVP-206"), YAMAHA_DEVICE(0x1019, "CVP-208"), @@ -90,6 +91,7 @@ YAMAHA_DEVICE(0x101b, "PSR-1100"), YAMAHA_DEVICE(0x101c, "PSR-2100"), YAMAHA_DEVICE(0x101d, "CLP-175"), YAMAHA_DEVICE(0x101e, "PSR-K1"), +YAMAHA_DEVICE(0x101f, "EZ-J24"), YAMAHA_DEVICE(0x1020, "EZ-250i"), YAMAHA_DEVICE(0x1021, "MOTIF ES 6"), YAMAHA_DEVICE(0x1022, "MOTIF ES 7"), @@ -294,7 +296,8 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, { - /* a later revision uses ID 0x0099 */ + /* Has ID 0x0099 when not in "Advanced Driver" mode. + * The UM-2EX has only one input, but we cannot detect this. */ USB_DEVICE(0x0582, 0x0005), .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { .vendor_name = "EDIROL", @@ -385,7 +388,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, { - /* a later revision uses ID 0x009d */ + /* has ID 0x009d when not in "Advanced Driver" mode */ USB_DEVICE(0x0582, 0x0009), .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { .vendor_name = "EDIROL", @@ -1090,6 +1093,53 @@ YAMAHA_DEVICE(0x7010, "UB99"), } } }, + /* TODO: add Edirol UA-101 support */ +{ + /* has ID 0x0081 when not in "Advanced Driver" mode */ + USB_DEVICE(0x0582, 0x0080), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .vendor_name = "Roland", + .product_name = "G-70", + .ifnum = 0, + .type = QUIRK_MIDI_FIXED_ENDPOINT, + .data = & (const struct snd_usb_midi_endpoint_info) { + .out_cables = 0x0001, + .in_cables = 0x0001 + } + } +}, + /* TODO: add Roland V-SYNTH XT support */ + /* TODO: add BOSS GT-PRO support */ +{ + /* has ID 0x008c when not in "Advanced Driver" mode */ + USB_DEVICE(0x0582, 0x008b), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .vendor_name = "EDIROL", + .product_name = "PC-50", + .ifnum = 0, + .type = QUIRK_MIDI_FIXED_ENDPOINT, + .data = & (const struct snd_usb_midi_endpoint_info) { + .out_cables = 0x0001, + .in_cables = 0x0001 + } + } +}, + /* TODO: add Edirol PC-80 support */ + /* TODO: add Edirol UA-1EX support */ +{ + USB_DEVICE(0x0582, 0x009a), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .vendor_name = "EDIROL", + .product_name = "UM-3EX", + .ifnum = 0, + .type = QUIRK_MIDI_FIXED_ENDPOINT, + .data = & (const struct snd_usb_midi_endpoint_info) { + .out_cables = 0x000f, + .in_cables = 0x000f + } + } +}, + /* TODO: add Edirol MD-P1 support */ /* Guillemot devices */ { @@ -1111,15 +1161,6 @@ YAMAHA_DEVICE(0x7010, "UB99"), } } }, - /* TODO: add Edirol UA-101 support */ - /* TODO: add Roland G-70 support */ - /* TODO: add Roland V-SYNTH XT support */ - /* TODO: add BOSS GT-PRO support */ - /* TODO: add Edirol PC-50 support */ - /* TODO: add Edirol PC-80 support */ - /* TODO: add Edirol UA-1EX support */ - /* TODO: add Edirol UM-3 support */ - /* TODO: add Edirol MD-P1 support */ /* Midiman/M-Audio devices */ { @@ -1367,6 +1408,27 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, +/* Casio devices */ +{ + USB_DEVICE(0x07cf, 0x6801), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .vendor_name = "Casio", + .product_name = "PL-40R", + .ifnum = 0, + .type = QUIRK_MIDI_YAMAHA + } +}, +{ + /* this ID is used by several devices without a product ID */ + USB_DEVICE(0x07cf, 0x6802), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .vendor_name = "Casio", + .product_name = "Keyboard", + .ifnum = 0, + .type = QUIRK_MIDI_YAMAHA + } +}, + /* Mark of the Unicorn devices */ { /* thanks to Robert A. Lerche <ral 'at' msbit.com> */ @@ -1468,6 +1530,15 @@ YAMAHA_DEVICE(0x7010, "UB99"), .type = QUIRK_MIDI_STANDARD_INTERFACE } }, +{ + USB_DEVICE(0x0ccd, 0x0035), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + .vendor_name = "Miditech", + .product_name = "Play'n Roll", + .ifnum = 0, + .type = QUIRK_MIDI_CME + } +}, /* Novation EMS devices */ { @@ -1498,22 +1569,24 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, +/* Miditech devices */ { USB_DEVICE(0x4752, 0x0011), .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { .vendor_name = "Miditech", .product_name = "Midistart-2", .ifnum = 0, - .type = QUIRK_MIDI_MIDITECH + .type = QUIRK_MIDI_CME } }, + +/* Central Music devices */ { + /* this ID used by both Miditech MidiStudio-2 and CME UF-x */ USB_DEVICE(0x7104, 0x2202), .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { - .vendor_name = "Miditech", - .product_name = "MidiStudio-2", .ifnum = 0, - .type = QUIRK_MIDI_MIDITECH + .type = QUIRK_MIDI_CME } }, diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index e0abb56bbe49..cfec38d7839b 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c @@ -351,7 +351,7 @@ static struct snd_card *usX2Y_create_card(struct usb_device *device) usX2Y(card)->chip.dev = device; usX2Y(card)->chip.card = card; init_waitqueue_head(&usX2Y(card)->prepare_wait_queue); - init_MUTEX (&usX2Y(card)->prepare_mutex); + mutex_init(&usX2Y(card)->prepare_mutex); INIT_LIST_HEAD(&usX2Y(card)->chip.midi_list); strcpy(card->driver, "USB "NAME_ALLCAPS""); sprintf(card->shortname, "TASCAM "NAME_ALLCAPS""); diff --git a/sound/usb/usx2y/usbusx2y.h b/sound/usb/usx2y/usbusx2y.h index 435c1feda9df..456b5fdbc339 100644 --- a/sound/usb/usx2y/usbusx2y.h +++ b/sound/usb/usx2y/usbusx2y.h @@ -34,7 +34,7 @@ struct usX2Ydev { unsigned int rate, format; int chip_status; - struct semaphore prepare_mutex; + struct mutex prepare_mutex; struct us428ctls_sharedmem *us428ctls_sharedmem; int wait_iso_frame; wait_queue_head_t us428ctls_wait_queue_head; diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index a6bbc7a6348f..f6bd0dee563c 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c @@ -811,7 +811,7 @@ static int snd_usX2Y_pcm_hw_free(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; struct snd_usX2Y_substream *subs = runtime->private_data; - down(&subs->usX2Y->prepare_mutex); + mutex_lock(&subs->usX2Y->prepare_mutex); snd_printdd("snd_usX2Y_hw_free(%p)\n", substream); if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { @@ -832,7 +832,7 @@ static int snd_usX2Y_pcm_hw_free(struct snd_pcm_substream *substream) usX2Y_urbs_release(subs); } } - up(&subs->usX2Y->prepare_mutex); + mutex_unlock(&subs->usX2Y->prepare_mutex); return snd_pcm_lib_free_pages(substream); } /* @@ -849,7 +849,7 @@ static int snd_usX2Y_pcm_prepare(struct snd_pcm_substream *substream) int err = 0; snd_printdd("snd_usX2Y_pcm_prepare(%p)\n", substream); - down(&usX2Y->prepare_mutex); + mutex_lock(&usX2Y->prepare_mutex); usX2Y_subs_prepare(subs); // Start hardware streams // SyncStream first.... @@ -869,7 +869,7 @@ static int snd_usX2Y_pcm_prepare(struct snd_pcm_substream *substream) err = usX2Y_urbs_start(subs); up_prepare_mutex: - up(&usX2Y->prepare_mutex); + mutex_unlock(&usX2Y->prepare_mutex); return err; } diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index 796a7dcef09d..315855082fe1 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/sound/usb/usx2y/usx2yhwdeppcm.c @@ -366,7 +366,7 @@ static int snd_usX2Y_usbpcm_hw_free(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct snd_usX2Y_substream *subs = runtime->private_data, *cap_subs2 = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; - down(&subs->usX2Y->prepare_mutex); + mutex_lock(&subs->usX2Y->prepare_mutex); snd_printdd("snd_usX2Y_usbpcm_hw_free(%p)\n", substream); if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { @@ -395,7 +395,7 @@ static int snd_usX2Y_usbpcm_hw_free(struct snd_pcm_substream *substream) usX2Y_usbpcm_urbs_release(cap_subs2); } } - up(&subs->usX2Y->prepare_mutex); + mutex_unlock(&subs->usX2Y->prepare_mutex); return snd_pcm_lib_free_pages(substream); } @@ -503,7 +503,7 @@ static int snd_usX2Y_usbpcm_prepare(struct snd_pcm_substream *substream) memset(usX2Y->hwdep_pcm_shm, 0, sizeof(struct snd_usX2Y_hwdep_pcm_shm)); } - down(&usX2Y->prepare_mutex); + mutex_lock(&usX2Y->prepare_mutex); usX2Y_subs_prepare(subs); // Start hardware streams // SyncStream first.... @@ -544,7 +544,7 @@ static int snd_usX2Y_usbpcm_prepare(struct snd_pcm_substream *substream) usX2Y->hwdep_pcm_shm->capture_iso_start = -1; up_prepare_mutex: - up(&usX2Y->prepare_mutex); + mutex_unlock(&usX2Y->prepare_mutex); return err; } @@ -621,7 +621,7 @@ static int usX2Y_pcms_lock_check(struct snd_card *card) if (dev->type != SNDRV_DEV_PCM) continue; pcm = dev->device_data; - down(&pcm->open_mutex); + mutex_lock(&pcm->open_mutex); } list_for_each(list, &card->devices) { int s; @@ -650,7 +650,7 @@ static void usX2Y_pcms_unlock(struct snd_card *card) if (dev->type != SNDRV_DEV_PCM) continue; pcm = dev->device_data; - up(&pcm->open_mutex); + mutex_unlock(&pcm->open_mutex); } } |