]> git.hungrycats.org Git - linux/commitdiff
[SERIAL] Move XR16C850 Tx/Rx trigger level setup to startup code
authorRussell King <rmk@flint.arm.linux.org.uk>
Sun, 29 Aug 2004 00:48:25 +0000 (01:48 +0100)
committerRussell King <rmk@flint.arm.linux.org.uk>
Sun, 29 Aug 2004 00:48:25 +0000 (01:48 +0100)
drivers/serial/8250.c

index bc8656d13826503fdb37d66c8cead4f1a9e09401..f7e17aa72391ce26838b9e526bc3db1ef46bdaf4 100644 (file)
@@ -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);
                }