annotate doc/linux-2.6.37.6-ftdi_sio.c.patch @ 993:d92e4aadeeb3

target-utils/c139explore: a cleaner way of setting the fixed UART base address
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Wed, 30 Dec 2015 22:12:35 +0000
parents f4da3071dd61
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
962
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1 --- ftdi_sio.c.orig 2011-03-27 11:01:41.000000000 -0800
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
2 +++ ftdi_sio.c 2015-10-30 13:18:40.879000032 -0800
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
3 @@ -949,7 +949,7 @@
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
4 static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 };
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
5 __u32 divisor;
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
6 /* divisor shifted 3 bits to the left */
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
7 - int divisor3 = base / 2 / baud;
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
8 + int divisor3 = (base / 2 + baud / 2) / baud;
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
9 divisor = divisor3 >> 3;
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10 divisor |= (__u32)divfrac[divisor3 & 0x7] << 14;
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11 /* Deal with special cases for highest baud rates. */
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
12 @@ -1087,6 +1087,17 @@
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
13 baud = tty_get_baud_rate(tty);
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
14 dbg("%s - tty_get_baud_rate reports speed %d", __func__, baud);
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
15
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
16 + /*
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
17 + * FreeCalypso hack: translate non-std high
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
18 + * baud rates for GSM like CP2102 does.
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
19 + */
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
20 + if (baud == 230400)
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
21 + baud = 203125;
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 + else if (baud == 460800)
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
23 + baud = 406250;
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
24 + else if (baud == 921600)
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25 + baud = 812500;
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26 +
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 /* 2. Observe async-compatible custom_divisor hack, update baudrate
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
28 if needed */
f4da3071dd61 doc/High-speed-serial write-up and Linux kernel patch added
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
29