comparison old/linux-2.6.37.6-ftdi_sio.c.patch @ 259:40f44aa49dd0

linux-2.6.37.6-ftdi_sio.c.patch moved from doc to old
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 28 Sep 2017 07:55:58 +0000
parents doc/linux-2.6.37.6-ftdi_sio.c.patch@e7502631a0f9
children
comparison
equal deleted inserted replaced
258:00805e7c4c45 259:40f44aa49dd0
1 --- ftdi_sio.c.orig 2011-03-27 11:01:41.000000000 -0800
2 +++ ftdi_sio.c 2015-10-30 13:18:40.879000032 -0800
3 @@ -949,7 +949,7 @@
4 static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 };
5 __u32 divisor;
6 /* divisor shifted 3 bits to the left */
7 - int divisor3 = base / 2 / baud;
8 + int divisor3 = (base / 2 + baud / 2) / baud;
9 divisor = divisor3 >> 3;
10 divisor |= (__u32)divfrac[divisor3 & 0x7] << 14;
11 /* Deal with special cases for highest baud rates. */
12 @@ -1087,6 +1087,17 @@
13 baud = tty_get_baud_rate(tty);
14 dbg("%s - tty_get_baud_rate reports speed %d", __func__, baud);
15
16 + /*
17 + * FreeCalypso hack: translate non-std high
18 + * baud rates for GSM like CP2102 does.
19 + */
20 + if (baud == 230400)
21 + baud = 203125;
22 + else if (baud == 460800)
23 + baud = 406250;
24 + else if (baud == 921600)
25 + baud = 812500;
26 +
27 /* 2. Observe async-compatible custom_divisor hack, update baudrate
28 if needed */
29