]> Pileus Git - ~andy/linux/blobdiff - drivers/serial/sunsu.c
Merge head 'drm-via' of master.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6
[~andy/linux] / drivers / serial / sunsu.c
index 23d19d39432080cf72a1b9ecfee9ca8a7c5eda4e..d57a3553aea359ac7a3123ae62261f2ed9abbb0d 100644 (file)
@@ -572,13 +572,10 @@ static unsigned int sunsu_tx_empty(struct uart_port *port)
 static unsigned int sunsu_get_mctrl(struct uart_port *port)
 {
        struct uart_sunsu_port *up = (struct uart_sunsu_port *) port;
-       unsigned long flags;
        unsigned char status;
        unsigned int ret;
 
-       spin_lock_irqsave(&up->port.lock, flags);
        status = serial_in(up, UART_MSR);
-       spin_unlock_irqrestore(&up->port.lock, flags);
 
        ret = 0;
        if (status & UART_MSR_DCD)
@@ -1285,6 +1282,7 @@ static struct uart_driver sunsu_reg = {
 
 static int __init sunsu_kbd_ms_init(struct uart_sunsu_port *up, int channel)
 {
+       int quot, baud;
 #ifdef CONFIG_SERIO
        struct serio *serio;
 #endif
@@ -1293,10 +1291,14 @@ static int __init sunsu_kbd_ms_init(struct uart_sunsu_port *up, int channel)
        up->port.type = PORT_UNKNOWN;
        up->port.uartclk = (SU_BASE_BAUD * 16);
 
-       if (up->su_type == SU_PORT_KBD)
+       if (up->su_type == SU_PORT_KBD) {
                up->cflag = B1200 | CS8 | CLOCAL | CREAD;
-       else
+               baud = 1200;
+       } else {
                up->cflag = B4800 | CS8 | CLOCAL | CREAD;
+               baud = 4800;
+       }
+       quot = up->port.uartclk / (16 * baud);
 
        sunsu_autoconfig(up);
        if (up->port.type == PORT_UNKNOWN)
@@ -1337,6 +1339,8 @@ static int __init sunsu_kbd_ms_init(struct uart_sunsu_port *up, int channel)
        }
 #endif
 
+       sunsu_change_speed(&up->port, up->cflag, 0, quot);
+
        sunsu_startup(&up->port);
        return 0;
 }