Without this fix, the pl2303 usb-serial adapter with chip type_1
would not suspend properly unless it had been opened first.
A pl2303 type_1 chip will still break if the system is hibernated while the
RS-232 connector is powered by another system. This was broken before, and a
reset resume quirk does not fix it. All other suspend, hibernate, and
autosuspend scenarios work with ATEN pl2303 adaptors with HX and type_1 chips.
Signed-off-by: Sarah Sharp <[EMAIL PROTECTED]>
---
drivers/usb/serial/pl2303.c | 37 ++++++++++++++++++-------------------
1 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 15097a4..ab7f2b0 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -336,6 +336,7 @@ static int pl2303_startup(struct usb_serial *serial)
{
struct pl2303_private *priv;
enum pl2303_type type = type_0;
+ unsigned char buf;
int i;
if (serial->dev->descriptor.bDeviceClass == 0x02)
@@ -362,6 +363,22 @@ static int pl2303_startup(struct usb_serial *serial)
priv->type = type;
usb_set_serial_port_data(serial->port[i], priv);
}
+
+ pl2303_vendor_read(0x8484, 0, serial, &buf);
+ pl2303_vendor_write(0x0404, 0, serial);
+ pl2303_vendor_read(0x8484, 0, serial, &buf);
+ pl2303_vendor_read(0x8383, 0, serial, &buf);
+ pl2303_vendor_read(0x8484, 0, serial, &buf);
+ pl2303_vendor_write(0x0404, 1, serial);
+ pl2303_vendor_read(0x8484, 0, serial, &buf);
+ pl2303_vendor_read(0x8383, 0, serial, &buf);
+ pl2303_vendor_write(0, 1, serial);
+ pl2303_vendor_write(1, 0, serial);
+ if (type == HX)
+ pl2303_vendor_write(2, 0x44, serial);
+ else
+ pl2303_vendor_write(2, 0x24, serial);
+
return 0;
cleanup:
@@ -693,7 +710,6 @@ static int pl2303_open(struct usb_serial_port *port, struct
file *filp)
struct ktermios tmp_termios;
struct usb_serial *serial = port->serial;
struct pl2303_private *priv = usb_get_serial_port_data(port);
- unsigned char buf;
int result;
dbg("%s - port %d", __FUNCTION__, port->number);
@@ -701,27 +717,10 @@ static int pl2303_open(struct usb_serial_port *port,
struct file *filp)
if (priv->type != HX) {
usb_clear_halt(serial->dev, port->write_urb->pipe);
usb_clear_halt(serial->dev, port->read_urb->pipe);
- }
-
- pl2303_vendor_read(0x8484, 0, serial, &buf);
- pl2303_vendor_write(0x0404, 0, serial);
- pl2303_vendor_read(0x8484, 0, serial, &buf);
- pl2303_vendor_read(0x8383, 0, serial, &buf);
- pl2303_vendor_read(0x8484, 0, serial, &buf);
- pl2303_vendor_write(0x0404, 1, serial);
- pl2303_vendor_read(0x8484, 0, serial, &buf);
- pl2303_vendor_read(0x8383, 0, serial, &buf);
- pl2303_vendor_write(0, 1, serial);
- pl2303_vendor_write(1, 0, serial);
-
- if (priv->type == HX) {
- /* HX chip */
- pl2303_vendor_write(2, 0x44, serial);
+ } else {
/* reset upstream data pipes */
pl2303_vendor_write(8, 0, serial);
pl2303_vendor_write(9, 0, serial);
- } else {
- pl2303_vendor_write(2, 0x24, serial);
}
/* Setup termios */
--
1.5.3.1
-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html