--- 8250.c_2.6.11-org 2005-03-02 08:37:47.000000000 +0100 +++ 8250.c 2005-03-05 15:01:34.000000000 +0100 @@ -1604,7 +1604,7 @@ struct uart_8250_port *up = (struct uart_8250_port *)port; unsigned char cval, fcr = 0; unsigned long flags; - unsigned int baud, quot; + unsigned int baud, quot, max_baud; switch (termios->c_cflag & CSIZE) { case CS5: @@ -1636,9 +1636,29 @@ /* * Ask the core to calculate the divisor for us. */ - baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); + max_baud = (up->port.type == PORT_16C950 ? port->uartclk/4 : port->uartclk/16); + baud = uart_get_baud_rate(port, termios, old, 0, max_baud); quot = serial8250_get_divisor(port, baud); + /* + * 16C950 supports additional prescaler ratios between 1:16 and 1:4 + * thus increasing max baud rate to uartclk/4. The following was taken + * from kernel 2.4 by Mathias Adam to make the Socket + * Bluetooth CF Card work under 2.6.11. + * (Patch might have other side effects so be careful!) + */ + if (up->port.type == PORT_16C950) { + if (baud <= port->uartclk/16) + serial_icr_write(up, UART_TCR, 0); + else if (baud <= port->uartclk/8) { + serial_icr_write(up, UART_TCR, 0x8); + } else if (baud <= port->uartclk/4) { + serial_icr_write(up, UART_TCR, 0x4); + } else + serial_icr_write(up, UART_TCR, 0); + } + /* * Work around a bug in the Oxford Semiconductor 952 rev B * chip which causes it to seriously miscalculate baud rates