--- ../../alsa-kernel/usb/usx2y/usx2yhwdeppcm.c	2005-01-05 15:19:13.000000000 +0100
+++ usx2yhwdeppcm.c	2005-01-30 18:15:43.000000000 +0100
@@ -1,3 +1,14 @@
+#include <linux/config.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5)
+#define SND_NEED_USB_SET_INTERFACE
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#define SND_NEED_USB_WRAPPER
+#endif
+#define __NO_VERSION__
+#endif
+
 /*
  *   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
@@ -147,7 +158,11 @@
 {
 	int pack;
 	for (pack = 0; pack < nr_of_packs(); ++pack) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 20)
 		struct usb_iso_packet_descriptor *desc = urb->iso_frame_desc + pack;
+#else
+		iso_packet_descriptor_t *desc = urb->iso_frame_desc + pack;
+#endif
 		if (NULL != subs) {
 			snd_usX2Y_hwdep_pcm_shm_t *shm = subs->usX2Y->hwdep_pcm_shm;
 			int head = shm->captured_iso_head + 1;
@@ -226,7 +241,11 @@
 }
 
 
+#ifndef OLD_USB
 static void i_usX2Y_usbpcm_urb_complete(struct urb *urb, struct pt_regs *regs)
+#else
+static void i_usX2Y_usbpcm_urb_complete(struct urb *urb)
+#endif
 {
 	snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t*)urb->context;
 	usX2Ydev_t *usX2Y = subs->usX2Y;
@@ -291,7 +310,11 @@
 	usX2Y->prepare_subs = NULL;
 }
 
+#ifndef OLD_USB
 static void i_usX2Y_usbpcm_subs_startup(struct urb *urb, struct pt_regs *regs)
+#else
+static void i_usX2Y_usbpcm_subs_startup(struct urb *urb)
+#endif
 {
 	snd_usX2Y_substream_t *subs = (snd_usX2Y_substream_t*)urb->context;
 	usX2Ydev_t *usX2Y = subs->usX2Y;
@@ -308,7 +331,11 @@
 		wake_up(&usX2Y->prepare_wait_queue);
 	}
 
+#ifndef OLD_USB
 	i_usX2Y_usbpcm_urb_complete(urb, regs);
+#else
+	i_usX2Y_usbpcm_urb_complete(urb);
+#endif
 }
 
 /*
@@ -682,22 +709,39 @@
 }
 
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
 static struct page * snd_usX2Y_hwdep_pcm_vm_nopage(struct vm_area_struct *area, unsigned long address, int *type)
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0)
+static struct page * snd_usX2Y_hwdep_pcm_vm_nopage(struct vm_area_struct *area, unsigned long address, int no_share)
+#else
+static unsigned long snd_usX2Y_hwdep_pcm_vm_nopage(struct vm_area_struct *area, unsigned long address, int no_share)
+#endif
 {
 	unsigned long offset;
 	struct page *page;
 	void *vaddr;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 25)
 	offset = area->vm_pgoff << PAGE_SHIFT;
+#else
+	offset = area->vm_offset;
+#endif
 	offset += address - area->vm_start;
 	snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM);
 	vaddr = (char*)((usX2Ydev_t*)area->vm_private_data)->hwdep_pcm_shm + offset;
 	page = virt_to_page(vaddr);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
 	if (type)
 		*type = VM_FAULT_MINOR;
+#endif
 
+#ifndef LINUX_2_2
 	return page;
+#else
+#undef page_address
+	return page_address(page);
+#endif
 }
 
 
@@ -726,9 +770,15 @@
 		return -ENODEV;
 	}
 	area->vm_ops = &snd_usX2Y_hwdep_pcm_vm_ops;
+#ifdef VM_RESERVED
 	area->vm_flags |= VM_RESERVED;
 	snd_printd("vm_flags=0x%lX\n", area->vm_flags);
+#endif
+#ifndef LINUX_2_2
 	area->vm_private_data = hw->private_data;
+#else
+	area->vm_private_data = (long)hw->private_data;
+#endif
 	return 0;
 }
 
