Commit 528222d0 authored by Johan Hovold's avatar Johan Hovold
Browse files

USB: serial: ftdi_sio: fix FTX sub-integer prescaler



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: default avatarVladimir <svv75@mail.ru>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=210351


Cc: stable@vger.kernel.org
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent e2f2dea3
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -1386,8 +1386,9 @@ static int change_speed(struct tty_struct *tty, struct usb_serial_port *port)
	index_value = get_ftdi_divisor(tty, port);
	index_value = get_ftdi_divisor(tty, port);
	value = (u16)index_value;
	value = (u16)index_value;
	index = (u16)(index_value >> 16);
	index = (u16)(index_value >> 16);
	if ((priv->chip_type == FT2232C) || (priv->chip_type == FT2232H) ||
	if (priv->chip_type == FT2232C || priv->chip_type == FT2232H ||
		(priv->chip_type == FT4232H) || (priv->chip_type == FT232H)) {
			priv->chip_type == FT4232H || priv->chip_type == FT232H ||
			priv->chip_type == FTX) {
		/* Probably the BM type needs the MSB of the encoded fractional
		/* Probably the BM type needs the MSB of the encoded fractional
		 * divider also moved like for the chips above. Any infos? */
		 * divider also moved like for the chips above. Any infos? */
		index = (u16)((index << 8) | priv->interface);
		index = (u16)((index << 8) | priv->interface);