Update of /cvsroot/alsa/alsa-kernel/usb
In directory sc8-pr-cvs1:/tmp/cvs-serv19710
Modified Files:
usbaudio.c usbaudio.h usbquirks.h
Log Message:
fixes by Clemens Ladisch <[EMAIL PROTECTED]>
- split QUIRK_STANDARD_INTERFACE into QUIRK_AUDIO_STANDARD_INTERFACE
and QUIRK_MIDI_STANDARD_INTERFACE
- add quirk for Edirol UA-20
Index: usbaudio.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbaudio.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- usbaudio.c 4 Jun 2003 12:43:55 -0000 1.56
+++ usbaudio.c 18 Jun 2003 12:55:34 -0000 1.57
@@ -2381,7 +2381,8 @@
* create a stream for an interface with proper descriptors
*/
static int create_standard_interface_quirk(snd_usb_audio_t *chip,
- struct usb_interface *iface)
+ struct usb_interface *iface,
+ const snd_usb_audio_quirk_t *quirk)
{
struct usb_host_interface *alts;
struct usb_interface_descriptor *altsd;
@@ -2389,19 +2390,18 @@
alts = &iface->altsetting[0];
altsd = get_iface_desc(alts);
- switch (altsd->bInterfaceSubClass) {
- case USB_SUBCLASS_AUDIO_STREAMING:
+ switch (quirk->type) {
+ case QUIRK_AUDIO_STANDARD_INTERFACE:
err = parse_audio_endpoints(chip, altsd->bInterfaceNumber);
if (!err)
usb_set_interface(chip->dev, altsd->bInterfaceNumber, 0); /*
reset the current interface */
break;
- case USB_SUBCLASS_MIDI_STREAMING:
+ case QUIRK_MIDI_STANDARD_INTERFACE:
err = snd_usb_create_midi_interface(chip, iface, NULL);
break;
default:
- snd_printk(KERN_ERR "if %d: non-supported subclass %d\n",
- altsd->bInterfaceNumber, altsd->bInterfaceSubClass);
- return -ENODEV;
+ snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type);
+ return -ENXIO;
}
if (err < 0) {
snd_printk(KERN_ERR "cannot setup if %d: error %d\n",
@@ -2495,8 +2495,9 @@
return create_composite_quirk(chip, iface, quirk);
case QUIRK_AUDIO_FIXED_ENDPOINT:
return create_fixed_stream_quirk(chip, iface, quirk);
- case QUIRK_STANDARD_INTERFACE:
- return create_standard_interface_quirk(chip, iface);
+ case QUIRK_AUDIO_STANDARD_INTERFACE:
+ case QUIRK_MIDI_STANDARD_INTERFACE:
+ return create_standard_interface_quirk(chip, iface, quirk);
default:
snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type);
return -ENXIO;
Index: usbaudio.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbaudio.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- usbaudio.h 13 May 2003 10:44:09 -0000 1.17
+++ usbaudio.h 18 Jun 2003 12:55:34 -0000 1.18
@@ -154,7 +154,8 @@
#define QUIRK_MIDI_MIDIMAN 2
#define QUIRK_COMPOSITE 3
#define QUIRK_AUDIO_FIXED_ENDPOINT 4
-#define QUIRK_STANDARD_INTERFACE 5
+#define QUIRK_AUDIO_STANDARD_INTERFACE 5
+#define QUIRK_MIDI_STANDARD_INTERFACE 6
typedef struct snd_usb_audio_quirk snd_usb_audio_quirk_t;
typedef struct snd_usb_midi_endpoint_info snd_usb_midi_endpoint_info_t;
@@ -184,7 +185,7 @@
/* for QUIRK_AUDIO_FIXED_ENDPOINT, data points to an audioformat structure */
-/* for QUIRK_STANDARD_INTERFACE, data is NULL */
+/* for QUIRK_AUDIO/MIDI_STANDARD_INTERFACE, data is NULL */
/*
*/
Index: usbquirks.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbquirks.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- usbquirks.h 13 May 2003 10:44:09 -0000 1.20
+++ usbquirks.h 18 Jun 2003 12:55:34 -0000 1.21
@@ -453,6 +453,36 @@
}
}
},
+{ /*
+ * This quirk is for the "Advanced Driver" mode of the Edirol UA-5.
+ * If the advanced mode switch at the back of the unit is off, the
+ * UA-5 has ID 0x0582/0x0011 and is standard compliant (no quirks),
+ * but offers only 16-bit PCM.
+ * In advanced mode, the UA-5 will output S24_3LE samples (two
+ * channels) at the rate indicated on the front switch, including
+ * the 96kHz sample rate.
+ */
+ USB_DEVICE(0x0582, 0x0010),
+ .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+ .vendor_name = "EDIROL",
+ .product_name = "UA-5",
+ .ifnum = QUIRK_ANY_INTERFACE,
+ .type = QUIRK_COMPOSITE,
+ .data = & (const snd_usb_audio_quirk_t[]) {
+ {
+ .ifnum = 1,
+ .type = QUIRK_AUDIO_STANDARD_INTERFACE
+ },
+ {
+ .ifnum = 2,
+ .type = QUIRK_AUDIO_STANDARD_INTERFACE
+ },
+ {
+ .ifnum = -1
+ }
+ }
+ }
+},
{
USB_DEVICE(0x0582, 0x0012),
.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
@@ -520,15 +550,15 @@
.data = & (const snd_usb_audio_quirk_t[]) {
{
.ifnum = 1,
- .type = QUIRK_STANDARD_INTERFACE
+ .type = QUIRK_AUDIO_STANDARD_INTERFACE
},
{
.ifnum = 2,
- .type = QUIRK_STANDARD_INTERFACE
+ .type = QUIRK_AUDIO_STANDARD_INTERFACE
},
{
.ifnum = 3,
- .type = QUIRK_STANDARD_INTERFACE
+ .type = QUIRK_MIDI_STANDARD_INTERFACE
},
{
.ifnum = -1
-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog