Skip to content

Commit

Permalink
USB: ftdi_sio: fix resolution of 2232H baud rate dividers
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Mark Adamson <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
dgloeck authored and gregkh committed Jan 23, 2011
1 parent 9abff15 commit f6c259a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base)
int divisor3;

/* 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 |= (__u32)divfrac[divisor3 & 0x7] << 14;
Expand Down

0 comments on commit f6c259a

Please sign in to comment.