diff options
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index a2668d089260..65967b36365f 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -100,6 +100,7 @@ struct ftdi_sio_quirk { | |||
100 | static int ftdi_jtag_probe(struct usb_serial *serial); | 100 | static int ftdi_jtag_probe(struct usb_serial *serial); |
101 | static int ftdi_mtxorb_hack_setup(struct usb_serial *serial); | 101 | static int ftdi_mtxorb_hack_setup(struct usb_serial *serial); |
102 | static int ftdi_NDI_device_setup(struct usb_serial *serial); | 102 | static int ftdi_NDI_device_setup(struct usb_serial *serial); |
103 | static int ftdi_stmclite_probe(struct usb_serial *serial); | ||
103 | static void ftdi_USB_UIRT_setup(struct ftdi_private *priv); | 104 | static void ftdi_USB_UIRT_setup(struct ftdi_private *priv); |
104 | static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv); | 105 | static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv); |
105 | 106 | ||
@@ -123,6 +124,10 @@ static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = { | |||
123 | .port_probe = ftdi_HE_TIRA1_setup, | 124 | .port_probe = ftdi_HE_TIRA1_setup, |
124 | }; | 125 | }; |
125 | 126 | ||
127 | static struct ftdi_sio_quirk ftdi_stmclite_quirk = { | ||
128 | .probe = ftdi_stmclite_probe, | ||
129 | }; | ||
130 | |||
126 | /* | 131 | /* |
127 | * The 8U232AM has the same API as the sio except for: | 132 | * The 8U232AM has the same API as the sio except for: |
128 | * - it can support MUCH higher baudrates; up to: | 133 | * - it can support MUCH higher baudrates; up to: |
@@ -616,6 +621,7 @@ static struct usb_device_id id_table_combined [] = { | |||
616 | { USB_DEVICE(FTDI_VID, FTDI_OCEANIC_PID) }, | 621 | { USB_DEVICE(FTDI_VID, FTDI_OCEANIC_PID) }, |
617 | { USB_DEVICE(TTI_VID, TTI_QL355P_PID) }, | 622 | { USB_DEVICE(TTI_VID, TTI_QL355P_PID) }, |
618 | { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, | 623 | { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, |
624 | { USB_DEVICE(ACTON_VID, ACTON_SPECTRAPRO_PID) }, | ||
619 | { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, | 625 | { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, |
620 | { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, | 626 | { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, |
621 | { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, | 627 | { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, |
@@ -676,7 +682,17 @@ static struct usb_device_id id_table_combined [] = { | |||
676 | { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, | 682 | { USB_DEVICE(FTDI_VID, FTDI_PCDJ_DAC2_PID) }, |
677 | { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, | 683 | { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) }, |
678 | { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, | 684 | { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, |
679 | { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) }, | 685 | { USB_DEVICE(ICOM_VID, ICOM_ID_1_PID) }, |
686 | { USB_DEVICE(ICOM_VID, ICOM_OPC_U_UC_PID) }, | ||
687 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C1_PID) }, | ||
688 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2C2_PID) }, | ||
689 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2D_PID) }, | ||
690 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VT_PID) }, | ||
691 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2VR_PID) }, | ||
692 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVT_PID) }, | ||
693 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP4KVR_PID) }, | ||
694 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVT_PID) }, | ||
695 | { USB_DEVICE(ICOM_VID, ICOM_ID_RP2KVR_PID) }, | ||
680 | { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, | 696 | { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, |
681 | { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, | 697 | { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, |
682 | { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, | 698 | { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, |
@@ -706,6 +722,8 @@ static struct usb_device_id id_table_combined [] = { | |||
706 | { USB_DEVICE(FTDI_VID, FTDI_PROPOX_JTAGCABLEII_PID) }, | 722 | { USB_DEVICE(FTDI_VID, FTDI_PROPOX_JTAGCABLEII_PID) }, |
707 | { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID), | 723 | { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID), |
708 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 724 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
725 | { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID), | ||
726 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
709 | { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), | 727 | { USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID), |
710 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 728 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
711 | { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), | 729 | { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), |
@@ -800,6 +818,8 @@ static struct usb_device_id id_table_combined [] = { | |||
800 | { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) }, | 818 | { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) }, |
801 | { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID), | 819 | { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID), |
802 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 820 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
821 | { USB_DEVICE(ST_VID, ST_STMCLT1030_PID), | ||
822 | .driver_info = (kernel_ulong_t)&ftdi_stmclite_quirk }, | ||
803 | { }, /* Optional parameter entry */ | 823 | { }, /* Optional parameter entry */ |
804 | { } /* Terminating entry */ | 824 | { } /* Terminating entry */ |
805 | }; | 825 | }; |
@@ -846,10 +866,10 @@ static int ftdi_prepare_write_buffer(struct usb_serial_port *port, | |||
846 | void *dest, size_t size); | 866 | void *dest, size_t size); |
847 | static void ftdi_set_termios(struct tty_struct *tty, | 867 | static void ftdi_set_termios(struct tty_struct *tty, |
848 | struct usb_serial_port *port, struct ktermios *old); | 868 | struct usb_serial_port *port, struct ktermios *old); |
849 | static int ftdi_tiocmget(struct tty_struct *tty, struct file *file); | 869 | static int ftdi_tiocmget(struct tty_struct *tty); |
850 | static int ftdi_tiocmset(struct tty_struct *tty, struct file *file, | 870 | static int ftdi_tiocmset(struct tty_struct *tty, |
851 | unsigned int set, unsigned int clear); | 871 | unsigned int set, unsigned int clear); |
852 | static int ftdi_ioctl(struct tty_struct *tty, struct file *file, | 872 | static int ftdi_ioctl(struct tty_struct *tty, |
853 | unsigned int cmd, unsigned long arg); | 873 | unsigned int cmd, unsigned long arg); |
854 | static void ftdi_break_ctl(struct tty_struct *tty, int break_state); | 874 | static void ftdi_break_ctl(struct tty_struct *tty, int break_state); |
855 | 875 | ||
@@ -955,7 +975,7 @@ static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) | |||
955 | int divisor3; | 975 | int divisor3; |
956 | 976 | ||
957 | /* hi-speed baud rate is 10-bit sampling instead of 16-bit */ | 977 | /* hi-speed baud rate is 10-bit sampling instead of 16-bit */ |
958 | divisor3 = (base / 10 / baud) * 8; | 978 | divisor3 = base * 8 / (baud * 10); |
959 | 979 | ||
960 | divisor = divisor3 >> 3; | 980 | divisor = divisor3 >> 3; |
961 | divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; | 981 | divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; |
@@ -1699,6 +1719,25 @@ static int ftdi_jtag_probe(struct usb_serial *serial) | |||
1699 | } | 1719 | } |
1700 | 1720 | ||
1701 | /* | 1721 | /* |
1722 | * First and second port on STMCLiteadaptors is reserved for JTAG interface | ||
1723 | * and the forth port for pio | ||
1724 | */ | ||
1725 | static int ftdi_stmclite_probe(struct usb_serial *serial) | ||
1726 | { | ||
1727 | struct usb_device *udev = serial->dev; | ||
1728 | struct usb_interface *interface = serial->interface; | ||
1729 | |||
1730 | dbg("%s", __func__); | ||
1731 | |||
1732 | if (interface == udev->actconfig->interface[2]) | ||
1733 | return 0; | ||
1734 | |||
1735 | dev_info(&udev->dev, "Ignoring serial port reserved for JTAG\n"); | ||
1736 | |||
1737 | return -ENODEV; | ||
1738 | } | ||
1739 | |||
1740 | /* | ||
1702 | * The Matrix Orbital VK204-25-USB has an invalid IN endpoint. | 1741 | * The Matrix Orbital VK204-25-USB has an invalid IN endpoint. |
1703 | * We have to correct it if we want to read from it. | 1742 | * We have to correct it if we want to read from it. |
1704 | */ | 1743 | */ |
@@ -2139,7 +2178,7 @@ static void ftdi_set_termios(struct tty_struct *tty, | |||
2139 | } | 2178 | } |
2140 | } | 2179 | } |
2141 | 2180 | ||
2142 | static int ftdi_tiocmget(struct tty_struct *tty, struct file *file) | 2181 | static int ftdi_tiocmget(struct tty_struct *tty) |
2143 | { | 2182 | { |
2144 | struct usb_serial_port *port = tty->driver_data; | 2183 | struct usb_serial_port *port = tty->driver_data; |
2145 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 2184 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
@@ -2192,7 +2231,7 @@ out: | |||
2192 | return ret; | 2231 | return ret; |
2193 | } | 2232 | } |
2194 | 2233 | ||
2195 | static int ftdi_tiocmset(struct tty_struct *tty, struct file *file, | 2234 | static int ftdi_tiocmset(struct tty_struct *tty, |
2196 | unsigned int set, unsigned int clear) | 2235 | unsigned int set, unsigned int clear) |
2197 | { | 2236 | { |
2198 | struct usb_serial_port *port = tty->driver_data; | 2237 | struct usb_serial_port *port = tty->driver_data; |
@@ -2200,7 +2239,7 @@ static int ftdi_tiocmset(struct tty_struct *tty, struct file *file, | |||
2200 | return update_mctrl(port, set, clear); | 2239 | return update_mctrl(port, set, clear); |
2201 | } | 2240 | } |
2202 | 2241 | ||
2203 | static int ftdi_ioctl(struct tty_struct *tty, struct file *file, | 2242 | static int ftdi_ioctl(struct tty_struct *tty, |
2204 | unsigned int cmd, unsigned long arg) | 2243 | unsigned int cmd, unsigned long arg) |
2205 | { | 2244 | { |
2206 | struct usb_serial_port *port = tty->driver_data; | 2245 | struct usb_serial_port *port = tty->driver_data; |