linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / serial / sa1100.c
index db3486d..2c00b86 100644 (file)
@@ -24,6 +24,7 @@
  *  $Id: sa1100.c,v 1.50 2002/07/29 14:41:04 rmk Exp $
  *
  */
+#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_SA1100_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -688,14 +689,6 @@ void __init sa1100_register_uart(int idx, int port)
 
 
 #ifdef CONFIG_SERIAL_SA1100_CONSOLE
-static void sa1100_console_putchar(struct uart_port *port, int ch)
-{
-       struct sa1100_port *sport = (struct sa1100_port *)port;
-
-       while (!(UART_GET_UTSR1(sport) & UTSR1_TNF))
-               barrier();
-       UART_PUT_CHAR(sport, ch);
-}
 
 /*
  * Interrupts are disabled on entering
@@ -704,7 +697,7 @@ static void
 sa1100_console_write(struct console *co, const char *s, unsigned int count)
 {
        struct sa1100_port *sport = &sa1100_ports[co->index];
-       unsigned int old_utcr3, status;
+       unsigned int old_utcr3, status, i;
 
        /*
         *      First, save UTCR3 and then disable interrupts
@@ -713,7 +706,21 @@ sa1100_console_write(struct console *co, const char *s, unsigned int count)
        UART_PUT_UTCR3(sport, (old_utcr3 & ~(UTCR3_RIE | UTCR3_TIE)) |
                                UTCR3_TXE);
 
-       uart_console_write(&sport->port, s, count, sa1100_console_putchar);
+       /*
+        *      Now, do each character
+        */
+       for (i = 0; i < count; i++) {
+               do {
+                       status = UART_GET_UTSR1(sport);
+               } while (!(status & UTSR1_TNF));
+               UART_PUT_CHAR(sport, s[i]);
+               if (s[i] == '\n') {
+                       do {
+                               status = UART_GET_UTSR1(sport);
+                       } while (!(status & UTSR1_TNF));
+                       UART_PUT_CHAR(sport, '\r');
+               }
+       }
 
        /*
         *      Finally, wait for transmitter to become empty
@@ -815,6 +822,7 @@ static struct uart_driver sa1100_reg = {
        .owner                  = THIS_MODULE,
        .driver_name            = "ttySA",
        .dev_name               = "ttySA",
+       .devfs_name             = "ttySA",
        .major                  = SERIAL_SA1100_MAJOR,
        .minor                  = MINOR_START,
        .nr                     = NR_PORTS,