upgrade to fedora-2.6.12-1.1398.FC4 + vserver 2.0.rc7
[linux-2.6.git] / drivers / serial / sunsu.c
index 9fe5922..ddc97c9 100644 (file)
@@ -989,7 +989,7 @@ static struct uart_sunsu_port sunsu_ports[UART_NR];
 
 #ifdef CONFIG_SERIO
 
-static spinlock_t sunsu_serio_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(sunsu_serio_lock);
 
 static int sunsu_serio_write(struct serio *serio, unsigned char ch)
 {
@@ -1285,16 +1285,23 @@ 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
 
        up->port.line = 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)
@@ -1312,12 +1319,13 @@ static int __init sunsu_kbd_ms_init(struct uart_sunsu_port *up, int channel)
 
                serio->port_data = up;
 
-               serio->type = SERIO_RS232;
+               serio->id.type = SERIO_RS232;
                if (up->su_type == SU_PORT_KBD) {
-                       serio->type |= SERIO_SUNKBD;
+                       serio->id.proto = SERIO_SUNKBD;
                        strlcpy(serio->name, "sukbd", sizeof(serio->name));
                } else {
-                       serio->type |= (SERIO_SUN | (1 << 16));
+                       serio->id.proto = SERIO_SUN;
+                       serio->id.extra = 1;
                        strlcpy(serio->name, "sums", sizeof(serio->name));
                }
                strlcpy(serio->phys, (channel == 0 ? "su/serio0" : "su/serio1"),
@@ -1334,6 +1342,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;
 }