Thread (5 messages) 5 messages, 1 author, 2021-01-26

[Bug 210351] Wrong setting baudrate for FTDI chip FT230X

From: <hidden>
Date: 2021-01-08 11:37:55

https://bugzilla.kernel.org/show_bug.cgi?id=210351
--- Comment #2 from Vladimir (svv75@mail.ru) ---
Hello, Johan.

Unfortunately, I don't have a device at hand right now. But I remember the
lsusb output was showing FT-X type. And under Windows, all three chips I
mentioned work correctly with all prescalers. I contacted FTDI tech support
with this problem. They advised me to have such a patch for ftdi_sio.c and it
solved the problem. Here's the patch:

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)) {

            / * 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);

      }



So, the high bit of the factional part is lost on the FT-X chips. To fix it in
the kernel try:



      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);

      }

But I don't know why the most significant bit of the prescaler is masked by
something. I have no information about the chip configuration registers. It
looks like this is confidential information. But they could provide it to you
as the driver developer.

Vladimir

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help