diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-08 17:29:39 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-08 17:29:39 +0200 |
commit | 3bfb8239be5753a6d7a77556d09ef99ebed89964 (patch) | |
tree | 883dcf419decb82679ab30ae61d3ada9f7d26b05 /drivers/usb/serial/ftdi_sio.c | |
parent | usb: typec: tcpci_maxim: Add support for Sink FRS (diff) | |
parent | USB: serial: option: add Cellient MPL200 card (diff) | |
download | linux-3bfb8239be5753a6d7a77556d09ef99ebed89964.tar.xz linux-3bfb8239be5753a6d7a77556d09ef99ebed89964.zip |
Merge tag 'usb-serial-5.10-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next
Johan writes:
USB-serial updates for 5.10-rc1
Here are the USB-serial updates for 5.10-rc1, including:
- new device ids
- various clean ups
All have been in linux-next with no reported issues.
* tag 'usb-serial-5.10-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial:
USB: serial: option: add Cellient MPL200 card
USB: serial: ftdi_sio: use cur_altsetting for consistency
USB: serial: option: Add Telit FT980-KS composition
USB: serial: qcserial: fix altsetting probing
USB: serial: ftdi_sio: clean up jtag quirks
USB: serial: pl2303: add device-id for HP GC device
USB: serial: ftdi_sio: add support for FreeCalypso JTAG+UART adapters
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 9823bb424abd..e0f4c3d9649c 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -1037,6 +1037,11 @@ static const struct usb_device_id id_table_combined[] = { /* U-Blox devices */ { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) }, { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) }, + /* FreeCalypso USB adapters */ + { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_BUF_PID), + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_UNBUF_PID), + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { } /* Terminating entry */ }; @@ -1566,7 +1571,8 @@ static void ftdi_determine_type(struct usb_serial_port *port) dev_dbg(&port->dev, "%s: bcdDevice = 0x%x, bNumInterfaces = %u\n", __func__, version, interfaces); if (interfaces > 1) { - int inter; + struct usb_interface *intf = serial->interface; + int ifnum = intf->cur_altsetting->desc.bInterfaceNumber; /* Multiple interfaces.*/ if (version == 0x0800) { @@ -1581,16 +1587,15 @@ static void ftdi_determine_type(struct usb_serial_port *port) priv->chip_type = FT2232C; /* Determine interface code. */ - inter = serial->interface->altsetting->desc.bInterfaceNumber; - if (inter == 0) { + if (ifnum == 0) priv->interface = INTERFACE_A; - } else if (inter == 1) { + else if (ifnum == 1) priv->interface = INTERFACE_B; - } else if (inter == 2) { + else if (ifnum == 2) priv->interface = INTERFACE_C; - } else if (inter == 3) { + else if (ifnum == 3) priv->interface = INTERFACE_D; - } + /* BM-type devices have a bug where bcdDevice gets set * to 0x200 when iSerialNumber is 0. */ if (version < 0x500) { @@ -2330,12 +2335,11 @@ static int ftdi_NDI_device_setup(struct usb_serial *serial) */ static int ftdi_jtag_probe(struct usb_serial *serial) { - struct usb_device *udev = serial->dev; - struct usb_interface *interface = serial->interface; + struct usb_interface *intf = serial->interface; + int ifnum = intf->cur_altsetting->desc.bInterfaceNumber; - if (interface == udev->actconfig->interface[0]) { - dev_info(&udev->dev, - "Ignoring serial port reserved for JTAG\n"); + if (ifnum == 0) { + dev_info(&intf->dev, "Ignoring interface reserved for JTAG\n"); return -ENODEV; } @@ -2367,12 +2371,11 @@ static int ftdi_8u2232c_probe(struct usb_serial *serial) */ static int ftdi_stmclite_probe(struct usb_serial *serial) { - struct usb_device *udev = serial->dev; - struct usb_interface *interface = serial->interface; + struct usb_interface *intf = serial->interface; + int ifnum = intf->cur_altsetting->desc.bInterfaceNumber; - if (interface == udev->actconfig->interface[0] || - interface == udev->actconfig->interface[1]) { - dev_info(&udev->dev, "Ignoring serial port reserved for JTAG\n"); + if (ifnum < 2) { + dev_info(&intf->dev, "Ignoring interface reserved for JTAG\n"); return -ENODEV; } |