diff options
Diffstat (limited to 'drivers/serial/8250.c')
-rw-r--r-- | drivers/serial/8250.c | 89 |
1 files changed, 7 insertions, 82 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 7e8fc7c1d4cc..30a0a3d10145 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -1001,7 +1001,7 @@ static inline void __stop_tx(struct uart_8250_port *p) | |||
1001 | } | 1001 | } |
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop) | 1004 | static void serial8250_stop_tx(struct uart_port *port) |
1005 | { | 1005 | { |
1006 | struct uart_8250_port *up = (struct uart_8250_port *)port; | 1006 | struct uart_8250_port *up = (struct uart_8250_port *)port; |
1007 | 1007 | ||
@@ -1018,7 +1018,7 @@ static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop) | |||
1018 | 1018 | ||
1019 | static void transmit_chars(struct uart_8250_port *up); | 1019 | static void transmit_chars(struct uart_8250_port *up); |
1020 | 1020 | ||
1021 | static void serial8250_start_tx(struct uart_port *port, unsigned int tty_start) | 1021 | static void serial8250_start_tx(struct uart_port *port) |
1022 | { | 1022 | { |
1023 | struct uart_8250_port *up = (struct uart_8250_port *)port; | 1023 | struct uart_8250_port *up = (struct uart_8250_port *)port; |
1024 | 1024 | ||
@@ -1158,7 +1158,11 @@ static _INLINE_ void transmit_chars(struct uart_8250_port *up) | |||
1158 | up->port.x_char = 0; | 1158 | up->port.x_char = 0; |
1159 | return; | 1159 | return; |
1160 | } | 1160 | } |
1161 | if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { | 1161 | if (uart_tx_stopped(&up->port)) { |
1162 | serial8250_stop_tx(&up->port); | ||
1163 | return; | ||
1164 | } | ||
1165 | if (uart_circ_empty(xmit)) { | ||
1162 | __stop_tx(up); | 1166 | __stop_tx(up); |
1163 | return; | 1167 | return; |
1164 | } | 1168 | } |
@@ -2586,82 +2590,3 @@ module_param_array(probe_rsa, ulong, &probe_rsa_count, 0444); | |||
2586 | MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA"); | 2590 | MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA"); |
2587 | #endif | 2591 | #endif |
2588 | MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR); | 2592 | MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR); |
2589 | |||
2590 | /** | ||
2591 | * register_serial - configure a 16x50 serial port at runtime | ||
2592 | * @req: request structure | ||
2593 | * | ||
2594 | * Configure the serial port specified by the request. If the | ||
2595 | * port exists and is in use an error is returned. If the port | ||
2596 | * is not currently in the table it is added. | ||
2597 | * | ||
2598 | * The port is then probed and if necessary the IRQ is autodetected | ||
2599 | * If this fails an error is returned. | ||
2600 | * | ||
2601 | * On success the port is ready to use and the line number is returned. | ||
2602 | * | ||
2603 | * Note: this function is deprecated - use serial8250_register_port | ||
2604 | * instead. | ||
2605 | */ | ||
2606 | int register_serial(struct serial_struct *req) | ||
2607 | { | ||
2608 | struct uart_port port; | ||
2609 | |||
2610 | port.iobase = req->port; | ||
2611 | port.membase = req->iomem_base; | ||
2612 | port.irq = req->irq; | ||
2613 | port.uartclk = req->baud_base * 16; | ||
2614 | port.fifosize = req->xmit_fifo_size; | ||
2615 | port.regshift = req->iomem_reg_shift; | ||
2616 | port.iotype = req->io_type; | ||
2617 | port.flags = req->flags | UPF_BOOT_AUTOCONF; | ||
2618 | port.mapbase = req->iomap_base; | ||
2619 | port.dev = NULL; | ||
2620 | |||
2621 | if (share_irqs) | ||
2622 | port.flags |= UPF_SHARE_IRQ; | ||
2623 | |||
2624 | if (HIGH_BITS_OFFSET) | ||
2625 | port.iobase |= (long) req->port_high << HIGH_BITS_OFFSET; | ||
2626 | |||
2627 | /* | ||
2628 | * If a clock rate wasn't specified by the low level driver, then | ||
2629 | * default to the standard clock rate. This should be 115200 (*16) | ||
2630 | * and should not depend on the architecture's BASE_BAUD definition. | ||
2631 | * However, since this API will be deprecated, it's probably a | ||
2632 | * better idea to convert the drivers to use the new API | ||
2633 | * (serial8250_register_port and serial8250_unregister_port). | ||
2634 | */ | ||
2635 | if (port.uartclk == 0) { | ||
2636 | printk(KERN_WARNING | ||
2637 | "Serial: registering port at [%08x,%08lx,%p] irq %d with zero baud_base\n", | ||
2638 | port.iobase, port.mapbase, port.membase, port.irq); | ||
2639 | printk(KERN_WARNING "Serial: see %s:%d for more information\n", | ||
2640 | __FILE__, __LINE__); | ||
2641 | dump_stack(); | ||
2642 | |||
2643 | /* | ||
2644 | * Fix it up for now, but this is only a temporary measure. | ||
2645 | */ | ||
2646 | port.uartclk = BASE_BAUD * 16; | ||
2647 | } | ||
2648 | |||
2649 | return serial8250_register_port(&port); | ||
2650 | } | ||
2651 | EXPORT_SYMBOL(register_serial); | ||
2652 | |||
2653 | /** | ||
2654 | * unregister_serial - remove a 16x50 serial port at runtime | ||
2655 | * @line: serial line number | ||
2656 | * | ||
2657 | * Remove one serial port. This may not be called from interrupt | ||
2658 | * context. We hand the port back to our local PM control. | ||
2659 | * | ||
2660 | * Note: this function is deprecated - use serial8250_unregister_port | ||
2661 | * instead. | ||
2662 | */ | ||
2663 | void unregister_serial(int line) | ||
2664 | { | ||
2665 | serial8250_unregister_port(line); | ||
2666 | } | ||
2667 | EXPORT_SYMBOL(unregister_serial); | ||