]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
USB: serial: ftdi_sio: fix FTX sub-integer prescaler
authorJohan Hovold <johan@kernel.org>
Tue, 26 Jan 2021 13:59:17 +0000 (14:59 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Apr 2021 16:31:37 +0000 (18:31 +0200)
BugLink: https://bugs.launchpad.net/bugs/1918974
commit 528222d0c8ce93e435a95cd1e476b60409dd5381 upstream.

The most-significant bit of the sub-integer-prescaler index is set in
the high byte of the baudrate request wIndex also for FTX devices.

This fixes rates like 1152000 which got mapped to 1.2 MBd.

Reported-by: Vladimir <svv75@mail.ru>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=210351
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/usb/serial/ftdi_sio.c

index 01a98d071c7c7f688debd8164d05ea97c2b544a4..c00e4177651a8e699fb0bac85d0f17849d596f44 100644 (file)
@@ -1386,8 +1386,9 @@ static int change_speed(struct tty_struct *tty, struct usb_serial_port *port)
        index_value = get_ftdi_divisor(tty, port);
        value = (u16)index_value;
        index = (u16)(index_value >> 16);
-       if ((priv->chip_type == FT2232C) || (priv->chip_type == FT2232H) ||
-               (priv->chip_type == FT4232H) || (priv->chip_type == FT232H)) {
+       if (priv->chip_type == FT2232C || priv->chip_type == FT2232H ||
+                       priv->chip_type == FT4232H || priv->chip_type == FT232H ||
+                       priv->chip_type == FTX) {
                /* Probably the BM type needs the MSB of the encoded fractional
                 * divider also moved like for the chips above. Any infos? */
                index = (u16)((index << 8) | priv->interface);