Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / usb / misc / emi26.c
index cd37e01..1fd9cb8 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/usb.h>
+#include <linux/delay.h>
 
 #define MAX_INTEL_HEX_RECORD_LENGTH 16
 typedef struct _INTEL_HEX_RECORD
@@ -30,6 +31,7 @@ typedef struct _INTEL_HEX_RECORD
 
 #define EMI26_VENDOR_ID                0x086a  /* Emagic Soft-und Hardware GmBH */
 #define EMI26_PRODUCT_ID               0x0100  /* EMI 2|6 without firmware */
+#define EMI26B_PRODUCT_ID              0x0102  /* EMI 2|6 without firmware */
 
 #define ANCHOR_LOAD_INTERNAL   0xA0    /* Vendor specific request code for Anchor Upload/Download (This one is implemented in the core) */
 #define ANCHOR_LOAD_EXTERNAL   0xA3    /* This command is not implemented in the core. Requires firmware */
@@ -113,6 +115,7 @@ static int emi26_load_firmware (struct usb_device *dev)
 
        /* De-assert reset (let the CPU run) */
        err = emi26_set_reset(dev,0);
+       msleep(250);    /* let device settle */
 
        /* 2. We upload the FPGA firmware into the EMI
         * Note: collect up to 1023 (yes!) bytes and send them with
@@ -149,6 +152,7 @@ static int emi26_load_firmware (struct usb_device *dev)
                        goto wraperr;
                }
        }
+       msleep(250);    /* let device settle */
 
        /* De-assert reset (let the CPU run) */
        err = emi26_set_reset(dev,0);
@@ -191,6 +195,7 @@ static int emi26_load_firmware (struct usb_device *dev)
                err("%s - error loading firmware: error = %d", __FUNCTION__, err);
                goto wraperr;
        }
+       msleep(250);    /* let device settle */
 
        /* return 1 to fail the driver inialization
         * and give real driver change to load */
@@ -203,6 +208,7 @@ wraperr:
 
 static struct usb_device_id id_table [] = {
        { USB_DEVICE(EMI26_VENDOR_ID, EMI26_PRODUCT_ID) },
+       { USB_DEVICE(EMI26_VENDOR_ID, EMI26B_PRODUCT_ID) },
        { }                                             /* Terminating entry */
 };
 
@@ -213,11 +219,9 @@ static int emi26_probe(struct usb_interface *intf, const struct usb_device_id *i
        struct usb_device *dev = interface_to_usbdev(intf);
 
        info("%s start", __FUNCTION__); 
-       
-       if((dev->descriptor.idVendor == EMI26_VENDOR_ID) && (dev->descriptor.idProduct == EMI26_PRODUCT_ID)) {
-               emi26_load_firmware(dev);
-       }
-       
+
+       emi26_load_firmware(dev);
+
        /* do not return the driver context, let real audio driver do that */
        return -EIO;
 }
@@ -227,7 +231,6 @@ static void emi26_disconnect(struct usb_interface *intf)
 }
 
 static struct usb_driver emi26_driver = {
-       .owner          = THIS_MODULE,
        .name           = "emi26 - firmware loader",
        .probe          = emi26_probe,
        .disconnect     = emi26_disconnect,