aboutsummaryrefslogtreecommitdiffstats
diff options
-rw-r--r--series10
-rw-r--r--usb/usb-ftdi_sio-new-vid-pids-for-various-papouch-devices.patch110
-rw-r--r--usb/usb-ftdi_sio-set-device-latency-timeout-at-port-probe.patch40
-rw-r--r--usb/usb-iowarrior-don-t-trust-report_size-for-buffer-size.patch33
-rw-r--r--usb/usb-opticon-add-opticon-opn2001-write-support.patch65
-rw-r--r--usb/usb-opticon-fix-long-standing-bugs-in-opticon-driver.patch46
-rw-r--r--usb/usb-opticon-whitespace-fixes-in-opticon-driver.patch33
-rw-r--r--usb/usb-otg-ulpi-extend-id-s-table.patch64
-rw-r--r--usb/usb-otg-ulpi-improve-ulpi-phy-detection.patch71
-rw-r--r--usb/usb-visor-fix-initialisation-of-ux50-th55-devices.patch52
10 files changed, 524 insertions, 0 deletions
diff --git a/series b/series
index 08f11055740cea..726042c81e8923 100644
--- a/series
+++ b/series
@@ -222,6 +222,16 @@ usb/usb-gadget-dummy_hcd-fix-error-path.patch
usb/usb-makefile-cleanup.patch
usb/usb-gadget-storage-reuse-definitions-from-scsi.h-header-file.patch
usb/usb-usb3.0-ch9-definitions.patch
+usb/usb-ftdi_sio-new-vid-pids-for-various-papouch-devices.patch
+usb/usb-visor-fix-initialisation-of-ux50-th55-devices.patch
+usb/usb-iowarrior-don-t-trust-report_size-for-buffer-size.patch
+usb/usb-ftdi_sio-set-device-latency-timeout-at-port-probe.patch
+usb/usb-opticon-fix-long-standing-bugs-in-opticon-driver.patch
+usb/usb-opticon-add-opticon-opn2001-write-support.patch
+usb/usb-opticon-whitespace-fixes-in-opticon-driver.patch
+usb/usb-otg-ulpi-improve-ulpi-phy-detection.patch
+usb/usb-otg-ulpi-extend-id-s-table.patch
+
# staging stuff for next is now in the staging-next tree on git.kernel.org
diff --git a/usb/usb-ftdi_sio-new-vid-pids-for-various-papouch-devices.patch b/usb/usb-ftdi_sio-new-vid-pids-for-various-papouch-devices.patch
new file mode 100644
index 00000000000000..b4c056ba1d628b
--- /dev/null
+++ b/usb/usb-ftdi_sio-new-vid-pids-for-various-papouch-devices.patch
@@ -0,0 +1,110 @@
+From danny@danysek.cz Tue Oct 12 10:57:41 2010
+From: Daniel Suchy <danny@danysek.cz>
+Date: Tue, 12 Oct 2010 15:44:24 +0200
+Subject: USB: ftdi_sio: new VID/PIDs for various Papouch devices
+To: Greg KH <gregkh@suse.de>
+Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
+Message-ID: <4CB46638.7060203@danysek.cz>
+
+
+This patch for FTDI USB serial driver ads new VID/PIDs used on various
+devices manufactured by Papouch (http://www.papouch.com). These devices
+have their own VID/PID, although they're using standard FTDI chip. In
+ftdi_sio.c, I also made small cleanup to have declarations for all
+Papouch devices together.
+
+Signed-off-by: Daniel Suchy <danny@danysek.cz>
+Cc: stable <stable@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/ftdi_sio.c | 30 +++++++++++++++++++++++++++++-
+ drivers/usb/serial/ftdi_sio_ids.h | 27 ++++++++++++++++++++++++++-
+ 2 files changed, 55 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/serial/ftdi_sio.c
++++ b/drivers/usb/serial/ftdi_sio.c
+@@ -675,7 +675,6 @@ static struct usb_device_id id_table_com
+ { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) },
+ { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) },
+- { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) },
+@@ -716,8 +715,37 @@ static struct usb_device_id id_table_com
+ .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+ { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
+ { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
++
++ /* Papouch devices based on FTDI chip */
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_2_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_2_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_2_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485S_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485C_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_LEC_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB232_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_IRAMP_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK5_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO8x8_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x2_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO10x1_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO30x3_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO60x3_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x16_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO3x32_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK6_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_UPSUSB_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_MU_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SIMUKEY_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AD4USB_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMUX_PID) },
++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMSR_PID) },
++
+ { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) },
+ { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) },
+--- a/drivers/usb/serial/ftdi_sio_ids.h
++++ b/drivers/usb/serial/ftdi_sio_ids.h
+@@ -1023,9 +1023,34 @@
+ */
+
+ #define PAPOUCH_VID 0x5050 /* Vendor ID */
++#define PAPOUCH_SB485_PID 0x0100 /* Papouch SB485 USB-485/422 Converter */
++#define PAPOUCH_AP485_PID 0x0101 /* AP485 USB-RS485 Converter */
++#define PAPOUCH_SB422_PID 0x0102 /* Papouch SB422 USB-RS422 Converter */
++#define PAPOUCH_SB485_2_PID 0x0103 /* Papouch SB485 USB-485/422 Converter */
++#define PAPOUCH_AP485_2_PID 0x0104 /* AP485 USB-RS485 Converter */
++#define PAPOUCH_SB422_2_PID 0x0105 /* Papouch SB422 USB-RS422 Converter */
++#define PAPOUCH_SB485S_PID 0x0106 /* Papouch SB485S USB-485/422 Converter */
++#define PAPOUCH_SB485C_PID 0x0107 /* Papouch SB485C USB-485/422 Converter */
++#define PAPOUCH_LEC_PID 0x0300 /* LEC USB Converter */
++#define PAPOUCH_SB232_PID 0x0301 /* Papouch SB232 USB-RS232 Converter */
+ #define PAPOUCH_TMU_PID 0x0400 /* TMU USB Thermometer */
+-#define PAPOUCH_QUIDO4x4_PID 0x0900 /* Quido 4/4 Module */
++#define PAPOUCH_IRAMP_PID 0x0500 /* Papouch IRAmp Duplex */
++#define PAPOUCH_DRAK5_PID 0x0700 /* Papouch DRAK5 */
++#define PAPOUCH_QUIDO8x8_PID 0x0800 /* Papouch Quido 8/8 Module */
++#define PAPOUCH_QUIDO4x4_PID 0x0900 /* Papouch Quido 4/4 Module */
++#define PAPOUCH_QUIDO2x2_PID 0x0a00 /* Papouch Quido 2/2 Module */
++#define PAPOUCH_QUIDO10x1_PID 0x0b00 /* Papouch Quido 10/1 Module */
++#define PAPOUCH_QUIDO30x3_PID 0x0c00 /* Papouch Quido 30/3 Module */
++#define PAPOUCH_QUIDO60x3_PID 0x0d00 /* Papouch Quido 60(100)/3 Module */
++#define PAPOUCH_QUIDO2x16_PID 0x0e00 /* Papouch Quido 2/16 Module */
++#define PAPOUCH_QUIDO3x32_PID 0x0f00 /* Papouch Quido 3/32 Module */
++#define PAPOUCH_DRAK6_PID 0x1000 /* Papouch DRAK6 */
++#define PAPOUCH_UPSUSB_PID 0x8000 /* Papouch UPS-USB adapter */
++#define PAPOUCH_MU_PID 0x8001 /* MU controller */
++#define PAPOUCH_SIMUKEY_PID 0x8002 /* Papouch SimuKey */
+ #define PAPOUCH_AD4USB_PID 0x8003 /* AD4USB Measurement Module */
++#define PAPOUCH_GMUX_PID 0x8004 /* Papouch GOLIATH MUX */
++#define PAPOUCH_GMSR_PID 0x8005 /* Papouch GOLIATH MSR */
+
+ /*
+ * Marvell SheevaPlug
diff --git a/usb/usb-ftdi_sio-set-device-latency-timeout-at-port-probe.patch b/usb/usb-ftdi_sio-set-device-latency-timeout-at-port-probe.patch
new file mode 100644
index 00000000000000..6a45b32ba1c4c5
--- /dev/null
+++ b/usb/usb-ftdi_sio-set-device-latency-timeout-at-port-probe.patch
@@ -0,0 +1,40 @@
+From jhovold@gmail.com Tue Oct 12 11:00:24 2010
+From: Johan Hovold <jhovold@gmail.com>
+Date: Mon, 11 Oct 2010 20:23:36 +0200
+Subject: USB: ftdi_sio: set device latency timeout at port probe
+To: Greg KH <greg@kroah.com>
+Cc: linux-usb@vger.kernel.org, Johan Hovold <jhovold@gmail.com>
+Message-ID: <1286821416-13110-1-git-send-email-jhovold@gmail.com>
+
+
+No need to set latency timeout at every open.
+
+This also fixes an issue with the read latency being as high as 250ms
+(instead of 1ms) for the first read after port probe.
+
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/ftdi_sio.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/usb/serial/ftdi_sio.c
++++ b/drivers/usb/serial/ftdi_sio.c
+@@ -1589,6 +1589,7 @@ static int ftdi_sio_port_probe(struct us
+ ftdi_set_max_packet_size(port);
+ if (read_latency_timer(port) < 0)
+ priv->latency = 16;
++ write_latency_timer(port);
+ create_sysfs_attrs(port);
+ return 0;
+ }
+@@ -1717,8 +1718,6 @@ static int ftdi_open(struct tty_struct *
+
+ dbg("%s", __func__);
+
+- write_latency_timer(port);
+-
+ /* No error checking for this (will get errors later anyway) */
+ /* See ftdi_sio.h for description of what is reset */
+ usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
diff --git a/usb/usb-iowarrior-don-t-trust-report_size-for-buffer-size.patch b/usb/usb-iowarrior-don-t-trust-report_size-for-buffer-size.patch
new file mode 100644
index 00000000000000..95b480a58baae5
--- /dev/null
+++ b/usb/usb-iowarrior-don-t-trust-report_size-for-buffer-size.patch
@@ -0,0 +1,33 @@
+From kees.cook@canonical.com Tue Oct 12 10:59:47 2010
+From: Kees Cook <kees.cook@canonical.com>
+Date: Mon, 11 Oct 2010 11:28:16 -0700
+Subject: usb: iowarrior: don't trust report_size for buffer size
+To: linux-kernel@vger.kernel.org
+Cc: Greg Kroah-Hartman <gregkh@suse.de>, Oliver Neukum <oliver@neukum.org>, Joe Perches <joe@perches.com>, N�meth M�rton <nm127@freemail.hu>, linux-usb@vger.kernel.org
+Message-ID: <20101011182816.GA15451@outflux.net>
+Content-Disposition: inline
+
+
+If the iowarrior devices in this case statement support more than 8 bytes
+per report, it is possible to write past the end of a kernel heap allocation.
+This will probably never be possible, but change the allocation to be more
+defensive anyway.
+
+Signed-off-by: Kees Cook <kees.cook@canonical.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/misc/iowarrior.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/usb/misc/iowarrior.c
++++ b/drivers/usb/misc/iowarrior.c
+@@ -374,7 +374,7 @@ static ssize_t iowarrior_write(struct fi
+ case USB_DEVICE_ID_CODEMERCS_IOWPV2:
+ case USB_DEVICE_ID_CODEMERCS_IOW40:
+ /* IOW24 and IOW40 use a synchronous call */
+- buf = kmalloc(8, GFP_KERNEL); /* 8 bytes are enough for both products */
++ buf = kmalloc(count, GFP_KERNEL);
+ if (!buf) {
+ retval = -ENOMEM;
+ goto exit;
diff --git a/usb/usb-opticon-add-opticon-opn2001-write-support.patch b/usb/usb-opticon-add-opticon-opn2001-write-support.patch
new file mode 100644
index 00000000000000..0fc40cde7e68ff
--- /dev/null
+++ b/usb/usb-opticon-add-opticon-opn2001-write-support.patch
@@ -0,0 +1,65 @@
+From alon+git@nolaviz.org Tue Oct 12 11:03:09 2010
+From: Alon Ziv <alon+git@nolaviz.org>
+Date: Sun, 10 Oct 2010 08:32:19 +0200
+Subject: USB: opticon: Add Opticon OPN2001 write support
+To: linux-usb@vger.kernel.org
+Cc: linux-kernel@vger.kernel.org, Alon Ziv <alon+git@nolaviz.org>
+Message-ID: <1286692340-18639-3-git-send-email-alon-git@nolaviz.org>
+
+
+OPN2001 expects write operations to arrive as a vendor-specific command
+through the control pipe (instead of using a separate bulk-out pipe).
+
+Signed-off-by: Alon Ziv <alon-git@nolaviz.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/opticon.c | 30 ++++++++++++++++++++++++++----
+ 1 file changed, 26 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/serial/opticon.c
++++ b/drivers/usb/serial/opticon.c
+@@ -187,6 +187,9 @@ static void opticon_write_bulk_callback(
+ /* free up the transfer buffer, as usb_free_urb() does not do this */
+ kfree(urb->transfer_buffer);
+
++ /* setup packet may be set if we're using it for writing */
++ kfree(urb->setup_packet);
++
+ if (status)
+ dbg("%s - nonzero write bulk status received: %d",
+ __func__, status);
+@@ -237,10 +240,29 @@ static int opticon_write(struct tty_stru
+
+ usb_serial_debug_data(debug, &port->dev, __func__, count, buffer);
+
+- usb_fill_bulk_urb(urb, serial->dev,
+- usb_sndbulkpipe(serial->dev,
+- port->bulk_out_endpointAddress),
+- buffer, count, opticon_write_bulk_callback, priv);
++ if (port->bulk_out_endpointAddress) {
++ usb_fill_bulk_urb(urb, serial->dev,
++ usb_sndbulkpipe(serial->dev,
++ port->bulk_out_endpointAddress),
++ buffer, count, opticon_write_bulk_callback, priv);
++ } else {
++ struct usb_ctrlrequest *dr;
++
++ dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO);
++ if (!dr)
++ return -ENOMEM;
++
++ dr->bRequestType = USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT;
++ dr->bRequest = 0x01;
++ dr->wValue = 0;
++ dr->wIndex = 0;
++ dr->wLength = cpu_to_le16(count);
++
++ usb_fill_control_urb(urb, serial->dev,
++ usb_sndctrlpipe(serial->dev, 0),
++ (unsigned char *)dr, buffer, count,
++ opticon_write_bulk_callback, priv);
++ }
+
+ /* send it down the pipe */
+ status = usb_submit_urb(urb, GFP_ATOMIC);
diff --git a/usb/usb-opticon-fix-long-standing-bugs-in-opticon-driver.patch b/usb/usb-opticon-fix-long-standing-bugs-in-opticon-driver.patch
new file mode 100644
index 00000000000000..2bf0d82c783a48
--- /dev/null
+++ b/usb/usb-opticon-fix-long-standing-bugs-in-opticon-driver.patch
@@ -0,0 +1,46 @@
+From alon+git@nolaviz.org Tue Oct 12 11:02:32 2010
+From: Alon Ziv <alon+git@nolaviz.org>
+Date: Sun, 10 Oct 2010 08:32:18 +0200
+Subject: USB: opticon: Fix long-standing bugs in opticon driver
+To: linux-usb@vger.kernel.org
+Cc: linux-kernel@vger.kernel.org, Alon Ziv <alon+git@nolaviz.org>
+Message-ID: <1286692340-18639-2-git-send-email-alon-git@nolaviz.org>
+
+
+The bulk-read callback had two bugs:
+a) The bulk-in packet's leading two zeros were returned (and the two last
+ bytes truncated)
+b) The wrong URB was transmitted for the second (and later) read requests,
+ causing further reads to return the entire packet (including leading
+ zeros)
+
+Signed-off-by: Alon Ziv <alon-git@nolaviz.org>
+Cc: stable <stable@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/opticon.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/serial/opticon.c
++++ b/drivers/usb/serial/opticon.c
+@@ -96,8 +96,8 @@ static void opticon_bulk_callback(struct
+ /* real data, send it to the tty layer */
+ tty = tty_port_tty_get(&port->port);
+ if (tty) {
+- tty_insert_flip_string(tty, data,
+- data_length);
++ tty_insert_flip_string(tty, data + 2,
++ data_length);
+ tty_flip_buffer_push(tty);
+ tty_kref_put(tty);
+ }
+@@ -130,7 +130,7 @@ exit:
+ priv->bulk_address),
+ priv->bulk_in_buffer, priv->buffer_size,
+ opticon_bulk_callback, priv);
+- result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
++ result = usb_submit_urb(priv->bulk_read_urb, GFP_ATOMIC);
+ if (result)
+ dev_err(&port->dev,
+ "%s - failed resubmitting read urb, error %d\n",
diff --git a/usb/usb-opticon-whitespace-fixes-in-opticon-driver.patch b/usb/usb-opticon-whitespace-fixes-in-opticon-driver.patch
new file mode 100644
index 00000000000000..2724812fcf5acb
--- /dev/null
+++ b/usb/usb-opticon-whitespace-fixes-in-opticon-driver.patch
@@ -0,0 +1,33 @@
+From alon+git@nolaviz.org Tue Oct 12 11:03:30 2010
+From: Alon Ziv <alon+git@nolaviz.org>
+Date: Sun, 10 Oct 2010 08:32:20 +0200
+Subject: USB: opticon: Whitespace fixes in opticon driver
+To: linux-usb@vger.kernel.org
+Cc: linux-kernel@vger.kernel.org, Alon Ziv <alon+git@nolaviz.org>
+Message-ID: <1286692340-18639-4-git-send-email-alon-git@nolaviz.org>
+
+
+Signed-off-by: Alon Ziv <alon-git@nolaviz.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/opticon.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/serial/opticon.c
++++ b/drivers/usb/serial/opticon.c
+@@ -108,10 +108,10 @@ static void opticon_bulk_callback(struct
+ else
+ priv->rts = true;
+ } else {
+- dev_dbg(&priv->udev->dev,
+- "Unknown data packet received from the device:"
+- " %2x %2x\n",
+- data[0], data[1]);
++ dev_dbg(&priv->udev->dev,
++ "Unknown data packet received from the device:"
++ " %2x %2x\n",
++ data[0], data[1]);
+ }
+ }
+ } else {
diff --git a/usb/usb-otg-ulpi-extend-id-s-table.patch b/usb/usb-otg-ulpi-extend-id-s-table.patch
new file mode 100644
index 00000000000000..75893d6a8884cd
--- /dev/null
+++ b/usb/usb-otg-ulpi-extend-id-s-table.patch
@@ -0,0 +1,64 @@
+From grinberg@compulab.co.il Tue Oct 12 11:04:23 2010
+From: Igor Grinberg <grinberg@compulab.co.il>
+Date: Sun, 10 Oct 2010 17:59:19 +0200
+Subject: USB: otg/ulpi: extend id's table.
+To: Greg Kroah-Hartman <gregkh@suse.de>
+Cc: Daniel Mack <daniel@caiaq.de>, linux-usb@vger.kernel.org, Igor Grinberg <grinberg@compulab.co.il>
+Message-ID: <1286726359-30349-3-git-send-email-grinberg@compulab.co.il>
+
+
+Extend id's table to have ulpi phy names in it.
+Report if the known phy is found.
+
+Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/otg/ulpi.c | 25 ++++++++++++++++++++-----
+ 1 file changed, 20 insertions(+), 5 deletions(-)
+
+--- a/drivers/usb/otg/ulpi.c
++++ b/drivers/usb/otg/ulpi.c
+@@ -29,12 +29,23 @@
+ #include <linux/usb/otg.h>
+ #include <linux/usb/ulpi.h>
+
++
++struct ulpi_info {
++ unsigned int id;
++ char *name;
++};
++
+ #define ULPI_ID(vendor, product) (((vendor) << 16) | (product))
++#define ULPI_INFO(_id, _name) \
++ { \
++ .id = (_id), \
++ .name = (_name), \
++ }
+
+ /* ULPI hardcoded IDs, used for probing */
+-static unsigned int ulpi_ids[] = {
+- ULPI_ID(0x04cc, 0x1504), /* NXP ISP1504 */
+- ULPI_ID(0x0424, 0x0006), /* SMSC USB3319 */
++static struct ulpi_info ulpi_ids[] = {
++ ULPI_INFO(ULPI_ID(0x04cc, 0x1504), "NXP ISP1504"),
++ ULPI_INFO(ULPI_ID(0x0424, 0x0006), "SMSC USB3319"),
+ };
+
+ static int ulpi_set_otg_flags(struct otg_transceiver *otg)
+@@ -179,9 +190,13 @@ static int ulpi_init(struct otg_transcei
+
+ pr_info("ULPI transceiver vendor/product ID 0x%04x/0x%04x\n", vid, pid);
+
+- for (i = 0; i < ARRAY_SIZE(ulpi_ids); i++)
+- if (ulpi_ids[i] == ULPI_ID(vid, pid))
++ for (i = 0; i < ARRAY_SIZE(ulpi_ids); i++) {
++ if (ulpi_ids[i].id == ULPI_ID(vid, pid)) {
++ pr_info("Found %s ULPI transceiver.\n",
++ ulpi_ids[i].name);
+ break;
++ }
++ }
+
+ ret = ulpi_check_integrity(otg);
+ if (ret)
diff --git a/usb/usb-otg-ulpi-improve-ulpi-phy-detection.patch b/usb/usb-otg-ulpi-improve-ulpi-phy-detection.patch
new file mode 100644
index 00000000000000..3e2beb3864b21f
--- /dev/null
+++ b/usb/usb-otg-ulpi-improve-ulpi-phy-detection.patch
@@ -0,0 +1,71 @@
+From grinberg@compulab.co.il Tue Oct 12 11:04:03 2010
+From: Igor Grinberg <grinberg@compulab.co.il>
+Date: Sun, 10 Oct 2010 17:59:18 +0200
+Subject: USB: otg/ulpi: improve ulpi phy detection.
+To: Greg Kroah-Hartman <gregkh@suse.de>
+Cc: Daniel Mack <daniel@caiaq.de>, linux-usb@vger.kernel.org, Igor Grinberg <grinberg@compulab.co.il>
+Message-ID: <1286726359-30349-2-git-send-email-grinberg@compulab.co.il>
+
+
+Improve ulpi phy detection by utilizing the "scratch" register.
+Allow unknown ulpi phy work without the need to hard-code the id.
+
+Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/otg/ulpi.c | 35 ++++++++++++++++++++++++++++++++---
+ 1 file changed, 32 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/otg/ulpi.c
++++ b/drivers/usb/otg/ulpi.c
+@@ -137,6 +137,32 @@ static int ulpi_set_flags(struct otg_tra
+ return ulpi_set_fc_flags(otg);
+ }
+
++static int ulpi_check_integrity(struct otg_transceiver *otg)
++{
++ int ret, i;
++ unsigned int val = 0x55;
++
++ for (i = 0; i < 2; i++) {
++ ret = otg_io_write(otg, val, ULPI_SCRATCH);
++ if (ret < 0)
++ return ret;
++
++ ret = otg_io_read(otg, ULPI_SCRATCH);
++ if (ret < 0)
++ return ret;
++
++ if (ret != val) {
++ pr_err("ULPI integrity check: failed!");
++ return -ENODEV;
++ }
++ val = val << 1;
++ }
++
++ pr_info("ULPI integrity check: passed.\n");
++
++ return 0;
++}
++
+ static int ulpi_init(struct otg_transceiver *otg)
+ {
+ int i, vid, pid, ret;
+@@ -155,10 +181,13 @@ static int ulpi_init(struct otg_transcei
+
+ for (i = 0; i < ARRAY_SIZE(ulpi_ids); i++)
+ if (ulpi_ids[i] == ULPI_ID(vid, pid))
+- return ulpi_set_flags(otg);
++ break;
++
++ ret = ulpi_check_integrity(otg);
++ if (ret)
++ return ret;
+
+- pr_err("ULPI ID does not match any known transceiver.\n");
+- return -ENODEV;
++ return ulpi_set_flags(otg);
+ }
+
+ static int ulpi_set_host(struct otg_transceiver *otg, struct usb_bus *host)
diff --git a/usb/usb-visor-fix-initialisation-of-ux50-th55-devices.patch b/usb/usb-visor-fix-initialisation-of-ux50-th55-devices.patch
new file mode 100644
index 00000000000000..d4b8a5d3a31ed2
--- /dev/null
+++ b/usb/usb-visor-fix-initialisation-of-ux50-th55-devices.patch
@@ -0,0 +1,52 @@
+From jhovold@gmail.com Tue Oct 12 10:59:01 2010
+From: Johan Hovold <jhovold@gmail.com>
+Date: Tue, 12 Oct 2010 01:07:05 +0200
+Subject: USB: visor: fix initialisation of UX50/TH55 devices
+To: Greg KH <greg@kroah.com>, Robert Gadsdon <rgadsdon@bayarea.net>
+Cc: Johan Hovold <jhovold@gmail.com>
+Message-ID: <1286838425-5160-1-git-send-email-jhovold@gmail.com>
+
+Fix regression introduced by commit
+214916f2ec6701e1c9972f26c60b3dc37d3153c6 (USB: visor: reimplement using
+generic framework) which broke initialisation of UX50/TH55 devices that
+used re-mapped bulk-out endpoint addresses.
+
+Reported-by: Robert Gadsdon <rgadsdon@bayarea.net>
+Tested-by: Robert Gadsdon <rgadsdon@bayarea.net>
+Cc: stable <stable@kernel.org>
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/visor.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/serial/visor.c
++++ b/drivers/usb/serial/visor.c
+@@ -606,6 +606,10 @@ static int treo_attach(struct usb_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 +625,14 @@ static int clie_5_attach(struct usb_seri
+ 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;
+ }
+