Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
[linux-3.10.git] / drivers / usb / serial / ftdi_sio.c
index 4fc588c..89a9a58 100644 (file)
@@ -177,9 +177,11 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_SNIFFER_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) },
        { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
        { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },
+       { USB_DEVICE(FTDI_VID, FTDI_LENZ_LIUSB_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_XF_547_PID) },
@@ -673,7 +675,6 @@ static struct usb_device_id id_table_combined [] = {
        { 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) },
@@ -714,8 +715,37 @@ static struct usb_device_id id_table_combined [] = {
                .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) },
@@ -750,6 +780,20 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID),
                .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
        { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) },
+       { USB_DEVICE(FTDI_VID, ACCESIO_COM4SM_PID) },
+       { USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID),
+               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+       { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_24_MASTER_WING_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_PC_WING_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_USB_DMX_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MIDI_TIMECODE_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MINI_WING_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MAXI_WING_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MEDIA_WING_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_WING_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LOGBOOKML_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) },
        { },                                    /* Optional parameter entry */
        { }                                     /* Terminating entry */
 };
@@ -1376,7 +1420,7 @@ static void ftdi_set_max_packet_size(struct usb_serial_port *port)
        }
 
        /* set max packet size based on descriptor */
-       priv->max_packet_size = ep_desc->wMaxPacketSize;
+       priv->max_packet_size = le16_to_cpu(ep_desc->wMaxPacketSize);
 
        dev_info(&udev->dev, "Setting MaxPacketSize %d\n", priv->max_packet_size);
 }
@@ -1548,6 +1592,7 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port)
        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;
 }
@@ -1676,8 +1721,6 @@ static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
 
        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),
@@ -1831,7 +1874,7 @@ static int ftdi_process_packet(struct tty_struct *tty,
 
        if (port->port.console && port->sysrq) {
                for (i = 0; i < len; i++, ch++) {
-                       if (!usb_serial_handle_sysrq_char(tty, port, *ch))
+                       if (!usb_serial_handle_sysrq_char(port, *ch))
                                tty_insert_flip_char(tty, *ch, flag);
                }
        } else {
@@ -2017,8 +2060,6 @@ static void ftdi_set_termios(struct tty_struct *tty,
                                "urb failed to set to rts/cts flow control\n");
                }
 
-               /* raise DTR/RTS */
-               set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
        } else {
                /*
                 * Xon/Xoff code
@@ -2066,8 +2107,6 @@ static void ftdi_set_termios(struct tty_struct *tty,
                        }
                }
 
-               /* lower DTR/RTS */
-               clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
        }
 }
 
@@ -2156,6 +2195,7 @@ static int ftdi_ioctl(struct tty_struct *tty, struct file *file,
         * - mask passed in arg for lines of interest
         *   (use |'ed TIOCM_RNG/DSR/CD/CTS for masking)
         * Caller should use TIOCGICOUNT to see which one it was.
+        * (except that the driver doesn't support it !)
         *
         * This code is borrowed from linux/drivers/char/serial.c
         */