Skip to content

Commit f6c259a

Browse files
dgloeckgregkh
authored andcommitted
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: Daniel Glöckner <dg@emlix.com> Acked-by: Mark Adamson <mark.adamson@ftdichip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 9abff15 commit f6c259a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/serial/ftdi_sio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base)
955955
int divisor3;
956956

957957
/* hi-speed baud rate is 10-bit sampling instead of 16-bit */
958-
divisor3 = (base / 10 / baud) * 8;
958+
divisor3 = base * 8 / (baud * 10);
959959

960960
divisor = divisor3 >> 3;
961961
divisor |= (__u32)divfrac[divisor3 & 0x7] << 14;

0 commit comments

Comments
 (0)