Commit e65dcee7 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update

USB generic driver
add Edirol UA-25 support
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
parent 79d5905f
......@@ -2747,12 +2747,13 @@ static int create_standard_interface_quirk(snd_usb_audio_t *chip,
}
/*
* Create a stream for an Edirol UA-700 interface. The only way
* Create a stream for an Edirol UA-700/UA-25 interface. The only way
* to detect the sample rate is by looking at wMaxPacketSize.
*/
static int create_ua700_quirk(snd_usb_audio_t *chip, struct usb_interface *iface)
static int create_ua700_ua25_quirk(snd_usb_audio_t *chip,
struct usb_interface *iface)
{
static const struct audioformat ua700_format = {
static const struct audioformat ua_format = {
.format = SNDRV_PCM_FORMAT_S24_3LE,
.channels = 2,
.fmt_type = USB_FORMAT_TYPE_I,
......@@ -2772,15 +2773,28 @@ static int create_ua700_quirk(snd_usb_audio_t *chip, struct usb_interface *iface
altsd = get_iface_desc(alts);
if (altsd->bNumEndpoints == 2) {
static const snd_usb_midi_endpoint_info_t ep = {
static const snd_usb_midi_endpoint_info_t ua700_ep = {
.out_cables = 0x0003,
.in_cables = 0x0003
};
static const snd_usb_audio_quirk_t quirk = {
static const snd_usb_audio_quirk_t ua700_quirk = {
.type = QUIRK_MIDI_FIXED_ENDPOINT,
.data = &ep
.data = &ua700_ep
};
return snd_usb_create_midi_interface(chip, iface, &quirk);
static const snd_usb_midi_endpoint_info_t ua25_ep = {
.out_cables = 0x0001,
.in_cables = 0x0001
};
static const snd_usb_audio_quirk_t ua25_quirk = {
.type = QUIRK_MIDI_FIXED_ENDPOINT,
.data = &ua25_ep
};
if (chip->dev->descriptor.idProduct == 0x002b)
return snd_usb_create_midi_interface(chip, iface,
&ua700_quirk);
else
return snd_usb_create_midi_interface(chip, iface,
&ua25_quirk);
}
if (altsd->bNumEndpoints != 1)
......@@ -2789,7 +2803,7 @@ static int create_ua700_quirk(snd_usb_audio_t *chip, struct usb_interface *iface
fp = kmalloc(sizeof(*fp), GFP_KERNEL);
if (!fp)
return -ENOMEM;
memcpy(fp, &ua700_format, sizeof(*fp));
memcpy(fp, &ua_format, sizeof(*fp));
fp->iface = altsd->bInterfaceNumber;
fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;
......@@ -2801,9 +2815,11 @@ static int create_ua700_quirk(snd_usb_audio_t *chip, struct usb_interface *iface
fp->rate_max = fp->rate_min = 44100;
break;
case 0x138:
case 0x140:
fp->rate_max = fp->rate_min = 48000;
break;
case 0x258:
case 0x260:
fp->rate_max = fp->rate_min = 96000;
break;
default:
......@@ -2960,8 +2976,8 @@ static int snd_usb_create_quirk(snd_usb_audio_t *chip,
case QUIRK_AUDIO_STANDARD_INTERFACE:
case QUIRK_MIDI_STANDARD_INTERFACE:
return create_standard_interface_quirk(chip, iface, quirk);
case QUIRK_AUDIO_EDIROL_UA700:
return create_ua700_quirk(chip, iface);
case QUIRK_AUDIO_EDIROL_UA700_UA25:
return create_ua700_ua25_quirk(chip, iface);
case QUIRK_AUDIO_EDIROL_UA1000:
return create_ua1000_quirk(chip, iface);
default:
......
......@@ -155,7 +155,7 @@ struct snd_usb_audio {
#define QUIRK_AUDIO_FIXED_ENDPOINT 4
#define QUIRK_AUDIO_STANDARD_INTERFACE 5
#define QUIRK_MIDI_STANDARD_INTERFACE 6
#define QUIRK_AUDIO_EDIROL_UA700 7
#define QUIRK_AUDIO_EDIROL_UA700_UA25 7
#define QUIRK_AUDIO_EDIROL_UA1000 8
typedef struct snd_usb_audio_quirk snd_usb_audio_quirk_t;
......@@ -188,7 +188,7 @@ struct snd_usb_midi_endpoint_info {
/* for QUIRK_AUDIO/MIDI_STANDARD_INTERFACE, data is NULL */
/* for QUIRK_AUDIO_EDIROL_UA700/1000, data is NULL */
/* for QUIRK_AUDIO_EDIROL_UA700_UA25/UA1000, data is NULL */
/*
*/
......
......@@ -534,15 +534,15 @@ YAMAHA_DEVICE(0x7010, "UB99"),
.data = (const snd_usb_audio_quirk_t[]) {
{
.ifnum = 1,
.type = QUIRK_AUDIO_EDIROL_UA700
.type = QUIRK_AUDIO_EDIROL_UA700_UA25
},
{
.ifnum = 2,
.type = QUIRK_AUDIO_EDIROL_UA700
.type = QUIRK_AUDIO_EDIROL_UA700_UA25
},
{
.ifnum = 3,
.type = QUIRK_AUDIO_EDIROL_UA700
.type = QUIRK_AUDIO_EDIROL_UA700_UA25
},
{
.ifnum = -1
......@@ -732,6 +732,37 @@ YAMAHA_DEVICE(0x7010, "UB99"),
.type = QUIRK_MIDI_STANDARD_INTERFACE
}
},
{ /*
* This quirk is for the "Advanced" modes of the Edirol UA-25.
* If the switch is not in an advanced setting, the UA-25 has
* ID 0x0582/0x0073 and is standard compliant (no quirks), but
* offers only 16-bit PCM at 44.1 kHz and no MIDI.
*/
USB_DEVICE_VENDOR_SPEC(0x0582, 0x0074),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
.vendor_name = "EDIROL",
.product_name = "UA-25",
.ifnum = QUIRK_ANY_INTERFACE,
.type = QUIRK_COMPOSITE,
.data = (const snd_usb_audio_quirk_t[]) {
{
.ifnum = 0,
.type = QUIRK_AUDIO_EDIROL_UA700_UA25
},
{
.ifnum = 1,
.type = QUIRK_AUDIO_EDIROL_UA700_UA25
},
{
.ifnum = 2,
.type = QUIRK_AUDIO_EDIROL_UA700_UA25
},
{
.ifnum = -1
}
}
}
},
/* Midiman/M-Audio devices */
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment