Messages in this thread Patch in this message | | | From | Eugeniu Rosca <> | Subject | [PATCH] serial: sh-sci: Support custom speed setting | Date | Wed, 29 Jan 2020 17:19:55 +0100 |
| |
From: Torii Kenichi <torii.ken1@jp.fujitsu.com>
This patch is necessary to use BT module and XM module with DENSO TEN development board.
This patch supports ASYNC_SPD_CUST flag by ioctl(TIOCSSERIAL), enables custom speed setting with setserial(1).
The custom speed is calculated from uartclk and custom_divisor. If custom_divisor is zero, custom speed setting is invalid.
Signed-off-by: Torii Kenichi <torii.ken1@jp.fujitsu.com> [erosca: rebase against v5.5] Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> --- drivers/tty/serial/sh-sci.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 87ca6294de0e..dd468909b2c4 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -2405,6 +2405,10 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, if (!baud) goto done; + if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST && + port->custom_divisor) + baud = port->uartclk / port->custom_divisor; + /* * There can be multiple sources for the sampling clock. Find the one * that gives us the smallest deviation from the desired baud rate. -- 2.25.0
| |