aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2010-02-26 16:48:46 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2010-02-26 16:48:46 -0800
commit6d6bd90e42824035a3346dd1835026e55cd5201b (patch)
treee60264ad74db5e67feeff69e758d32f6c935158c /usb
parent639129d7091fea3473ace7d14eaf10aec218d89b (diff)
downloadpatches-6d6bd90e42824035a3346dd1835026e55cd5201b.tar.gz
more patch fun.
Diffstat (limited to 'usb')
-rw-r--r--usb/usb-backlight-appledisplay-fix-incomplete-registration-failure-handling.patch38
-rw-r--r--usb/usb-ftdi_sio-remove-obsolete-check-in-unthrottle.patch33
-rw-r--r--usb/usb-ftdi_sio-remove-unused-tx_bytes-counter.patch47
-rw-r--r--usb/usb-pl2303-initial-tiocgserial-support.patch51
-rw-r--r--usb/usb-pl2303-remove-unnecessary-reset-of-usb_device-in-urbs.patch67
-rw-r--r--usb/usb-qcaux-driver-for-auxiliary-serial-ports-on-qualcomm-devices.patch156
6 files changed, 392 insertions, 0 deletions
diff --git a/usb/usb-backlight-appledisplay-fix-incomplete-registration-failure-handling.patch b/usb/usb-backlight-appledisplay-fix-incomplete-registration-failure-handling.patch
new file mode 100644
index 00000000000000..b56acc441adc41
--- /dev/null
+++ b/usb/usb-backlight-appledisplay-fix-incomplete-registration-failure-handling.patch
@@ -0,0 +1,38 @@
+From bonbons@linux-vserver.org Fri Feb 26 16:41:19 2010
+From: Bruno Pr�mont <bonbons@linux-vserver.org>
+Date: Fri, 26 Feb 2010 13:02:04 +0100
+Subject: USB: backlight, appledisplay: fix incomplete registration failure handling
+To: Richard Purdie <rpurdie@linux.intel.com>, Greg Kroah-Hartman <gregkh@suse.de>
+Message-ID: <20100226130204.5727ba6b@neptune.home>
+
+
+On error while registering backlight, return it to caller instead of
+returning 0.
+Mark struct backlight_ops as const.
+
+Signed-off-by: Bruno Pr�mont <bonbons@linux-vserver.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/misc/appledisplay.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/misc/appledisplay.c
++++ b/drivers/usb/misc/appledisplay.c
+@@ -179,7 +179,7 @@ static int appledisplay_bl_get_brightnes
+ return pdata->msgdata[1];
+ }
+
+-static struct backlight_ops appledisplay_bl_data = {
++static const struct backlight_ops appledisplay_bl_data = {
+ .get_brightness = appledisplay_bl_get_brightness,
+ .update_status = appledisplay_bl_update_status,
+ };
+@@ -283,6 +283,7 @@ static int appledisplay_probe(struct usb
+ &appledisplay_bl_data);
+ if (IS_ERR(pdata->bd)) {
+ dev_err(&iface->dev, "Backlight registration failed\n");
++ retval = PTR_ERR(pdata->bd);
+ goto error;
+ }
+
diff --git a/usb/usb-ftdi_sio-remove-obsolete-check-in-unthrottle.patch b/usb/usb-ftdi_sio-remove-obsolete-check-in-unthrottle.patch
new file mode 100644
index 00000000000000..9b476abe491b24
--- /dev/null
+++ b/usb/usb-ftdi_sio-remove-obsolete-check-in-unthrottle.patch
@@ -0,0 +1,33 @@
+From jhovold@gmail.com Fri Feb 26 16:31:26 2010
+From: Johan Hovold <jhovold@gmail.com>
+Date: Thu, 25 Feb 2010 20:19:10 +0100
+Subject: USB: ftdi_sio: remove obsolete check in unthrottle
+To: Greg Kroah-Hartman <gregkh@suse.de>
+Cc: linux-usb@vger.kernel.org, Johan Hovold <jhovold@gmail.com>
+Message-ID: <1267125550-7003-1-git-send-email-jhovold@gmail.com>
+
+
+No need to check ASYNCB_INITIALIZED anymore as commit
+e1108a63e10d344284011cccc06328b2cd3e5da3 (usb_serial: Use the shutdown()
+operation) make sure that there is no longer any call to unthrottle
+after device specific close (in which the read urb is killed).
+
+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
+@@ -2492,8 +2492,7 @@ void ftdi_unthrottle(struct tty_struct *
+ port->throttled = port->throttle_req = 0;
+ spin_unlock_irqrestore(&port->lock, flags);
+
+- /* Resubmit urb if throttled and open. */
+- if (was_throttled && test_bit(ASYNCB_INITIALIZED, &port->port.flags))
++ if (was_throttled)
+ ftdi_submit_read_urb(port, GFP_KERNEL);
+ }
+
diff --git a/usb/usb-ftdi_sio-remove-unused-tx_bytes-counter.patch b/usb/usb-ftdi_sio-remove-unused-tx_bytes-counter.patch
new file mode 100644
index 00000000000000..ca6a9f60bf2a3e
--- /dev/null
+++ b/usb/usb-ftdi_sio-remove-unused-tx_bytes-counter.patch
@@ -0,0 +1,47 @@
+From jhovold@gmail.com Fri Feb 26 16:31:16 2010
+From: Johan Hovold <jhovold@gmail.com>
+Date: Thu, 25 Feb 2010 20:18:13 +0100
+Subject: USB: ftdi_sio: remove unused tx_bytes counter
+To: Greg Kroah-Hartman <gregkh@suse.de>
+Cc: linux-usb@vger.kernel.org, Johan Hovold <jhovold@gmail.com>
+Message-ID: <1267125493-6914-1-git-send-email-jhovold@gmail.com>
+
+
+Remove counter that is never exported.
+
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/ftdi_sio.c | 6 ------
+ 1 file changed, 6 deletions(-)
+
+--- a/drivers/usb/serial/ftdi_sio.c
++++ b/drivers/usb/serial/ftdi_sio.c
+@@ -88,7 +88,6 @@ struct ftdi_private {
+
+ unsigned int latency; /* latency setting in use */
+ spinlock_t tx_lock; /* spinlock for transmit state */
+- unsigned long tx_bytes;
+ unsigned long tx_outstanding_bytes;
+ unsigned long tx_outstanding_urbs;
+ unsigned short max_packet_size;
+@@ -1729,10 +1728,6 @@ static int ftdi_open(struct tty_struct *
+
+ dbg("%s", __func__);
+
+- spin_lock_irqsave(&priv->tx_lock, flags);
+- priv->tx_bytes = 0;
+- spin_unlock_irqrestore(&priv->tx_lock, flags);
+-
+ write_latency_timer(port);
+
+ /* No error checking for this (will get errors later anyway) */
+@@ -1917,7 +1912,6 @@ static int ftdi_write(struct tty_struct
+ } else {
+ spin_lock_irqsave(&priv->tx_lock, flags);
+ priv->tx_outstanding_bytes += count;
+- priv->tx_bytes += count;
+ spin_unlock_irqrestore(&priv->tx_lock, flags);
+ }
+
diff --git a/usb/usb-pl2303-initial-tiocgserial-support.patch b/usb/usb-pl2303-initial-tiocgserial-support.patch
new file mode 100644
index 00000000000000..ba039cc815cae1
--- /dev/null
+++ b/usb/usb-pl2303-initial-tiocgserial-support.patch
@@ -0,0 +1,51 @@
+From nuclear@member.fsf.org Fri Feb 26 16:29:09 2010
+From: John Tsiombikas <nuclear@member.fsf.org>
+Date: Thu, 25 Feb 2010 17:09:08 +0200
+Subject: USB: pl2303: initial TIOCGSERIAL support
+To: Greg KH <greg@kroah.com>
+Message-ID: <20100225150908.GB21609@quasar.dnsalias.com>
+
+
+I've got a trivial patch for the pl2303 driver, that's what I needed to
+make the wacom serial tablet driver work properly. It uses the
+TIOCGSERIAL ioctl to determine if it's talking to a serial device or
+not, which I gather is rather common, but the pl2303 driver didn't
+implement that ioctl.
+
+Here's a patch, I'm not sure it's absolutely correct, I mostly looked at
+other similar usbserial drivers to see what I must do, but it works for
+me.
+
+Signed-off-by: John Tsiombikas <nuclear@member.fsf.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/pl2303.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+--- a/drivers/usb/serial/pl2303.c
++++ b/drivers/usb/serial/pl2303.c
+@@ -895,10 +895,23 @@ static int wait_modem_info(struct usb_se
+ static int pl2303_ioctl(struct tty_struct *tty, struct file *file,
+ unsigned int cmd, unsigned long arg)
+ {
++ struct serial_struct ser;
+ struct usb_serial_port *port = tty->driver_data;
+ dbg("%s (%d) cmd = 0x%04x", __func__, port->number, cmd);
+
+ switch (cmd) {
++ case TIOCGSERIAL:
++ memset(&ser, 0, sizeof ser);
++ ser.type = PORT_16654;
++ ser.line = port->serial->minor;
++ ser.port = port->number;
++ ser.baud_base = 460800;
++
++ if (copy_to_user((void __user *)arg, &ser, sizeof ser))
++ return -EFAULT;
++
++ return 0;
++
+ case TIOCMIWAIT:
+ dbg("%s (%d) TIOCMIWAIT", __func__, port->number);
+ return wait_modem_info(port, arg);
diff --git a/usb/usb-pl2303-remove-unnecessary-reset-of-usb_device-in-urbs.patch b/usb/usb-pl2303-remove-unnecessary-reset-of-usb_device-in-urbs.patch
new file mode 100644
index 00000000000000..aea90e16e07617
--- /dev/null
+++ b/usb/usb-pl2303-remove-unnecessary-reset-of-usb_device-in-urbs.patch
@@ -0,0 +1,67 @@
+From jhovold@gmail.com Fri Feb 26 16:31:38 2010
+From: Johan Hovold <jhovold@gmail.com>
+Date: Thu, 25 Feb 2010 20:52:30 +0100
+Subject: USB: pl2303: remove unnecessary reset of usb_device in urbs
+To: Greg Kroah-Hartman <gregkh@suse.de>
+Message-ID: <1267127550-12591-1-git-send-email-jhovold@gmail.com>
+
+
+URBs are initialised at probe and do not change.
+
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/pl2303.c | 6 ------
+ 1 file changed, 6 deletions(-)
+
+--- a/drivers/usb/serial/pl2303.c
++++ b/drivers/usb/serial/pl2303.c
+@@ -451,7 +451,6 @@ static void pl2303_send(struct usb_seria
+ port->write_urb->transfer_buffer);
+
+ port->write_urb->transfer_buffer_length = count;
+- port->write_urb->dev = port->serial->dev;
+ result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
+ if (result) {
+ dev_err(&port->dev, "%s - failed submitting write urb,"
+@@ -769,7 +768,6 @@ static int pl2303_open(struct tty_struct
+ pl2303_set_termios(tty, port, &tmp_termios);
+
+ dbg("%s - submitting read urb", __func__);
+- port->read_urb->dev = serial->dev;
+ result = usb_submit_urb(port->read_urb, GFP_KERNEL);
+ if (result) {
+ dev_err(&port->dev, "%s - failed submitting read urb,"
+@@ -779,7 +777,6 @@ static int pl2303_open(struct tty_struct
+ }
+
+ dbg("%s - submitting interrupt urb", __func__);
+- port->interrupt_in_urb->dev = serial->dev;
+ result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
+ if (result) {
+ dev_err(&port->dev, "%s - failed submitting interrupt urb,"
+@@ -1089,7 +1086,6 @@ static void pl2303_read_bulk_callback(st
+ * the read */
+ dbg("%s - caught -EPROTO, resubmitting the urb",
+ __func__);
+- urb->dev = port->serial->dev;
+ result = usb_submit_urb(urb, GFP_ATOMIC);
+ if (result)
+ dev_err(&urb->dev->dev, "%s - failed"
+@@ -1116,7 +1112,6 @@ static void pl2303_read_bulk_callback(st
+ }
+ tty_kref_put(tty);
+ /* Schedule the next read _if_ we are still open */
+- urb->dev = port->serial->dev;
+ result = usb_submit_urb(urb, GFP_ATOMIC);
+ if (result && result != -EPERM)
+ dev_err(&urb->dev->dev, "%s - failed resubmitting"
+@@ -1150,7 +1145,6 @@ static void pl2303_write_bulk_callback(s
+ dbg("%s - nonzero write bulk status received: %d", __func__,
+ status);
+ port->write_urb->transfer_buffer_length = 1;
+- port->write_urb->dev = port->serial->dev;
+ result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
+ if (result)
+ dev_err(&urb->dev->dev, "%s - failed resubmitting write"
diff --git a/usb/usb-qcaux-driver-for-auxiliary-serial-ports-on-qualcomm-devices.patch b/usb/usb-qcaux-driver-for-auxiliary-serial-ports-on-qualcomm-devices.patch
new file mode 100644
index 00000000000000..cfa6dc6dc230e7
--- /dev/null
+++ b/usb/usb-qcaux-driver-for-auxiliary-serial-ports-on-qualcomm-devices.patch
@@ -0,0 +1,156 @@
+From dcbw@redhat.com Fri Feb 26 16:30:56 2010
+From: Dan Williams <dcbw@redhat.com>
+Date: Thu, 25 Feb 2010 10:39:20 -0800
+Subject: USB: qcaux: driver for auxiliary serial ports on Qualcomm devices
+To: Greg KH <greg@kroah.com>
+Cc: linux-usb@vger.kernel.org
+Message-ID: <1267123160.15124.10.camel@localhost.localdomain>
+
+
+qcaux: add driver for QCDM-capable ports on various devices
+
+Many Qualcomm-based devices provide a CDC-ACM port which accepts
+normal AT commands and PPP connections. But they only provide one
+which makes status or signal strength requests impossible while
+PPP is active. They also provide secondary USB interfaces that
+talk the Qualcomm Diagnostic Monitor (QCDM) protocol which can be
+used for status and strength. Make those QCDM ports accessible.
+
+Signed-off-by: Dan Williams <dcbw@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/Kconfig | 11 +++++
+ drivers/usb/serial/Makefile | 1
+ drivers/usb/serial/qcaux.c | 96 ++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 108 insertions(+)
+
+--- a/drivers/usb/serial/Kconfig
++++ b/drivers/usb/serial/Kconfig
+@@ -472,6 +472,17 @@ config USB_SERIAL_OTI6858
+ To compile this driver as a module, choose M here: the
+ module will be called oti6858.
+
++config USB_SERIAL_QCAUX
++ tristate "USB Qualcomm Auxiliary Serial Port Driver"
++ ---help---
++ Say Y here if you want to use the auxiliary serial ports provided
++ by many modems based on Qualcomm chipsets. These ports often use
++ a proprietary protocol called DM and cannot be used for AT- or
++ PPP-based communication.
++
++ To compile this driver as a module, choose M here: the
++ module will be called moto_modem. If unsure, choose N.
++
+ config USB_SERIAL_QUALCOMM
+ tristate "USB Qualcomm Serial modem"
+ help
+--- a/drivers/usb/serial/Makefile
++++ b/drivers/usb/serial/Makefile
+@@ -45,6 +45,7 @@ obj-$(CONFIG_USB_SERIAL_OPTICON) += opt
+ obj-$(CONFIG_USB_SERIAL_OPTION) += option.o
+ obj-$(CONFIG_USB_SERIAL_OTI6858) += oti6858.o
+ obj-$(CONFIG_USB_SERIAL_PL2303) += pl2303.o
++obj-$(CONFIG_USB_SERIAL_QCAUX) += qcaux.o
+ obj-$(CONFIG_USB_SERIAL_QUALCOMM) += qcserial.o
+ obj-$(CONFIG_USB_SERIAL_SAFE) += safe_serial.o
+ obj-$(CONFIG_USB_SERIAL_SIEMENS_MPI) += siemens_mpi.o
+--- /dev/null
++++ b/drivers/usb/serial/qcaux.c
+@@ -0,0 +1,96 @@
++/*
++ * Qualcomm USB Auxiliary Serial Port driver
++ *
++ * Copyright (C) 2008 Greg Kroah-Hartman <greg@kroah.com>
++ * Copyright (C) 2010 Dan Williams <dcbw@redhat.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * Devices listed here usually provide a CDC ACM port on which normal modem
++ * AT commands and PPP can be used. But when that port is in-use by PPP it
++ * cannot be used simultaneously for status or signal strength. Instead, the
++ * ports here can be queried for that information using the Qualcomm DM
++ * protocol.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/tty.h>
++#include <linux/module.h>
++#include <linux/usb.h>
++#include <linux/usb/serial.h>
++
++/* NOTE: for now, only use this driver for devices that provide a CDC-ACM port
++ * for normal AT commands, but also provide secondary USB interfaces for the
++ * QCDM-capable ports. Devices that do not provide a CDC-ACM port should
++ * probably be driven by option.ko.
++ */
++
++/* UTStarcom/Pantech/Curitel devices */
++#define UTSTARCOM_VENDOR_ID 0x106c
++#define UTSTARCOM_PRODUCT_PC5740 0x3701
++#define UTSTARCOM_PRODUCT_PC5750 0x3702 /* aka Pantech PX-500 */
++#define UTSTARCOM_PRODUCT_UM150 0x3711
++#define UTSTARCOM_PRODUCT_UM175_V1 0x3712
++#define UTSTARCOM_PRODUCT_UM175_V2 0x3714
++#define UTSTARCOM_PRODUCT_UM175_ALLTEL 0x3715
++
++/* CMOTECH devices */
++#define CMOTECH_VENDOR_ID 0x16d8
++#define CMOTECH_PRODUCT_CDU550 0x5553
++#define CMOTECH_PRODUCT_CDX650 0x6512
++
++static struct usb_device_id id_table[] = {
++ { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5740, 0xff, 0x00, 0x00) },
++ { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_PC5750, 0xff, 0x00, 0x00) },
++ { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM150, 0xff, 0x00, 0x00) },
++ { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_V1, 0xff, 0x00, 0x00) },
++ { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_V2, 0xff, 0x00, 0x00) },
++ { USB_DEVICE_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, UTSTARCOM_PRODUCT_UM175_ALLTEL, 0xff, 0x00, 0x00) },
++ { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDU550, 0xff, 0xff, 0x00) },
++ { USB_DEVICE_AND_INTERFACE_INFO(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CDX650, 0xff, 0xff, 0x00) },
++ { },
++};
++MODULE_DEVICE_TABLE(usb, id_table);
++
++static struct usb_driver qcaux_driver = {
++ .name = "qcaux",
++ .probe = usb_serial_probe,
++ .disconnect = usb_serial_disconnect,
++ .id_table = id_table,
++ .no_dynamic_id = 1,
++};
++
++static struct usb_serial_driver qcaux_device = {
++ .driver = {
++ .owner = THIS_MODULE,
++ .name = "qcaux",
++ },
++ .id_table = id_table,
++ .num_ports = 1,
++};
++
++static int __init qcaux_init(void)
++{
++ int retval;
++
++ retval = usb_serial_register(&qcaux_device);
++ if (retval)
++ return retval;
++ retval = usb_register(&qcaux_driver);
++ if (retval)
++ usb_serial_deregister(&qcaux_device);
++ return retval;
++}
++
++static void __exit qcaux_exit(void)
++{
++ usb_deregister(&qcaux_driver);
++ usb_serial_deregister(&qcaux_device);
++}
++
++module_init(qcaux_init);
++module_exit(qcaux_exit);
++MODULE_LICENSE("GPL");