serial/uuc_uart: Support higher bitrates than 115200 Bit/s
authorAlexander Stein <alexander.stein@systec-electronic.com>
Thu, 9 Jul 2015 08:34:34 +0000 (10:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Jul 2015 01:05:00 +0000 (18:05 -0700)
The maximum bitrate supported depends on the clock rate used in BRG.
This is stored in port.uartclk during probe. Respecting the 16x
oversampling higher bitrates can be supported.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/ucc_uart.c

index 7d2532b23969e738cc63f9c952ff737a18b2abea..73190f5d28327ad5a039132726f656258603cd26 100644 (file)
@@ -950,7 +950,7 @@ static void qe_uart_set_termios(struct uart_port *port,
        if ((termios->c_cflag & CREAD) == 0)
                port->read_status_mask &= ~BD_SC_EMPTY;
 
-       baud = uart_get_baud_rate(port, termios, old, 0, 115200);
+       baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16);
 
        /* Do we really need a spinlock here? */
        spin_lock_irqsave(&port->lock, flags);