X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fserial%2Fvr41xx_siu.c;h=0573f3b5175e463f1675e4d4bdd5b0dceb17c47c;hb=a88487c79bfefb715030c5baa68fbedc1b8732e8;hp=85309acb75f634da4e3ef3b97590dc5d559ecb79;hpb=0d090b6819e3559dabb05773c4a6dacc4fa94d0e;p=linux-2.6-omap-h63xx.git diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c index 85309acb75f..0573f3b5175 100644 --- a/drivers/serial/vr41xx_siu.c +++ b/drivers/serial/vr41xx_siu.c @@ -1,7 +1,7 @@ /* * Driver for NEC VR4100 series Serial Interface Unit. * - * Copyright (C) 2004-2007 Yoichi Yuasa + * Copyright (C) 2004-2008 Yoichi Yuasa * * Based on drivers/serial/8250.c, by Russell King. * @@ -65,7 +65,9 @@ static struct uart_port siu_uart_ports[SIU_PORTS_MAX] = { }, }; +#ifdef CONFIG_SERIAL_VR41XX_CONSOLE static uint8_t lsr_break_flag[SIU_PORTS_MAX]; +#endif #define siu_read(port, offset) readb((port)->membase + (offset)) #define siu_write(port, offset, value) writeb((value), (port)->membase + (offset)) @@ -316,7 +318,7 @@ static inline void receive_chars(struct uart_port *port, uint8_t *status) char flag; int max_count = RX_MAX_COUNT; - tty = port->info->tty; + tty = port->info->port.tty; lsr = *status; do { @@ -782,7 +784,7 @@ static void siu_console_write(struct console *con, const char *s, unsigned count siu_write(port, UART_IER, ier); } -static int siu_console_setup(struct console *con, char *options) +static int __init siu_console_setup(struct console *con, char *options) { struct uart_port *port; int baud = 9600; @@ -800,7 +802,8 @@ static int siu_console_setup(struct console *con, char *options) port->membase = ioremap(port->mapbase, siu_port_size(port)); } - vr41xx_select_siu_interface(SIU_INTERFACE_RS232C); + if (port->type == PORT_VR41XX_SIU) + vr41xx_select_siu_interface(SIU_INTERFACE_RS232C); if (options != NULL) uart_parse_options(options, &baud, &parity, &bits, &flow); @@ -837,6 +840,19 @@ static int __devinit siu_console_init(void) console_initcall(siu_console_init); +void __init vr41xx_siu_early_setup(struct uart_port *port) +{ + if (port->type == PORT_UNKNOWN) + return; + + siu_uart_ports[port->line].line = port->line; + siu_uart_ports[port->line].type = port->type; + siu_uart_ports[port->line].uartclk = SIU_BAUD_BASE * 16; + siu_uart_ports[port->line].mapbase = port->mapbase; + siu_uart_ports[port->line].mapbase = port->mapbase; + siu_uart_ports[port->line].ops = &siu_uart_ops; +} + #define SERIAL_VR41XX_CONSOLE &siu_console #else #define SERIAL_VR41XX_CONSOLE NULL @@ -957,3 +973,6 @@ static void __exit vr41xx_siu_exit(void) module_init(vr41xx_siu_init); module_exit(vr41xx_siu_exit); + +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:SIU");