From 42f70b953b78253a588041425799036182122f75 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 29 Aug 2004 01:48:25 +0100 Subject: [PATCH] [SERIAL] Move XR16C850 Tx/Rx trigger level setup to startup code --- drivers/serial/8250.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index bc8656d138265..f7e17aa72391c 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -1258,6 +1258,23 @@ static int serial8250_startup(struct uart_port *port) return -ENODEV; } + /* + * For a XR16C850, we need to set the trigger levels + */ + if (up->port.type == PORT_16850) { + unsigned char fctr; + + serial_outp(up, UART_LCR, 0xbf); + + fctr = serial_inp(up, UART_FCTR) & ~(UART_FCTR_RX|UART_FCTR_TX); + serial_outp(up, UART_FCTR, fctr | UART_FCTR_TRGD | UART_FCTR_RX); + serial_outp(up, UART_TRG, UART_TRG_96); + serial_outp(up, UART_FCTR, fctr | UART_FCTR_TRGD | UART_FCTR_TX); + serial_outp(up, UART_TRG, UART_TRG_96); + + serial_outp(up, UART_LCR, 0); + } + /* * If the "interrupt" for this port doesn't correspond with any * hardware interrupt, we use a timer-based system. The original @@ -1593,23 +1610,6 @@ serial8250_pm(struct uart_port *port, unsigned int state, */ serial_outp(up, UART_LCR, 0xBF); serial_outp(up, UART_EFR, 0); - /* - * For a XR16C850, we need to set the trigger levels - */ - if (up->port.type == PORT_16850) { - unsigned char fctr; - - fctr = serial_inp(up, UART_FCTR) & - ~(UART_FCTR_RX | UART_FCTR_TX); - serial_outp(up, UART_FCTR, fctr | - UART_FCTR_TRGD | - UART_FCTR_RX); - serial_outp(up, UART_TRG, UART_TRG_96); - serial_outp(up, UART_FCTR, fctr | - UART_FCTR_TRGD | - UART_FCTR_TX); - serial_outp(up, UART_TRG, UART_TRG_96); - } serial_outp(up, UART_LCR, 0); } -- 2.53.0