#define PL2303_QUIRK_UART_STATE_IDX0 BIT(0)
+#define PL2303_QUIRK_LEGACY BIT(1)
static const struct usb_device_id id_table[] = {
{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID) },
spriv->type = type;
spriv->quirks = (unsigned long)usb_get_serial_data(serial);
+ if (type == TYPE_01)
+ spriv->quirks |= PL2303_QUIRK_LEGACY;
usb_set_serial_data(serial, spriv);
pl2303_vendor_read(serial, 0x8383, buf);
pl2303_vendor_write(serial, 0, 1);
pl2303_vendor_write(serial, 1, 0);
- if (type == TYPE_01)
+ if (spriv->quirks & PL2303_QUIRK_LEGACY)
pl2303_vendor_write(serial, 2, 0x24);
else
pl2303_vendor_write(serial, 2, 0x44);
}
if (C_CRTSCTS(tty)) {
- if (spriv->type == TYPE_01)
+ if (spriv->quirks & PL2303_QUIRK_LEGACY)
pl2303_vendor_write(serial, 0x0, 0x41);
else
pl2303_vendor_write(serial, 0x0, 0x61);
struct pl2303_serial_private *spriv = usb_get_serial_data(serial);
int result;
- if (spriv->type == TYPE_01) {
+ if (spriv->quirks & PL2303_QUIRK_LEGACY) {
usb_clear_halt(serial->dev, port->write_urb->pipe);
usb_clear_halt(serial->dev, port->read_urb->pipe);
} else {