Commit f6c259a3 authored by Daniel Glöckner's avatar Daniel Glöckner Committed by Greg Kroah-Hartman

USB: ftdi_sio: fix resolution of 2232H baud rate dividers

The 2232H high speed baud rates also support fractional baud
rate divisors, but when the performing the divisions before
the multiplication, the fractional bits are lost.
Signed-off-by: default avatarDaniel Glöckner <dg@emlix.com>
Acked-by: default avatarMark Adamson <mark.adamson@ftdichip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9abff15d
...@@ -955,7 +955,7 @@ static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) ...@@ -955,7 +955,7 @@ static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base)
int divisor3; int divisor3;
/* hi-speed baud rate is 10-bit sampling instead of 16-bit */ /* hi-speed baud rate is 10-bit sampling instead of 16-bit */
divisor3 = (base / 10 / baud) * 8; divisor3 = base * 8 / (baud * 10);
divisor = divisor3 >> 3; divisor = divisor3 >> 3;
divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; divisor |= (__u32)divfrac[divisor3 & 0x7] << 14;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment