aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro Lopez-Cabanillas <pedro.lopez.cabanillas@gmail.com>2008-10-04 10:27:36 -0400
committerJaroslav Kysela <perex@perex.cz>2008-10-10 07:41:48 -0400
commit310e0dc01d15f6e792a54f971dc7b1e13d1c6e95 (patch)
tree1d5f9734d5197868cc74ba110be1fe83bbce3ce5
parent7a17daae8ed71bf3259d905a4fc48a5b424fa935 (diff)
ALSA: snd-usb-audio: support for Edirol UA-4FX device
Renamed the old quirk function for ua-700/ua-25 to become more generic, moving the MIDI interfaces to the quirk data header. Added a new quirk for the Edirol UA-4FX. Signed-off-by: Pedro Lopez-Cabanillas <pedro.lopez.cabanillas@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r--sound/usb/usbaudio.c41
-rw-r--r--sound/usb/usbaudio.h2
-rw-r--r--sound/usb/usbquirks.h54
3 files changed, 57 insertions, 40 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 8af12b680e12..6e70ba4ee21f 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -2997,12 +2997,12 @@ static int create_standard_audio_quirk(struct snd_usb_audio *chip,
2997} 2997}
2998 2998
2999/* 2999/*
3000 * Create a stream for an Edirol UA-700/UA-25 interface. The only way 3000 * Create a stream for an Edirol UA-700/UA-25/UA-4FX interface.
3001 * to detect the sample rate is by looking at wMaxPacketSize. 3001 * The only way to detect the sample rate is by looking at wMaxPacketSize.
3002 */ 3002 */
3003static int create_ua700_ua25_quirk(struct snd_usb_audio *chip, 3003static int create_uaxx_quirk(struct snd_usb_audio *chip,
3004 struct usb_interface *iface, 3004 struct usb_interface *iface,
3005 const struct snd_usb_audio_quirk *quirk) 3005 const struct snd_usb_audio_quirk *quirk)
3006{ 3006{
3007 static const struct audioformat ua_format = { 3007 static const struct audioformat ua_format = {
3008 .format = SNDRV_PCM_FORMAT_S24_3LE, 3008 .format = SNDRV_PCM_FORMAT_S24_3LE,
@@ -3017,37 +3017,12 @@ static int create_ua700_ua25_quirk(struct snd_usb_audio *chip,
3017 struct audioformat *fp; 3017 struct audioformat *fp;
3018 int stream, err; 3018 int stream, err;
3019 3019
3020 /* both PCM and MIDI interfaces have 2 altsettings */ 3020 /* both PCM and MIDI interfaces have 2 or more altsettings */
3021 if (iface->num_altsetting != 2) 3021 if (iface->num_altsetting < 2)
3022 return -ENXIO; 3022 return -ENXIO;
3023 alts = &iface->altsetting[1]; 3023 alts = &iface->altsetting[1];
3024 altsd = get_iface_desc(alts); 3024 altsd = get_iface_desc(alts);
3025 3025
3026 if (altsd->bNumEndpoints == 2) {
3027 static const struct snd_usb_midi_endpoint_info ua700_ep = {
3028 .out_cables = 0x0003,
3029 .in_cables = 0x0003
3030 };
3031 static const struct snd_usb_audio_quirk ua700_quirk = {
3032 .type = QUIRK_MIDI_FIXED_ENDPOINT,
3033 .data = &ua700_ep
3034 };
3035 static const struct snd_usb_midi_endpoint_info ua25_ep = {
3036 .out_cables = 0x0001,
3037 .in_cables = 0x0001
3038 };
3039 static const struct snd_usb_audio_quirk ua25_quirk = {
3040 .type = QUIRK_MIDI_FIXED_ENDPOINT,
3041 .data = &ua25_ep
3042 };
3043 if (chip->usb_id == USB_ID(0x0582, 0x002b))
3044 return snd_usb_create_midi_interface(chip, iface,
3045 &ua700_quirk);
3046 else
3047 return snd_usb_create_midi_interface(chip, iface,
3048 &ua25_quirk);
3049 }
3050
3051 if (altsd->bNumEndpoints != 1) 3026 if (altsd->bNumEndpoints != 1)
3052 return -ENXIO; 3027 return -ENXIO;
3053 3028
@@ -3377,9 +3352,9 @@ static int snd_usb_create_quirk(struct snd_usb_audio *chip,
3377 [QUIRK_MIDI_CME] = snd_usb_create_midi_interface, 3352 [QUIRK_MIDI_CME] = snd_usb_create_midi_interface,
3378 [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk, 3353 [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk,
3379 [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk, 3354 [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk,
3380 [QUIRK_AUDIO_EDIROL_UA700_UA25] = create_ua700_ua25_quirk,
3381 [QUIRK_AUDIO_EDIROL_UA1000] = create_ua1000_quirk, 3355 [QUIRK_AUDIO_EDIROL_UA1000] = create_ua1000_quirk,
3382 [QUIRK_AUDIO_EDIROL_UA101] = create_ua101_quirk, 3356 [QUIRK_AUDIO_EDIROL_UA101] = create_ua101_quirk,
3357 [QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk
3383 }; 3358 };
3384 3359
3385 if (quirk->type < QUIRK_TYPE_COUNT) { 3360 if (quirk->type < QUIRK_TYPE_COUNT) {
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index f3ca77f08eac..36e4f7a29adc 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -159,9 +159,9 @@ enum quirk_type {
159 QUIRK_MIDI_US122L, 159 QUIRK_MIDI_US122L,
160 QUIRK_AUDIO_STANDARD_INTERFACE, 160 QUIRK_AUDIO_STANDARD_INTERFACE,
161 QUIRK_AUDIO_FIXED_ENDPOINT, 161 QUIRK_AUDIO_FIXED_ENDPOINT,
162 QUIRK_AUDIO_EDIROL_UA700_UA25,
163 QUIRK_AUDIO_EDIROL_UA1000, 162 QUIRK_AUDIO_EDIROL_UA1000,
164 QUIRK_AUDIO_EDIROL_UA101, 163 QUIRK_AUDIO_EDIROL_UA101,
164 QUIRK_AUDIO_EDIROL_UAXX,
165 165
166 QUIRK_TYPE_COUNT 166 QUIRK_TYPE_COUNT
167}; 167};
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index d96bf8b2b94b..85532cf9dbf6 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -862,15 +862,19 @@ YAMAHA_DEVICE(0x7010, "UB99"),
862 .data = (const struct snd_usb_audio_quirk[]) { 862 .data = (const struct snd_usb_audio_quirk[]) {
863 { 863 {
864 .ifnum = 1, 864 .ifnum = 1,
865 .type = QUIRK_AUDIO_EDIROL_UA700_UA25 865 .type = QUIRK_AUDIO_EDIROL_UAXX
866 }, 866 },
867 { 867 {
868 .ifnum = 2, 868 .ifnum = 2,
869 .type = QUIRK_AUDIO_EDIROL_UA700_UA25 869 .type = QUIRK_AUDIO_EDIROL_UAXX
870 }, 870 },
871 { 871 {
872 .ifnum = 3, 872 .ifnum = 3,
873 .type = QUIRK_AUDIO_EDIROL_UA700_UA25 873 .type = QUIRK_MIDI_FIXED_ENDPOINT,
874 .data = & (const struct snd_usb_midi_endpoint_info) {
875 .out_cables = 0x0003,
876 .in_cables = 0x0003
877 }
874 }, 878 },
875 { 879 {
876 .ifnum = -1 880 .ifnum = -1
@@ -1204,15 +1208,19 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1204 .data = (const struct snd_usb_audio_quirk[]) { 1208 .data = (const struct snd_usb_audio_quirk[]) {
1205 { 1209 {
1206 .ifnum = 0, 1210 .ifnum = 0,
1207 .type = QUIRK_AUDIO_EDIROL_UA700_UA25 1211 .type = QUIRK_AUDIO_EDIROL_UAXX
1208 }, 1212 },
1209 { 1213 {
1210 .ifnum = 1, 1214 .ifnum = 1,
1211 .type = QUIRK_AUDIO_EDIROL_UA700_UA25 1215 .type = QUIRK_AUDIO_EDIROL_UAXX
1212 }, 1216 },
1213 { 1217 {
1214 .ifnum = 2, 1218 .ifnum = 2,
1215 .type = QUIRK_AUDIO_EDIROL_UA700_UA25 1219 .type = QUIRK_MIDI_FIXED_ENDPOINT,
1220 .data = & (const struct snd_usb_midi_endpoint_info) {
1221 .out_cables = 0x0001,
1222 .in_cables = 0x0001
1223 }
1216 }, 1224 },
1217 { 1225 {
1218 .ifnum = -1 1226 .ifnum = -1
@@ -1345,6 +1353,40 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1345 } 1353 }
1346 } 1354 }
1347}, 1355},
1356{
1357 /*
1358 * This quirk is for the "Advanced Driver" mode. If off, the UA-4FX
1359 * is standard compliant, but has only 16-bit PCM and no MIDI.
1360 */
1361 USB_DEVICE(0x0582, 0x00a3),
1362 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1363 .vendor_name = "EDIROL",
1364 .product_name = "UA-4FX",
1365 .ifnum = QUIRK_ANY_INTERFACE,
1366 .type = QUIRK_COMPOSITE,
1367 .data = (const struct snd_usb_audio_quirk[]) {
1368 {
1369 .ifnum = 0,
1370 .type = QUIRK_AUDIO_EDIROL_UAXX
1371 },
1372 {
1373 .ifnum = 1,
1374 .type = QUIRK_AUDIO_EDIROL_UAXX
1375 },
1376 {
1377 .ifnum = 2,
1378 .type = QUIRK_MIDI_FIXED_ENDPOINT,
1379 .data = & (const struct snd_usb_midi_endpoint_info) {
1380 .out_cables = 0x0001,
1381 .in_cables = 0x0001
1382 }
1383 },
1384 {
1385 .ifnum = -1
1386 }
1387 }
1388 }
1389},
1348 /* TODO: add Edirol MD-P1 support */ 1390 /* TODO: add Edirol MD-P1 support */
1349{ 1391{
1350 USB_DEVICE(0x582, 0x00a6), 1392 USB_DEVICE(0x582, 0x00a6),