Commit cac8f719 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Greg Kroah-Hartman

serial: tegra: Remove custom frame size calculation

The number of bits can be calculated using tty_get_frame_size(), no
need for the driver to do it on its own.
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220830084925.5608-6-ilpo.jarvinen@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5ec2952c
...@@ -1279,7 +1279,6 @@ static void tegra_uart_set_termios(struct uart_port *u, ...@@ -1279,7 +1279,6 @@ static void tegra_uart_set_termios(struct uart_port *u,
unsigned long flags; unsigned long flags;
unsigned int lcr; unsigned int lcr;
unsigned char char_bits; unsigned char char_bits;
int symb_bit = 1;
struct clk *parent_clk = clk_get_parent(tup->uart_clk); struct clk *parent_clk = clk_get_parent(tup->uart_clk);
unsigned long parent_clk_rate = clk_get_rate(parent_clk); unsigned long parent_clk_rate = clk_get_rate(parent_clk);
int max_divider = (tup->cdata->support_clk_src_div) ? 0x7FFF : 0xFFFF; int max_divider = (tup->cdata->support_clk_src_div) ? 0x7FFF : 0xFFFF;
...@@ -1306,7 +1305,6 @@ static void tegra_uart_set_termios(struct uart_port *u, ...@@ -1306,7 +1305,6 @@ static void tegra_uart_set_termios(struct uart_port *u,
termios->c_cflag &= ~CMSPAR; termios->c_cflag &= ~CMSPAR;
if ((termios->c_cflag & PARENB) == PARENB) { if ((termios->c_cflag & PARENB) == PARENB) {
symb_bit++;
if (termios->c_cflag & PARODD) { if (termios->c_cflag & PARODD) {
lcr |= UART_LCR_PARITY; lcr |= UART_LCR_PARITY;
lcr &= ~UART_LCR_EPAR; lcr &= ~UART_LCR_EPAR;
...@@ -1319,22 +1317,18 @@ static void tegra_uart_set_termios(struct uart_port *u, ...@@ -1319,22 +1317,18 @@ static void tegra_uart_set_termios(struct uart_port *u,
} }
char_bits = tty_get_char_size(termios->c_cflag); char_bits = tty_get_char_size(termios->c_cflag);
symb_bit += char_bits;
lcr &= ~UART_LCR_WLEN8; lcr &= ~UART_LCR_WLEN8;
lcr |= UART_LCR_WLEN(char_bits); lcr |= UART_LCR_WLEN(char_bits);
/* Stop bits */ /* Stop bits */
if (termios->c_cflag & CSTOPB) { if (termios->c_cflag & CSTOPB)
lcr |= UART_LCR_STOP; lcr |= UART_LCR_STOP;
symb_bit += 2; else
} else {
lcr &= ~UART_LCR_STOP; lcr &= ~UART_LCR_STOP;
symb_bit++;
}
tegra_uart_write(tup, lcr, UART_LCR); tegra_uart_write(tup, lcr, UART_LCR);
tup->lcr_shadow = lcr; tup->lcr_shadow = lcr;
tup->symb_bit = symb_bit; tup->symb_bit = tty_get_frame_size(termios->c_cflag);
/* Baud rate. */ /* Baud rate. */
baud = uart_get_baud_rate(u, termios, oldtermios, baud = uart_get_baud_rate(u, termios, oldtermios,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment