aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/usbaudio.c
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 /sound/usb/usbaudio.c
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>
Diffstat (limited to 'sound/usb/usbaudio.c')
-rw-r--r--sound/usb/usbaudio.c41
1 files changed, 8 insertions, 33 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) {