aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ftdi_sio.c
diff options
context:
space:
mode:
authorDaniel Glöckner <dg@emlix.com>2011-01-10 18:42:14 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-01-22 22:38:57 -0500
commitf6c259a39fd7bb8db6661690976a0f05d12b707d (patch)
tree607537090b998ecf679c21097583690ccef8769c /drivers/usb/serial/ftdi_sio.c
parent9abff15dd69c6f4ed88ecc8ba089f55e9cf6655e (diff)
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>
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r--drivers/usb/serial/ftdi_sio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index a2668d089260..71a0f99023bd 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -955,7 +955,7 @@ static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base)
955 int divisor3; 955 int divisor3;
956 956
957 /* hi-speed baud rate is 10-bit sampling instead of 16-bit */ 957 /* hi-speed baud rate is 10-bit sampling instead of 16-bit */
958 divisor3 = (base / 10 / baud) * 8; 958 divisor3 = base * 8 / (baud * 10);
959 959
960 divisor = divisor3 >> 3; 960 divisor = divisor3 >> 3;
961 divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; 961 divisor |= (__u32)divfrac[divisor3 & 0x7] << 14;