aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/usbaudio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/usbaudio.c')
-rw-r--r--sound/usb/usbaudio.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 8a8f62515b80..7ad8089b233e 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -3116,58 +3116,6 @@ static int create_uaxx_quirk(struct snd_usb_audio *chip,
3116 return 0; 3116 return 0;
3117} 3117}
3118 3118
3119/*
3120 * Create a stream for an Edirol UA-1000 interface.
3121 */
3122static int create_ua1000_quirk(struct snd_usb_audio *chip,
3123 struct usb_interface *iface,
3124 const struct snd_usb_audio_quirk *quirk)
3125{
3126 static const struct audioformat ua1000_format = {
3127 .format = SNDRV_PCM_FORMAT_S32_LE,
3128 .fmt_type = USB_FORMAT_TYPE_I,
3129 .altsetting = 1,
3130 .altset_idx = 1,
3131 .attributes = 0,
3132 .rates = SNDRV_PCM_RATE_CONTINUOUS,
3133 };
3134 struct usb_host_interface *alts;
3135 struct usb_interface_descriptor *altsd;
3136 struct audioformat *fp;
3137 int stream, err;
3138
3139 if (iface->num_altsetting != 2)
3140 return -ENXIO;
3141 alts = &iface->altsetting[1];
3142 altsd = get_iface_desc(alts);
3143 if (alts->extralen != 11 || alts->extra[1] != USB_DT_CS_INTERFACE ||
3144 altsd->bNumEndpoints != 1)
3145 return -ENXIO;
3146
3147 fp = kmemdup(&ua1000_format, sizeof(*fp), GFP_KERNEL);
3148 if (!fp)
3149 return -ENOMEM;
3150
3151 fp->channels = alts->extra[4];
3152 fp->iface = altsd->bInterfaceNumber;
3153 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;
3154 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
3155 fp->datainterval = parse_datainterval(chip, alts);
3156 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
3157 fp->rate_max = fp->rate_min = combine_triple(&alts->extra[8]);
3158
3159 stream = (fp->endpoint & USB_DIR_IN)
3160 ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK;
3161 err = add_audio_endpoint(chip, stream, fp);
3162 if (err < 0) {
3163 kfree(fp);
3164 return err;
3165 }
3166 /* FIXME: playback must be synchronized to capture */
3167 usb_set_interface(chip->dev, fp->iface, 0);
3168 return 0;
3169}
3170
3171static int snd_usb_create_quirk(struct snd_usb_audio *chip, 3119static int snd_usb_create_quirk(struct snd_usb_audio *chip,
3172 struct usb_interface *iface, 3120 struct usb_interface *iface,
3173 const struct snd_usb_audio_quirk *quirk); 3121 const struct snd_usb_audio_quirk *quirk);
@@ -3416,7 +3364,6 @@ static int snd_usb_create_quirk(struct snd_usb_audio *chip,
3416 [QUIRK_MIDI_CME] = create_any_midi_quirk, 3364 [QUIRK_MIDI_CME] = create_any_midi_quirk,
3417 [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk, 3365 [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk,
3418 [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk, 3366 [QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk,
3419 [QUIRK_AUDIO_EDIROL_UA1000] = create_ua1000_quirk,
3420 [QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk, 3367 [QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk,
3421 [QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk 3368 [QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk
3422 }; 3369 };