History

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.

Ilpo Järvinen committed 3 years ago

Commit 3398cc41 parent 67a9aee2 files · +11 −10Browse files

Unified · Split

2 files
  1. drivers/tty/serial/8250/8250_port.c +7 −10
  2. include/uapi/linux/serial_reg.h +4 −0
drivers/tty/serial/8250/8250_port.c+7−10
@@ -1293,22 +1293,19 @@ static void autoconfig(struct uart_8250_port *up) · 1292 unmodified lines
1293 1293
1294 serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);1294 serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);
1295 1295
1296 /* Assign this as it is to truncate any bits above 7. */1296 switch (serial_in(up, UART_IIR) & UART_IIR_FIFO_ENABLED) {
1297 scratch = serial_in(up, UART_IIR);1297 case UART_IIR_FIFO_ENABLED_8250:
1298
1299 switch (scratch >> 6) {
1300 case 0:
1301 autoconfig_8250(up);1298 autoconfig_8250(up);
1302 break;1299 break;
1303 case 1:1300 case UART_IIR_FIFO_ENABLED_16550:
1304 port->type = PORT_UNKNOWN;
1305 break;
1306 case 2:
1307 port->type = PORT_16550;1301 port->type = PORT_16550;
1308 break;1302 break;
1309 case 3:1303 case UART_IIR_FIFO_ENABLED_16550A:
1310 autoconfig_16550a(up);1304 autoconfig_16550a(up);
1311 break;1305 break;
1306 default:
1307 port->type = PORT_UNKNOWN;
1308 break;
1312 }1309 }
1313 1310
1314#ifdef CONFIG_SERIAL_8250_RSA1311#ifdef CONFIG_SERIAL_8250_RSA
include/uapi/linux/serial_reg.h+4−0
@@ -44,6 +44,10 @@ · 43 unmodified lines
44#define UART_IIR_RX_TIMEOUT 0x0c /* OMAP RX Timeout interrupt */44#define UART_IIR_RX_TIMEOUT 0x0c /* OMAP RX Timeout interrupt */
45#define UART_IIR_XOFF 0x10 /* OMAP XOFF/Special Character */45#define UART_IIR_XOFF 0x10 /* OMAP XOFF/Special Character */
46#define UART_IIR_CTS_RTS_DSR 0x20 /* OMAP CTS/RTS/DSR Change */46#define UART_IIR_CTS_RTS_DSR 0x20 /* OMAP CTS/RTS/DSR Change */
47#define UART_IIR_FIFO_ENABLED 0xc0 /* FIFOs enabled / port type identification */
48#define UART_IIR_FIFO_ENABLED_8250 0x00 /* 8250: no FIFO */
49#define UART_IIR_FIFO_ENABLED_16550 0x80 /* 16550: (broken/unusable) FIFO */
50#define UART_IIR_FIFO_ENABLED_16550A 0xc0 /* 16550A: FIFO enabled */
47 51
48#define UART_FCR 2 /* Out: FIFO Control Register */52#define UART_FCR 2 /* Out: FIFO Control Register */
49#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */53#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t