]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
USB: ftdi_sio: enable two UART ports on ST Microconnect Lite
authorAdrian Thomasset <adrian.thomasset@st.com>
Wed, 24 Apr 2013 10:37:35 +0000 (11:37 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 13 May 2013 14:02:25 +0000 (15:02 +0100)
commit 71d9a2b95fc9c9474d46d764336efd7a5a805555 upstream.

The FT4232H used in the ST Micro Connect Lite has four hi-speed UART ports.
The first two ports are reserved for the JTAG interface.

We enable by default ports 2 and 3 as UARTs (where port 2 is a
conventional RS-232 UART)

Signed-off-by: Adrian Thomasset <adrian.thomasset@st.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/serial/ftdi_sio.c

index d34df4bcc314d5b2d6412d833bea839d8cbdc867..51d1712496efd06c35d78a5cfae74177ff87f79c 100644 (file)
@@ -1819,8 +1819,11 @@ static int ftdi_8u2232c_probe(struct usb_serial *serial)
 }
 
 /*
- * First and second port on STMCLiteadaptors is reserved for JTAG interface
- * and the forth port for pio
+ * First two ports on JTAG adaptors using an FT4232 such as STMicroelectronics's
+ * ST Micro Connect Lite are reserved for JTAG or other non-UART interfaces and
+ * can be accessed from userspace.
+ * The next two ports are enabled as UARTs by default, where port 2 is
+ * a conventional RS-232 UART.
  */
 static int ftdi_stmclite_probe(struct usb_serial *serial)
 {
@@ -1829,12 +1832,13 @@ static int ftdi_stmclite_probe(struct usb_serial *serial)
 
        dbg("%s", __func__);
 
-       if (interface == udev->actconfig->interface[2])
-               return 0;
-
-       dev_info(&udev->dev, "Ignoring serial port reserved for JTAG\n");
+       if (interface == udev->actconfig->interface[0] ||
+           interface == udev->actconfig->interface[1]) {
+               dev_info(&udev->dev, "Ignoring serial port reserved for JTAG\n");
+               return -ENODEV;
+       }
 
-       return -ENODEV;
+       return 0;
 }
 
 /*