aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-03-10 10:10:04 +0100
committerTakashi Iwai <tiwai@suse.de>2010-03-10 10:10:04 +0100
commit24c396ddaad841403b05c54f4c6917535f3e9ec4 (patch)
tree3921edd033e8517e8f589375d5cdd1417c9c9832
parent2e86e71e26549e748bf126f483b2837248368ad4 (diff)
downloadalsa-driver-build-unstable-24c396ddaad841403b05c54f4c6917535f3e9ec4.tar.gz
Regenerate patches and build-stubs for usb refactoring
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--.gitignore8
-rw-r--r--usb/Makefile12
-rw-r--r--usb/card.inc8
-rw-r--r--usb/card.inc1 (renamed from usb/usbaudio.inc1)0
-rw-r--r--usb/card.patch102
-rw-r--r--usb/endpoint.patch44
-rw-r--r--usb/format.c3
-rw-r--r--usb/helper.patch22
-rw-r--r--usb/midi.inc (renamed from usb/usbmidi.inc)0
-rw-r--r--usb/midi.inc1 (renamed from usb/usbmidi.inc1)0
-rw-r--r--usb/midi.patch (renamed from usb/usbmidi.patch)26
-rw-r--r--usb/misc/Makefile10
-rw-r--r--usb/misc/ua101.c3
-rw-r--r--usb/pcm.c3
-rw-r--r--usb/proc.c3
-rw-r--r--usb/quirks.patch77
-rw-r--r--usb/ua101.c3
-rw-r--r--usb/urb.patch72
-rw-r--r--usb/usbaudio.inc7
-rw-r--r--usb/usbaudio.patch302
20 files changed, 374 insertions, 331 deletions
diff --git a/.gitignore b/.gitignore
index 0db161f59..d1eccdf52 100644
--- a/.gitignore
+++ b/.gitignore
@@ -115,9 +115,13 @@ soc/soc-core.c
sparc/amd7930.c
sparc/cs4231.c
sparc/dbri.c
-usb/usbaudio.c
-usb/usbmidi.c
+usb/card.c
+usb/endpoint.c
+usb/helper.c
+usb/midi.c
usb/usbmixer.c
+usb/urb.c
+usb/quirks.c
usb/caiaq/audio.c
usb/caiaq/device.c
usb/caiaq/input.c
diff --git a/usb/Makefile b/usb/Makefile
index 1f206a112..78a5270c8 100644
--- a/usb/Makefile
+++ b/usb/Makefile
@@ -5,11 +5,11 @@ endif
include $(SND_TOPDIR)/toplevel.config
include $(SND_TOPDIR)/Makefile.conf
-clean-files := usbaudio.c usbmidi.c usbmixer.c
+clean-files := card.c endpoint.c helper.c quirks.c urb.c midi.c usbmixer.c
# for compatibility
extra-snd-usb-lib-objs := usbcompat.o
-export-objs := usbmidi.o usbcompat.o
+export-objs := midi.o usbcompat.o
include $(SND_TOPDIR)/alsa-kernel/usb/Makefile
@@ -17,6 +17,10 @@ EXTRA_CFLAGS += -I$(SND_TOPDIR)/alsa-kernel/usb
include $(SND_TOPDIR)/Rules.make
-usbaudio.c: usbaudio.patch usbaudio.inc usbaudio.inc1 $(SND_TOPDIR)/alsa-kernel/usb/usbaudio.c
-usbmidi.c: usbmidi.patch usbmidi.inc usbmidi.inc1 $(SND_TOPDIR)/alsa-kernel/usb/usbmidi.c
+card.c: card.patch card.inc card.inc1 usbaudio.inc $(SND_TOPDIR)/alsa-kernel/usb/card.c
+endpoint.c: endpoint.patch usbaudio.inc $(SND_TOPDIR)/alsa-kernel/usb/endpoint.c
+helper.c: helper.patch usbaudio.inc $(SND_TOPDIR)/alsa-kernel/usb/helper.c
+quirks.c: quirks.patch usbaudio.inc $(SND_TOPDIR)/alsa-kernel/usb/quirks.c
+urb.c: urb.patch usbaudio.inc $(SND_TOPDIR)/alsa-kernel/usb/urb.c
+midi.c: midi.patch midi.inc midi.inc1 $(SND_TOPDIR)/alsa-kernel/usb/midi.c
usbmixer.c: usbmixer.patch $(SND_TOPDIR)/alsa-kernel/usb/usbmixer.c
diff --git a/usb/card.inc b/usb/card.inc
new file mode 100644
index 000000000..4b9f7849d
--- /dev/null
+++ b/usb/card.inc
@@ -0,0 +1,8 @@
+#include "usbaudio.inc"
+#ifdef OLD_USB
+static void * usb_audio_probe(struct usb_device *dev, unsigned int ifnum,
+ const struct usb_device_id *id);
+static void usb_audio_disconnect(struct usb_device *dev, void *ptr);
+static int usb_reset_configuration(struct usb_device *dev);
+#endif
+
diff --git a/usb/usbaudio.inc1 b/usb/card.inc1
index 56649e589..56649e589 100644
--- a/usb/usbaudio.inc1
+++ b/usb/card.inc1
diff --git a/usb/card.patch b/usb/card.patch
new file mode 100644
index 000000000..14ee3f6ab
--- /dev/null
+++ b/usb/card.patch
@@ -0,0 +1,102 @@
+--- ../alsa-kernel/usb/card.c 2010-03-10 09:22:24.488022926 +0100
++++ card.c 2010-03-10 09:58:02.287522401 +0100
+@@ -1,3 +1,4 @@
++#include "card.inc"
+ /*
+ * (Tentative) USB Audio Driver for ALSA
+ *
+@@ -78,7 +79,12 @@
+ static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 };
+ static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 };
+ static int nrpacks = 8; /* max. number of packets per urb */
+-static int async_unlink = 1;
++static int async_unlink =
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
++1;
++#else
++0; /* disabled as default for buggy async-unlink handling */
++#endif
+ static int device_setup[SNDRV_CARDS]; /* device parameter for this card */
+ static int ignore_ctl_error;
+
+@@ -237,7 +243,11 @@
+ case UAC_VERSION_2: {
+ struct uac_clock_source_descriptor *cs;
+ struct usb_interface_assoc_descriptor *assoc =
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)
+ usb_ifnum_to_if(dev, ctrlif)->intf_assoc;
++#else
++ NULL;
++#endif
+
+ if (!assoc) {
+ snd_printk(KERN_ERR "Audio class v2 interfaces need an interface association\n");
+@@ -340,8 +350,13 @@
+ chip->nrpacks = nrpacks;
+ chip->async_unlink = async_unlink;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+ chip->usb_id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
+ le16_to_cpu(dev->descriptor.idProduct));
++#else
++ chip->usb_id = USB_ID(dev->descriptor.idVendor,
++ dev->descriptor.idProduct);
++#endif
+ INIT_LIST_HEAD(&chip->pcm_list);
+ INIT_LIST_HEAD(&chip->midi_list);
+ INIT_LIST_HEAD(&chip->mixer_list);
+@@ -427,8 +442,12 @@
+
+ alts = &intf->altsetting[0];
+ ifnum = get_iface_desc(alts)->bInterfaceNumber;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+ id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
+ le16_to_cpu(dev->descriptor.idProduct));
++#else
++ id = USB_ID(dev->descriptor.idVendor, dev->descriptor.idProduct);
++#endif
+ if (quirk && quirk->ifnum >= 0 && ifnum != quirk->ifnum)
+ goto __err_val;
+
+@@ -546,6 +565,7 @@
+ }
+ }
+
++#ifndef OLD_USB
+ /*
+ * new 2.5 USB kernel API
+ */
+@@ -606,6 +626,7 @@
+ return 0;
+ }
+ #endif /* CONFIG_PM */
++#endif /* OLD_USB */
+
+ static struct usb_device_id usb_audio_ids [] = {
+ #include "quirks-table.h"
+@@ -622,11 +643,19 @@
+ */
+
+ static struct usb_driver usb_audio_driver = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 70) && LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) /* FIXME: find right number */
++ .owner = THIS_MODULE,
++#endif
+ .name = "snd-usb-audio",
+ .probe = usb_audio_probe,
+ .disconnect = usb_audio_disconnect,
++#ifndef OLD_USB
+ .suspend = usb_audio_suspend,
+ .resume = usb_audio_resume,
++#endif
++#ifdef OLD_USB
++ .driver_list = LIST_HEAD_INIT(usb_audio_driver.driver_list),
++#endif
+ .id_table = usb_audio_ids,
+ };
+
+@@ -646,3 +675,5 @@
+
+ module_init(snd_usb_audio_init);
+ module_exit(snd_usb_audio_cleanup);
++
++#include "card.inc1"
diff --git a/usb/endpoint.patch b/usb/endpoint.patch
new file mode 100644
index 000000000..7b124c061
--- /dev/null
+++ b/usb/endpoint.patch
@@ -0,0 +1,44 @@
+--- ../alsa-kernel/usb/endpoint.c 2010-03-10 09:22:24.488022926 +0100
++++ endpoint.c 2010-03-10 10:07:52.316022217 +0100
+@@ -1,3 +1,5 @@
++#define __NO_VERSION__
++#include "usbaudio.inc"
+ /*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+@@ -183,7 +185,11 @@
+ (altsd->bInterfaceSubClass != USB_SUBCLASS_AUDIOSTREAMING &&
+ altsd->bInterfaceSubClass != USB_SUBCLASS_VENDOR_SPEC) ||
+ altsd->bNumEndpoints < 1 ||
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+ le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize) == 0)
++#else
++ get_endpoint(alts, 0)->wMaxPacketSize == 0)
++#endif
+ continue;
+ /* must be isochronous */
+ if ((get_endpoint(alts, 0)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) !=
+@@ -270,7 +276,11 @@
+ fp && fp->altsetting == 1 && fp->channels == 1 &&
+ fp->formats == SNDRV_PCM_FMTBIT_S16_LE &&
+ protocol == UAC_VERSION_1 &&
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+ le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize) ==
++#else
++ get_endpoint(alts, 0)->wMaxPacketSize ==
++#endif
+ fp->maxpacksize * 2)
+ continue;
+
+@@ -297,7 +307,11 @@
+ fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;
+ fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
+ fp->datainterval = snd_usb_parse_datainterval(chip, alts);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+ fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
++#else
++ fp->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize;
++#endif
+ /* num_channels is only set for v2 interfaces */
+ fp->channels = num_channels;
+ if (snd_usb_get_speed(dev) == USB_SPEED_HIGH)
diff --git a/usb/format.c b/usb/format.c
new file mode 100644
index 000000000..739dc1181
--- /dev/null
+++ b/usb/format.c
@@ -0,0 +1,3 @@
+#define __NO_VERSION__
+#include "usbaudio.inc"
+#include "../alsa-kernel/usb/format.c"
diff --git a/usb/helper.patch b/usb/helper.patch
new file mode 100644
index 000000000..941624fdc
--- /dev/null
+++ b/usb/helper.patch
@@ -0,0 +1,22 @@
+--- ../alsa-kernel/usb/helper.c 2010-03-10 09:22:24.488022926 +0100
++++ helper.c 2010-03-10 09:52:23.975522071 +0100
+@@ -1,3 +1,5 @@
++#define __NO_VERSION__
++#include "usbaudio.inc"
+ /*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+@@ -90,8 +92,13 @@
+ if (!buf)
+ return -ENOMEM;
+ }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12)
+ err = usb_control_msg(dev, pipe, request, requesttype,
+ value, index, buf, size, timeout);
++#else
++ err = usb_control_msg(dev, pipe, request, requesttype,
++ value, index, buf, size, timeout * HZ / 1000);
++#endif
+ if (size > 0) {
+ memcpy(data, buf, size);
+ kfree(buf);
diff --git a/usb/usbmidi.inc b/usb/midi.inc
index be3a8b2be..be3a8b2be 100644
--- a/usb/usbmidi.inc
+++ b/usb/midi.inc
diff --git a/usb/usbmidi.inc1 b/usb/midi.inc1
index fa9296dd8..fa9296dd8 100644
--- a/usb/usbmidi.inc1
+++ b/usb/midi.inc1
diff --git a/usb/usbmidi.patch b/usb/midi.patch
index 612dfa76b..68887907d 100644
--- a/usb/usbmidi.patch
+++ b/usb/midi.patch
@@ -1,12 +1,12 @@
---- ../alsa-kernel/usb/usbmidi.c 2009-11-23 08:30:55.000000000 +0100
-+++ usbmidi.c 2009-12-16 19:56:07.000000000 +0100
+--- ../alsa-kernel/usb/midi.c 2010-03-10 09:22:24.488022926 +0100
++++ midi.c 2010-03-10 09:26:34.028022239 +0100
@@ -1,3 +1,5 @@
-+#include "usbmidi.inc"
++#include "midi.inc"
+
/*
* usbmidi.c - ALSA USB MIDI driver
*
-@@ -243,7 +245,11 @@
+@@ -246,7 +248,11 @@
/*
* Processes the data read from the device.
*/
@@ -18,7 +18,7 @@
{
struct snd_usb_midi_in_endpoint* ep = urb->context;
-@@ -267,7 +273,11 @@
+@@ -270,7 +276,11 @@
snd_usbmidi_submit_urb(urb, GFP_ATOMIC);
}
@@ -30,7 +30,7 @@
{
struct out_urb_context *context = urb->context;
struct snd_usb_midi_out_endpoint* ep = context->ep;
-@@ -377,8 +387,13 @@
+@@ -380,8 +390,13 @@
return -ENOMEM;
dump_urb("sending", buf, len);
if (ep->urbs[0].urb)
@@ -44,7 +44,7 @@
kfree(buf);
return err;
}
-@@ -894,7 +909,12 @@
+@@ -897,7 +912,12 @@
int is_light_load;
intf = umidi->iface;
@@ -57,7 +57,7 @@
if (umidi->roland_load_ctl->private_value == is_light_load)
return;
hostif = &intf->altsetting[umidi->roland_load_ctl->private_value];
-@@ -981,7 +1001,11 @@
+@@ -984,7 +1004,11 @@
struct usbmidi_out_port* port = substream->runtime->private_data;
struct snd_usb_midi_out_endpoint *ep = port->ep;
unsigned int drain_urbs;
@@ -69,7 +69,7 @@
long timeout = msecs_to_jiffies(50);
/*
-@@ -992,6 +1016,7 @@
+@@ -995,6 +1019,7 @@
drain_urbs = ep->active_urbs;
if (drain_urbs) {
ep->drain_urbs |= drain_urbs;
@@ -77,7 +77,7 @@
do {
prepare_to_wait(&ep->drain_wait, &wait,
TASK_UNINTERRUPTIBLE);
-@@ -1001,6 +1026,18 @@
+@@ -1004,6 +1029,18 @@
drain_urbs &= ep->drain_urbs;
} while (drain_urbs && timeout);
finish_wait(&ep->drain_wait, &wait);
@@ -96,7 +96,7 @@
}
spin_unlock_irq(&ep->buffer_lock);
}
-@@ -1679,7 +1716,11 @@
+@@ -1700,7 +1737,11 @@
intf = umidi->iface;
if (!intf || intf->num_altsetting < 1)
return -ENOENT;
@@ -108,9 +108,9 @@
intfd = get_iface_desc(hostif);
for (i = 0; i < intfd->bNumEndpoints; ++i) {
-@@ -2046,3 +2087,5 @@
+@@ -2067,3 +2108,5 @@
EXPORT_SYMBOL(snd_usbmidi_input_stop);
EXPORT_SYMBOL(snd_usbmidi_input_start);
EXPORT_SYMBOL(snd_usbmidi_disconnect);
+
-+#include "usbmidi.inc1"
++#include "midi.inc1"
diff --git a/usb/misc/Makefile b/usb/misc/Makefile
new file mode 100644
index 000000000..a18f311cf
--- /dev/null
+++ b/usb/misc/Makefile
@@ -0,0 +1,10 @@
+ifndef SND_TOPDIR
+SND_TOPDIR=../..
+endif
+
+include $(SND_TOPDIR)/toplevel.config
+include $(SND_TOPDIR)/Makefile.conf
+
+include $(SND_TOPDIR)/alsa-kernel/usb/misc/Makefile
+
+include $(SND_TOPDIR)/Rules.make
diff --git a/usb/misc/ua101.c b/usb/misc/ua101.c
new file mode 100644
index 000000000..c89482d3b
--- /dev/null
+++ b/usb/misc/ua101.c
@@ -0,0 +1,3 @@
+#include "adriver.h"
+#include "../../alsa-kernel/usb/misc/ua101.c"
+EXPORT_NO_SYMBOLS;
diff --git a/usb/pcm.c b/usb/pcm.c
new file mode 100644
index 000000000..e1c20e241
--- /dev/null
+++ b/usb/pcm.c
@@ -0,0 +1,3 @@
+#define __NO_VERSION__
+#include "usbaudio.inc"
+#include "../alsa-kernel/usb/pcm.c"
diff --git a/usb/proc.c b/usb/proc.c
new file mode 100644
index 000000000..4de98bd93
--- /dev/null
+++ b/usb/proc.c
@@ -0,0 +1,3 @@
+#define __NO_VERSION__
+#include "usbaudio.inc"
+#include "../alsa-kernel/usb/proc.c"
diff --git a/usb/quirks.patch b/usb/quirks.patch
new file mode 100644
index 000000000..051d45016
--- /dev/null
+++ b/usb/quirks.patch
@@ -0,0 +1,77 @@
+--- ../alsa-kernel/usb/quirks.c 2010-03-10 09:22:24.488022926 +0100
++++ quirks.c 2010-03-10 09:59:44.787522189 +0100
+@@ -1,3 +1,5 @@
++#define __NO_VERSION__
++#include "usbaudio.inc"
+ /*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+@@ -157,7 +159,11 @@
+ }
+ alts = &iface->altsetting[fp->altset_idx];
+ fp->datainterval = snd_usb_parse_datainterval(chip, alts);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+ fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
++#else
++ fp->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize;
++#endif
+ usb_set_interface(chip->dev, fp->iface, 0);
+ snd_usb_init_pitch(chip, fp->iface, alts, fp);
+ snd_usb_init_sample_rate(chip, fp->iface, alts, fp, fp->rate_max);
+@@ -228,7 +234,11 @@
+ fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;
+ fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
+ fp->datainterval = 0;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+ fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
++#else
++ fp->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize;
++#endif
+
+ switch (fp->maxpacksize) {
+ case 0x120:
+@@ -313,8 +323,13 @@
+ struct usb_host_config *config = dev->actconfig;
+ int err;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+ if (le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_OLD ||
+ le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_NEW) {
++#else
++ if (get_cfg_desc(config)->wTotalLength == EXTIGY_FIRMWARE_SIZE_OLD ||
++ get_cfg_desc(config)->wTotalLength == EXTIGY_FIRMWARE_SIZE_NEW) {
++#endif
+ snd_printdd("sending Extigy boot sequence...\n");
+ /* Send message to force it to reconnect with full interface. */
+ err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev,0),
+@@ -326,8 +341,13 @@
+ if (err < 0) snd_printdd("error usb_get_descriptor: %d\n", err);
+ err = usb_reset_configuration(dev);
+ if (err < 0) snd_printdd("error usb_reset_configuration: %d\n", err);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+ snd_printdd("extigy_boot: new boot length = %d\n",
+ le16_to_cpu(get_cfg_desc(config)->wTotalLength));
++#else
++ snd_printdd("extigy_boot: new boot length = %d\n",
++ get_cfg_desc(config)->wTotalLength);
++#endif
+ return -ENODEV; /* quit this anyway */
+ }
+ return 0;
+@@ -335,6 +355,8 @@
+
+ static int snd_usb_audigy2nx_boot_quirk(struct usb_device *dev)
+ {
++/* The pre-2.6.13 EHCI driver blows up when doing high speed iso transfers */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+ u8 buf = 1;
+
+ snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 0x2a,
+@@ -346,6 +368,7 @@
+ 1, 2000, NULL, 0, 1000);
+ return -ENODEV;
+ }
++#endif
+ return 0;
+ }
+
diff --git a/usb/ua101.c b/usb/ua101.c
deleted file mode 100644
index 131b9776c..000000000
--- a/usb/ua101.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "adriver.h"
-#include "../alsa-kernel/usb/ua101.c"
-EXPORT_NO_SYMBOLS;
diff --git a/usb/urb.patch b/usb/urb.patch
new file mode 100644
index 000000000..6637745ec
--- /dev/null
+++ b/usb/urb.patch
@@ -0,0 +1,72 @@
+--- ../alsa-kernel/usb/urb.c 2010-03-10 09:22:24.488022926 +0100
++++ urb.c 2010-03-10 09:53:00.839522084 +0100
+@@ -1,3 +1,5 @@
++#define __NO_VERSION__
++#include "usbaudio.inc"
+ /*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+@@ -69,9 +71,12 @@
+ if (test_bit(i, &subs->active_mask)) {
+ if (!test_and_set_bit(i, &subs->unlink_mask)) {
+ struct urb *u = subs->dataurb[i].urb;
+- if (async)
++ if (async) {
++#ifdef URB_ASYNC_UNLINK
++ u->transfer_flags |= URB_ASYNC_UNLINK;
++#endif
+ usb_unlink_urb(u);
+- else
++ } else
+ usb_kill_urb(u);
+ }
+ }
+@@ -81,9 +86,12 @@
+ if (test_bit(i+16, &subs->active_mask)) {
+ if (!test_and_set_bit(i+16, &subs->unlink_mask)) {
+ struct urb *u = subs->syncurb[i].urb;
+- if (async)
++ if (async) {
++#ifdef URB_ASYNC_UNLINK
++ u->transfer_flags |= URB_ASYNC_UNLINK;
++#endif
+ usb_unlink_urb(u);
+- else
++ } else
+ usb_kill_urb(u);
+ }
+ }
+@@ -162,7 +170,11 @@
+ /*
+ * complete callback from data urb
+ */
++#if !defined(OLD_USB) && !defined(CONFIG_SND_NEW_IRQ_HANDLER)
++static void snd_complete_urb(struct urb *urb, struct pt_regs *regs)
++#else
+ static void snd_complete_urb(struct urb *urb)
++#endif
+ {
+ struct snd_urb_ctx *ctx = urb->context;
+ struct snd_usb_substream *subs = ctx->subs;
+@@ -185,7 +197,11 @@
+ /*
+ * complete callback from sync urb
+ */
++#if !defined(OLD_USB) && !defined(CONFIG_SND_NEW_IRQ_HANDLER)
++static void snd_complete_sync_urb(struct urb *urb, struct pt_regs *regs)
++#else
+ static void snd_complete_sync_urb(struct urb *urb)
++#endif
+ {
+ struct snd_urb_ctx *ctx = urb->context;
+ struct snd_usb_substream *subs = ctx->subs;
+@@ -333,7 +349,9 @@
+ if (!u->urb)
+ goto out_of_memory;
+ u->urb->transfer_buffer = subs->syncbuf + i * 4;
++#ifdef HAVE_USB_BUFFERS
+ u->urb->transfer_dma = subs->sync_dma + i * 4;
++#endif
+ u->urb->transfer_buffer_length = 4;
+ u->urb->pipe = subs->syncpipe;
+ u->urb->transfer_flags = URB_ISO_ASAP |
diff --git a/usb/usbaudio.inc b/usb/usbaudio.inc
index 30d231c04..f883782b6 100644
--- a/usb/usbaudio.inc
+++ b/usb/usbaudio.inc
@@ -19,13 +19,6 @@
#define USB_DT_CS_ENDPOINT 0x25
#endif
-#ifdef OLD_USB
-static void * usb_audio_probe(struct usb_device *dev, unsigned int ifnum,
- const struct usb_device_id *id);
-static void usb_audio_disconnect(struct usb_device *dev, void *ptr);
-static int usb_reset_configuration(struct usb_device *dev);
-#endif
-
#ifndef USB_ENDPOINT_SYNCTYPE
#define USB_ENDPOINT_SYNCTYPE 0x0c
#define USB_ENDPOINT_SYNC_NONE (0 << 2)
diff --git a/usb/usbaudio.patch b/usb/usbaudio.patch
deleted file mode 100644
index 44fa82cbf..000000000
--- a/usb/usbaudio.patch
+++ /dev/null
@@ -1,302 +0,0 @@
---- ../alsa-kernel/usb/usbaudio.c 2010-03-02 11:29:15.000000000 +0100
-+++ usbaudio.c 2010-03-02 11:32:39.000000000 +0100
-@@ -1,3 +1,4 @@
-+#include "usbaudio.inc"
- /*
- * (Tentative) USB Audio Driver for ALSA
- *
-@@ -71,7 +72,12 @@
- static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 };
- static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 };
- static int nrpacks = 8; /* max. number of packets per urb */
--static int async_unlink = 1;
-+static int async_unlink =
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
-+1;
-+#else
-+0; /* disabled as default for buggy async-unlink handling */
-+#endif
- static int device_setup[SNDRV_CARDS]; /* device parameter for this card*/
- static int ignore_ctl_error;
-
-@@ -704,7 +710,11 @@
- /*
- * complete callback from data urb
- */
-+#if !defined(OLD_USB) && !defined(CONFIG_SND_NEW_IRQ_HANDLER)
-+static void snd_complete_urb(struct urb *urb, struct pt_regs *regs)
-+#else
- static void snd_complete_urb(struct urb *urb)
-+#endif
- {
- struct snd_urb_ctx *ctx = urb->context;
- struct snd_usb_substream *subs = ctx->subs;
-@@ -727,7 +737,11 @@
- /*
- * complete callback from sync urb
- */
-+#if !defined(OLD_USB) && !defined(CONFIG_SND_NEW_IRQ_HANDLER)
-+static void snd_complete_sync_urb(struct urb *urb, struct pt_regs *regs)
-+#else
- static void snd_complete_sync_urb(struct urb *urb)
-+#endif
- {
- struct snd_urb_ctx *ctx = urb->context;
- struct snd_usb_substream *subs = ctx->subs;
-@@ -769,9 +783,12 @@
- if (test_bit(i, &subs->active_mask)) {
- if (!test_and_set_bit(i, &subs->unlink_mask)) {
- struct urb *u = subs->dataurb[i].urb;
-- if (async)
-+ if (async) {
-+#ifdef URB_ASYNC_UNLINK
-+ u->transfer_flags |= URB_ASYNC_UNLINK;
-+#endif
- usb_unlink_urb(u);
-- else
-+ } else
- usb_kill_urb(u);
- }
- }
-@@ -781,9 +798,12 @@
- if (test_bit(i+16, &subs->active_mask)) {
- if (!test_and_set_bit(i+16, &subs->unlink_mask)) {
- struct urb *u = subs->syncurb[i].urb;
-- if (async)
-+ if (async) {
-+#ifdef URB_ASYNC_UNLINK
-+ u->transfer_flags |= URB_ASYNC_UNLINK;
-+#endif
- usb_unlink_urb(u);
-- else
-+ } else
- usb_kill_urb(u);
- }
- }
-@@ -1139,7 +1159,9 @@
- if (!u->urb)
- goto out_of_memory;
- u->urb->transfer_buffer = subs->syncbuf + i * 4;
-+#ifdef HAVE_USB_BUFFERS
- u->urb->transfer_dma = subs->sync_dma + i * 4;
-+#endif
- u->urb->transfer_buffer_length = 4;
- u->urb->pipe = subs->syncpipe;
- u->urb->transfer_flags = URB_ISO_ASAP |
-@@ -2091,8 +2113,13 @@
- if (!buf)
- return -ENOMEM;
- }
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12)
- err = usb_control_msg(dev, pipe, request, requesttype,
- value, index, buf, size, timeout);
-+#else
-+ err = usb_control_msg(dev, pipe, request, requesttype,
-+ value, index, buf, size, timeout * HZ / 1000);
-+#endif
- if (size > 0) {
- memcpy(data, buf, size);
- kfree(buf);
-@@ -2105,6 +2132,7 @@
- * entry point for linux usb interface
- */
-
-+#ifndef OLD_USB
- static int usb_audio_probe(struct usb_interface *intf,
- const struct usb_device_id *id);
- static void usb_audio_disconnect(struct usb_interface *intf);
-@@ -2116,6 +2144,7 @@
- #define usb_audio_suspend NULL
- #define usb_audio_resume NULL
- #endif
-+#endif
-
- static struct usb_device_id usb_audio_ids [] = {
- #include "usbquirks.h"
-@@ -2128,11 +2157,19 @@
- MODULE_DEVICE_TABLE (usb, usb_audio_ids);
-
- static struct usb_driver usb_audio_driver = {
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 70) && LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) /* FIXME: find right number */
-+ .owner = THIS_MODULE,
-+#endif
- .name = "snd-usb-audio",
- .probe = usb_audio_probe,
- .disconnect = usb_audio_disconnect,
-+#ifndef OLD_USB
- .suspend = usb_audio_suspend,
- .resume = usb_audio_resume,
-+#endif
-+#ifdef OLD_USB
-+ .driver_list = LIST_HEAD_INIT(usb_audio_driver.driver_list),
-+#endif
- .id_table = usb_audio_ids,
- };
-
-@@ -2875,7 +2912,11 @@
- (altsd->bInterfaceSubClass != USB_SUBCLASS_AUDIOSTREAMING &&
- altsd->bInterfaceSubClass != USB_SUBCLASS_VENDOR_SPEC) ||
- altsd->bNumEndpoints < 1 ||
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
- le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize) == 0)
-+#else
-+ get_endpoint(alts, 0)->wMaxPacketSize == 0)
-+#endif
- continue;
- /* must be isochronous */
- if ((get_endpoint(alts, 0)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) !=
-@@ -2965,7 +3006,11 @@
- fp && fp->altsetting == 1 && fp->channels == 1 &&
- fp->format == SNDRV_PCM_FORMAT_S16_LE &&
- protocol == UAC_VERSION_1 &&
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
- le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize) ==
-+#else
-+ get_endpoint(alts, 0)->wMaxPacketSize ==
-+#endif
- fp->maxpacksize * 2)
- continue;
-
-@@ -2992,7 +3037,11 @@
- fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;
- fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
- fp->datainterval = parse_datainterval(chip, alts);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
- fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
-+#else
-+ fp->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize;
-+#endif
- /* num_channels is only set for v2 interfaces */
- fp->channels = num_channels;
- if (snd_usb_get_speed(dev) == USB_SPEED_HIGH)
-@@ -3178,8 +3227,11 @@
- case UAC_VERSION_2: {
- struct uac_clock_source_descriptor *cs;
- struct usb_interface_assoc_descriptor *assoc =
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)
- usb_ifnum_to_if(dev, ctrlif)->intf_assoc;
--
-+#else
-+ NULL;
-+#endif
- if (!assoc) {
- snd_printk(KERN_ERR "Audio class v2 interfaces need an interface association\n");
- return -EINVAL;
-@@ -3261,7 +3313,11 @@
- }
- alts = &iface->altsetting[fp->altset_idx];
- fp->datainterval = parse_datainterval(chip, alts);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
- fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
-+#else
-+ fp->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize;
-+#endif
- usb_set_interface(chip->dev, fp->iface, 0);
- init_usb_pitch(chip->dev, fp->iface, alts, fp);
- init_usb_sample_rate(chip->dev, fp->iface, alts, fp, fp->rate_max);
-@@ -3355,7 +3411,11 @@
- fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;
- fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
- fp->datainterval = 0;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
- fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
-+#else
-+ fp->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize;
-+#endif
-
- switch (fp->maxpacksize) {
- case 0x120:
-@@ -3448,8 +3508,13 @@
- struct usb_host_config *config = dev->actconfig;
- int err;
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
- if (le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_OLD ||
- le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_NEW) {
-+#else
-+ if (get_cfg_desc(config)->wTotalLength == EXTIGY_FIRMWARE_SIZE_OLD ||
-+ get_cfg_desc(config)->wTotalLength == EXTIGY_FIRMWARE_SIZE_NEW) {
-+#endif
- snd_printdd("sending Extigy boot sequence...\n");
- /* Send message to force it to reconnect with full interface. */
- err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev,0),
-@@ -3461,8 +3526,13 @@
- if (err < 0) snd_printdd("error usb_get_descriptor: %d\n", err);
- err = usb_reset_configuration(dev);
- if (err < 0) snd_printdd("error usb_reset_configuration: %d\n", err);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
- snd_printdd("extigy_boot: new boot length = %d\n",
- le16_to_cpu(get_cfg_desc(config)->wTotalLength));
-+#else
-+ snd_printdd("extigy_boot: new boot length = %d\n",
-+ get_cfg_desc(config)->wTotalLength);
-+#endif
- return -ENODEV; /* quit this anyway */
- }
- return 0;
-@@ -3470,6 +3540,8 @@
-
- static int snd_usb_audigy2nx_boot_quirk(struct usb_device *dev)
- {
-+/* The pre-2.6.13 EHCI driver blows up when doing high speed iso transfers */
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
- u8 buf = 1;
-
- snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 0x2a,
-@@ -3481,6 +3553,7 @@
- 1, 2000, NULL, 0, 1000);
- return -ENODEV;
- }
-+#endif
- return 0;
- }
-
-@@ -3734,8 +3807,13 @@
- chip->index = idx;
- chip->dev = dev;
- chip->card = card;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
- chip->usb_id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
- le16_to_cpu(dev->descriptor.idProduct));
-+#else
-+ chip->usb_id = USB_ID(dev->descriptor.idVendor,
-+ dev->descriptor.idProduct);
-+#endif
- INIT_LIST_HEAD(&chip->pcm_list);
- INIT_LIST_HEAD(&chip->midi_list);
- INIT_LIST_HEAD(&chip->mixer_list);
-@@ -3822,8 +3900,12 @@
-
- alts = &intf->altsetting[0];
- ifnum = get_iface_desc(alts)->bInterfaceNumber;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
- id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
- le16_to_cpu(dev->descriptor.idProduct));
-+#else
-+ id = USB_ID(dev->descriptor.idVendor, dev->descriptor.idProduct);
-+#endif
- if (quirk && quirk->ifnum >= 0 && ifnum != quirk->ifnum)
- goto __err_val;
-
-@@ -3968,6 +4050,7 @@
- }
- }
-
-+#ifndef OLD_USB
- /*
- * new 2.5 USB kernel API
- */
-@@ -4028,6 +4111,7 @@
- return 0;
- }
- #endif /* CONFIG_PM */
-+#endif /* OLD_USB */
-
- static int __init snd_usb_audio_init(void)
- {
-@@ -4046,3 +4130,5 @@
-
- module_init(snd_usb_audio_init);
- module_exit(snd_usb_audio_cleanup);
-+
-+#include "usbaudio.inc1"