diff options
author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2022-11-25 15:05:07 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-19 15:01:20 +0100 |
commit | 3398cc4f2b1592148a2ebabc5a2df3e303d4e77c (patch) | |
tree | 6efe36d39a28beafdde3c9596bfe0de92f60d2f6 /drivers/tty/serial/8250/8250_port.c | |
parent | 67a9aee7815d10e9227e32c3c7ea26726284eaef (diff) |
serial: 8250: Add IIR FIFOs enabled field properly
Don't use magic literals & comments but define a real field instead
for UART_IIR_FIFO_ENABLED and name also the values.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20221125130509.8482-5-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/8250/8250_port.c')
-rw-r--r-- | drivers/tty/serial/8250/8250_port.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index e79bf2afd9be..a47ce3e974a2 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1293,22 +1293,19 @@ static void autoconfig(struct uart_8250_port *up) serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO); - /* Assign this as it is to truncate any bits above 7. */ - scratch = serial_in(up, UART_IIR); - - switch (scratch >> 6) { - case 0: + switch (serial_in(up, UART_IIR) & UART_IIR_FIFO_ENABLED) { + case UART_IIR_FIFO_ENABLED_8250: autoconfig_8250(up); break; - case 1: - port->type = PORT_UNKNOWN; - break; - case 2: + case UART_IIR_FIFO_ENABLED_16550: port->type = PORT_16550; break; - case 3: + case UART_IIR_FIFO_ENABLED_16550A: autoconfig_16550a(up); break; + default: + port->type = PORT_UNKNOWN; + break; } #ifdef CONFIG_SERIAL_8250_RSA |