Skip to content

Commit 166105c

Browse files
fbrozovicgregkh
authored andcommitted
serial: 8250_fintek: Add support for F81216E
The F81216E is a LPC/eSPI to 4 UART Super I/O and is mostly compatible with the F81216H, but does not support RS-485 auto-direction delays on any port. Signed-off-by: Filip Brozovic <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3791ea6 commit 166105c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/tty/serial/8250/8250_fintek.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define CHIP_ID_F81866 0x1010
2222
#define CHIP_ID_F81966 0x0215
2323
#define CHIP_ID_F81216AD 0x1602
24+
#define CHIP_ID_F81216E 0x1617
2425
#define CHIP_ID_F81216H 0x0501
2526
#define CHIP_ID_F81216 0x0802
2627
#define VENDOR_ID1 0x23
@@ -158,6 +159,7 @@ static int fintek_8250_check_id(struct fintek_8250 *pdata)
158159
case CHIP_ID_F81866:
159160
case CHIP_ID_F81966:
160161
case CHIP_ID_F81216AD:
162+
case CHIP_ID_F81216E:
161163
case CHIP_ID_F81216H:
162164
case CHIP_ID_F81216:
163165
break;
@@ -181,6 +183,7 @@ static int fintek_8250_get_ldn_range(struct fintek_8250 *pdata, int *min,
181183
return 0;
182184

183185
case CHIP_ID_F81216AD:
186+
case CHIP_ID_F81216E:
184187
case CHIP_ID_F81216H:
185188
case CHIP_ID_F81216:
186189
*min = F81216_LDN_LOW;
@@ -250,6 +253,7 @@ static void fintek_8250_set_irq_mode(struct fintek_8250 *pdata, bool is_level)
250253
break;
251254

252255
case CHIP_ID_F81216AD:
256+
case CHIP_ID_F81216E:
253257
case CHIP_ID_F81216H:
254258
case CHIP_ID_F81216:
255259
sio_write_mask_reg(pdata, FINTEK_IRQ_MODE, IRQ_SHARE,
@@ -263,7 +267,8 @@ static void fintek_8250_set_irq_mode(struct fintek_8250 *pdata, bool is_level)
263267
static void fintek_8250_set_max_fifo(struct fintek_8250 *pdata)
264268
{
265269
switch (pdata->pid) {
266-
case CHIP_ID_F81216H: /* 128Bytes FIFO */
270+
case CHIP_ID_F81216E: /* 128Bytes FIFO */
271+
case CHIP_ID_F81216H:
267272
case CHIP_ID_F81966:
268273
case CHIP_ID_F81866:
269274
sio_write_mask_reg(pdata, FIFO_CTRL,
@@ -297,6 +302,7 @@ static void fintek_8250_set_termios(struct uart_port *port,
297302
goto exit;
298303

299304
switch (pdata->pid) {
305+
case CHIP_ID_F81216E:
300306
case CHIP_ID_F81216H:
301307
reg = RS485;
302308
break;
@@ -346,6 +352,7 @@ static void fintek_8250_set_termios_handler(struct uart_8250_port *uart)
346352
struct fintek_8250 *pdata = uart->port.private_data;
347353

348354
switch (pdata->pid) {
355+
case CHIP_ID_F81216E:
349356
case CHIP_ID_F81216H:
350357
case CHIP_ID_F81966:
351358
case CHIP_ID_F81866:
@@ -438,6 +445,11 @@ static void fintek_8250_set_rs485_handler(struct uart_8250_port *uart)
438445
uart->port.rs485_supported = fintek_8250_rs485_supported;
439446
break;
440447

448+
case CHIP_ID_F81216E: /* F81216E does not support RS485 delays */
449+
uart->port.rs485_config = fintek_8250_rs485_config;
450+
uart->port.rs485_supported = fintek_8250_rs485_supported;
451+
break;
452+
441453
default: /* No RS485 Auto direction functional */
442454
break;
443455
}

0 commit comments

Comments
 (0)