FreeCalypso > hg > freecalypso-tools
view old/linux-2.6.37.6-ftdi_sio.c.patch @ 1014:961efadd530a default tip
fc-shell TCH DL handler: add support for CSD modes
TCH DL capture mechanism in FC Tourmaline firmware has been extended
to support CSD modes in addition to speech - add the necessary support
on the host tools side.
It needs to be noted that this mechanism in its present state does NOT
provide the debug utility value that was sought: as we learned only
after the code was implemented, TI's DSP has a misfeature in that the
buffer we are reading (a_dd_0[]) is zeroed out when the IDS block
is enabled, i.e., we are reading all zeros and not the real DL bits
we were after. But since the code has already been written, we are
keeping it - perhaps we can do some tests with IDS disabled.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 26 Nov 2024 06:27:43 +0000 |
parents | 40f44aa49dd0 |
children |
line wrap: on
line source
--- 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 */