Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

serial: 8250_port: Introduce UART_IIR_FIFO_ENABLED_16750

The UART_IIR_64BYTE_FIFO is always being used in conjunction with
UART_IIR_FIFO_ENABLED. Introduce a joined UART_IIR_FIFO_ENABLED_16750
definition and use it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230911144308.4169752-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
2ff477b7 d81ffb87

+6 -6
+5 -6
drivers/tty/serial/8250/8250_port.c
··· 1008 1008 serial_out(up, UART_LCR, 0); 1009 1009 serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO | 1010 1010 UART_FCR7_64BYTE); 1011 - status1 = serial_in(up, UART_IIR) & (UART_IIR_64BYTE_FIFO | 1012 - UART_IIR_FIFO_ENABLED); 1011 + status1 = serial_in(up, UART_IIR) & UART_IIR_FIFO_ENABLED_16750; 1013 1012 serial_out(up, UART_FCR, 0); 1014 1013 serial_out(up, UART_LCR, 0); 1015 1014 1016 - if (status1 == (UART_IIR_64BYTE_FIFO | UART_IIR_FIFO_ENABLED)) 1015 + if (status1 == UART_IIR_FIFO_ENABLED_16750) 1017 1016 up->port.type = PORT_16550A_FSL64; 1018 1017 else 1019 1018 DEBUG_AUTOCONF("Motorola 8xxx DUART "); ··· 1080 1081 */ 1081 1082 serial_out(up, UART_LCR, 0); 1082 1083 serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE); 1083 - status1 = serial_in(up, UART_IIR) & (UART_IIR_64BYTE_FIFO | UART_IIR_FIFO_ENABLED); 1084 + status1 = serial_in(up, UART_IIR) & UART_IIR_FIFO_ENABLED_16750; 1084 1085 serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO); 1085 1086 1086 1087 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A); 1087 1088 serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE); 1088 - status2 = serial_in(up, UART_IIR) & (UART_IIR_64BYTE_FIFO | UART_IIR_FIFO_ENABLED); 1089 + status2 = serial_in(up, UART_IIR) & UART_IIR_FIFO_ENABLED_16750; 1089 1090 serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO); 1090 1091 1091 1092 serial_out(up, UART_LCR, 0); ··· 1093 1094 DEBUG_AUTOCONF("iir1=%d iir2=%d ", status1, status2); 1094 1095 1095 1096 if (status1 == UART_IIR_FIFO_ENABLED_16550A && 1096 - status2 == (UART_IIR_64BYTE_FIFO | UART_IIR_FIFO_ENABLED_16550A)) { 1097 + status2 == UART_IIR_FIFO_ENABLED_16750) { 1097 1098 up->port.type = PORT_16750; 1098 1099 up->capabilities |= UART_CAP_AFE | UART_CAP_SLEEP; 1099 1100 return;
+1
include/uapi/linux/serial_reg.h
··· 49 49 #define UART_IIR_FIFO_ENABLED_8250 0x00 /* 8250: no FIFO */ 50 50 #define UART_IIR_FIFO_ENABLED_16550 0x80 /* 16550: (broken/unusable) FIFO */ 51 51 #define UART_IIR_FIFO_ENABLED_16550A 0xc0 /* 16550A: FIFO enabled */ 52 + #define UART_IIR_FIFO_ENABLED_16750 0xe0 /* 16750: 64 bytes FIFO enabled */ 52 53 53 54 #define UART_FCR 2 /* Out: FIFO Control Register */ 54 55 #define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */