]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/usb/serial/visor.c
Merge branch 'for-linus' of git://neil.brown.name/md
[mv-sheeva.git] / drivers / usb / serial / visor.c
index eb76aaef42685ad36ade0fc4e25282e0e361d18d..1c11959a7d588f8b25e03013b83a4c3008b452be 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/uaccess.h>
 #include <linux/usb.h>
 #include <linux/usb/serial.h>
+#include <linux/usb/cdc.h>
 #include "visor.h"
 
 /*
@@ -479,6 +480,17 @@ static int visor_probe(struct usb_serial *serial,
 
        dbg("%s", __func__);
 
+       /*
+        * some Samsung Android phones in modem mode have the same ID
+        * as SPH-I500, but they are ACM devices, so dont bind to them
+        */
+       if (id->idVendor == SAMSUNG_VENDOR_ID &&
+               id->idProduct == SAMSUNG_SPH_I500_ID &&
+               serial->dev->descriptor.bDeviceClass == USB_CLASS_COMM &&
+               serial->dev->descriptor.bDeviceSubClass ==
+                       USB_CDC_SUBCLASS_ACM)
+               return -ENODEV;
+
        if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
                dev_err(&serial->dev->dev, "active config #%d != 1 ??\n",
                        serial->dev->actconfig->desc.bConfigurationValue);
@@ -606,6 +618,10 @@ static int treo_attach(struct usb_serial *serial)
 
 static int clie_5_attach(struct usb_serial *serial)
 {
+       struct usb_serial_port *port;
+       unsigned int pipe;
+       int j;
+
        dbg("%s", __func__);
 
        /* TH55 registers 2 ports.
@@ -621,9 +637,14 @@ static int clie_5_attach(struct usb_serial *serial)
                return -1;
 
        /* port 0 now uses the modified endpoint Address */
-       serial->port[0]->bulk_out_endpointAddress =
+       port = serial->port[0];
+       port->bulk_out_endpointAddress =
                                serial->port[1]->bulk_out_endpointAddress;
 
+       pipe = usb_sndbulkpipe(serial->dev, port->bulk_out_endpointAddress);
+       for (j = 0; j < ARRAY_SIZE(port->write_urbs); ++j)
+               port->write_urbs[j]->pipe = pipe;
+
        return 0;
 }