# HG changeset patch # User Mychaela Falconia # Date 1506585358 0 # Node ID 40f44aa49dd01a2fb75478499b9ef0f16d1363e1 # Parent 00805e7c4c4520e9b932568acbb0dd855da020ec linux-2.6.37.6-ftdi_sio.c.patch moved from doc to old diff -r 00805e7c4c45 -r 40f44aa49dd0 doc/linux-2.6.37.6-ftdi_sio.c.patch --- a/doc/linux-2.6.37.6-ftdi_sio.c.patch Thu Sep 28 07:53:50 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ ---- ftdi_sio.c.orig 2011-03-27 11:01:41.000000000 -0800 -+++ ftdi_sio.c 2015-10-30 13:18:40.879000032 -0800 -@@ -949,7 +949,7 @@ - static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; - __u32 divisor; - /* divisor shifted 3 bits to the left */ -- int divisor3 = base / 2 / baud; -+ int divisor3 = (base / 2 + baud / 2) / baud; - divisor = divisor3 >> 3; - divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; - /* Deal with special cases for highest baud rates. */ -@@ -1087,6 +1087,17 @@ - baud = tty_get_baud_rate(tty); - dbg("%s - tty_get_baud_rate reports speed %d", __func__, baud); - -+ /* -+ * FreeCalypso hack: translate non-std high -+ * baud rates for GSM like CP2102 does. -+ */ -+ if (baud == 230400) -+ baud = 203125; -+ else if (baud == 460800) -+ baud = 406250; -+ else if (baud == 921600) -+ baud = 812500; -+ - /* 2. Observe async-compatible custom_divisor hack, update baudrate - if needed */ - diff -r 00805e7c4c45 -r 40f44aa49dd0 old/linux-2.6.37.6-ftdi_sio.c.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/old/linux-2.6.37.6-ftdi_sio.c.patch Thu Sep 28 07:55:58 2017 +0000 @@ -0,0 +1,29 @@ +--- ftdi_sio.c.orig 2011-03-27 11:01:41.000000000 -0800 ++++ ftdi_sio.c 2015-10-30 13:18:40.879000032 -0800 +@@ -949,7 +949,7 @@ + static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; + __u32 divisor; + /* divisor shifted 3 bits to the left */ +- int divisor3 = base / 2 / baud; ++ int divisor3 = (base / 2 + baud / 2) / baud; + divisor = divisor3 >> 3; + divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; + /* Deal with special cases for highest baud rates. */ +@@ -1087,6 +1087,17 @@ + baud = tty_get_baud_rate(tty); + dbg("%s - tty_get_baud_rate reports speed %d", __func__, baud); + ++ /* ++ * FreeCalypso hack: translate non-std high ++ * baud rates for GSM like CP2102 does. ++ */ ++ if (baud == 230400) ++ baud = 203125; ++ else if (baud == 460800) ++ baud = 406250; ++ else if (baud == 921600) ++ baud = 812500; ++ + /* 2. Observe async-compatible custom_divisor hack, update baudrate + if needed */ +