X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fserial%2Fserial_lh7a40x.c;h=aa521b8e0d4e3a06a3c0c53ca7929a72d0b96763;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=56f269b6bfb12c53fb323c66dcab126010888bee;hpb=f7f1b0f1e2fbadeab12d24236000e778aa9b1ead;p=linux-2.6.git diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c index 56f269b6b..aa521b8e0 100644 --- a/drivers/serial/serial_lh7a40x.c +++ b/drivers/serial/serial_lh7a40x.c @@ -112,13 +112,12 @@ struct uart_port_lh7a40x { unsigned int statusPrev; /* Most recently read modem status */ }; -static void lh7a40xuart_stop_tx (struct uart_port* port, unsigned int tty_stop) +static void lh7a40xuart_stop_tx (struct uart_port* port) { BIT_CLR (port, UART_R_INTEN, TxInt); } -static void lh7a40xuart_start_tx (struct uart_port* port, - unsigned int tty_start) +static void lh7a40xuart_start_tx (struct uart_port* port) { BIT_SET (port, UART_R_INTEN, TxInt); @@ -149,15 +148,6 @@ lh7a40xuart_rx_chars (struct uart_port* port) unsigned int data, flag;/* Received data and status */ while (!(UR (port, UART_R_STATUS) & nRxRdy) && --cbRxMax) { - if (tty->flip.count >= TTY_FLIPBUF_SIZE) { - if (tty->low_latency) - tty_flip_buffer_push(tty); - /* - * If this failed then we will throw away the - * bytes but must do so to clear interrupts - */ - } - data = UR (port, UART_R_DATA); flag = TTY_NORMAL; ++port->icount.rx; @@ -208,7 +198,7 @@ static void lh7a40xuart_tx_chars (struct uart_port* port) return; } if (uart_circ_empty (xmit) || uart_tx_stopped (port)) { - lh7a40xuart_stop_tx (port, 0); + lh7a40xuart_stop_tx (port); return; } @@ -230,7 +220,7 @@ static void lh7a40xuart_tx_chars (struct uart_port* port) uart_write_wakeup (port); if (uart_circ_empty (xmit)) - lh7a40xuart_stop_tx (port, 0); + lh7a40xuart_stop_tx (port); } static void lh7a40xuart_modem_status (struct uart_port* port) @@ -511,12 +501,12 @@ static struct uart_port_lh7a40x lh7a40x_ports[DEV_NR] = { .port = { .membase = (void*) io_p2v (UART1_PHYS), .mapbase = UART1_PHYS, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = IRQ_UART1INTR, .uartclk = 14745600/2, .fifosize = 16, .ops = &lh7a40x_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 0, }, }, @@ -524,12 +514,12 @@ static struct uart_port_lh7a40x lh7a40x_ports[DEV_NR] = { .port = { .membase = (void*) io_p2v (UART2_PHYS), .mapbase = UART2_PHYS, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = IRQ_UART2INTR, .uartclk = 14745600/2, .fifosize = 16, .ops = &lh7a40x_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 1, }, }, @@ -537,12 +527,12 @@ static struct uart_port_lh7a40x lh7a40x_ports[DEV_NR] = { .port = { .membase = (void*) io_p2v (UART3_PHYS), .mapbase = UART3_PHYS, - .iotype = SERIAL_IO_MEM, + .iotype = UPIO_MEM, .irq = IRQ_UART3INTR, .uartclk = 14745600/2, .fifosize = 16, .ops = &lh7a40x_uart_ops, - .flags = ASYNC_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF, .line = 2, }, }, @@ -553,6 +543,12 @@ static struct uart_port_lh7a40x lh7a40x_ports[DEV_NR] = { #else # define LH7A40X_CONSOLE &lh7a40x_console +static void lh7a40xuart_console_putchar(struct uart_port *port, int ch) +{ + while (UR(port, UART_R_STATUS) & nTxRdy) + ; + UR(port, UART_R_DATA) = ch; +} static void lh7a40xuart_console_write (struct console* co, const char* s, @@ -566,16 +562,7 @@ static void lh7a40xuart_console_write (struct console* co, UR (port, UART_R_INTEN) = 0; /* Disable all interrupts */ BIT_SET (port, UART_R_CON, UARTEN | SIRDIS); /* Enable UART */ - for (; count-- > 0; ++s) { - while (UR (port, UART_R_STATUS) & nTxRdy) - ; - UR (port, UART_R_DATA) = *s; - if (*s == '\n') { - while ((UR (port, UART_R_STATUS) & TxBusy)) - ; - UR (port, UART_R_DATA) = '\r'; - } - } + uart_console_write(port, s, count, lh7a40xuart_console_putchar); /* Wait until all characters are sent */ while (UR (port, UART_R_STATUS) & TxBusy) @@ -633,7 +620,7 @@ static int __init lh7a40xuart_console_setup (struct console* co, char* options) return uart_set_options (port, co, baud, parity, bits, flow); } -extern struct uart_driver lh7a40x_reg; +static struct uart_driver lh7a40x_reg; static struct console lh7a40x_console = { .name = "ttyAM", .write = lh7a40xuart_console_write,