diff options
Diffstat (limited to 'drivers/serial')
45 files changed, 322 insertions, 443 deletions
diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c index 0b10169961e..aec39fb261c 100644 --- a/drivers/serial/21285.c +++ b/drivers/serial/21285.c @@ -58,8 +58,7 @@ static const char serial21285_name[] = "Footbridge UART"; * int((BAUD_BASE - (baud >> 1)) / baud) */ -static void -serial21285_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void serial21285_stop_tx(struct uart_port *port) { if (tx_enabled(port)) { disable_irq(IRQ_CONTX); @@ -67,8 +66,7 @@ serial21285_stop_tx(struct uart_port *port, unsigned int tty_stop) } } -static void -serial21285_start_tx(struct uart_port *port, unsigned int tty_start) +static void serial21285_start_tx(struct uart_port *port) { if (!tx_enabled(port)) { enable_irq(IRQ_CONTX); @@ -148,7 +146,7 @@ static irqreturn_t serial21285_tx_chars(int irq, void *dev_id, struct pt_regs *r goto out; } if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { - serial21285_stop_tx(port, 0); + serial21285_stop_tx(port); goto out; } @@ -164,7 +162,7 @@ static irqreturn_t serial21285_tx_chars(int irq, void *dev_id, struct pt_regs *r uart_write_wakeup(port); if (uart_circ_empty(xmit)) - serial21285_stop_tx(port, 0); + serial21285_stop_tx(port); out: return IRQ_HANDLED; diff --git a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c index 9097f2f7b12..2efb317153c 100644 --- a/drivers/serial/68328serial.c +++ b/drivers/serial/68328serial.c @@ -40,7 +40,6 @@ #include <asm/io.h> #include <asm/irq.h> #include <asm/system.h> -#include <asm/segment.h> #include <asm/delay.h> #include <asm/uaccess.h> diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c index b116122e569..170c9d2a749 100644 --- a/drivers/serial/68360serial.c +++ b/drivers/serial/68360serial.c @@ -2474,8 +2474,7 @@ static struct tty_operations rs_360_ops = { .tiocmset = rs_360_tiocmset, }; -/* int __init rs_360_init(void) */ -int rs_360_init(void) +static int __init rs_360_init(void) { struct serial_state * state; ser_info_t *info; @@ -2827,10 +2826,7 @@ int rs_360_init(void) return 0; } - - - - +module_init(rs_360_init); /* This must always be called before the rs_360_init() function, otherwise * it blows away the port control information. diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 7e8fc7c1d4c..4d75cdfa0a0 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -864,7 +864,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags) /* * We're pretty sure there's a port here. Lets find out what * type of port it is. The IIR top two bits allows us to find - * out if its 8250 or 16450, 16550, 16550A or later. This + * out if it's 8250 or 16450, 16550, 16550A or later. This * determines what we test for next. * * We also initialise the EFR (if any) to zero for later. The @@ -1001,7 +1001,7 @@ static inline void __stop_tx(struct uart_8250_port *p) } } -static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void serial8250_stop_tx(struct uart_port *port) { struct uart_8250_port *up = (struct uart_8250_port *)port; @@ -1018,7 +1018,7 @@ static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop) static void transmit_chars(struct uart_8250_port *up); -static void serial8250_start_tx(struct uart_port *port, unsigned int tty_start) +static void serial8250_start_tx(struct uart_port *port) { struct uart_8250_port *up = (struct uart_8250_port *)port; @@ -1158,7 +1158,11 @@ static _INLINE_ void transmit_chars(struct uart_8250_port *up) up->port.x_char = 0; return; } - if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { + if (uart_tx_stopped(&up->port)) { + serial8250_stop_tx(&up->port); + return; + } + if (uart_circ_empty(xmit)) { __stop_tx(up); return; } @@ -2532,7 +2536,7 @@ static int __init serial8250_init(void) goto out; serial8250_isa_devs = platform_device_register_simple("serial8250", - -1, NULL, 0); + PLAT8250_DEV_LEGACY, NULL, 0); if (IS_ERR(serial8250_isa_devs)) { ret = PTR_ERR(serial8250_isa_devs); goto unreg; @@ -2586,82 +2590,3 @@ module_param_array(probe_rsa, ulong, &probe_rsa_count, 0444); MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA"); #endif MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR); - -/** - * register_serial - configure a 16x50 serial port at runtime - * @req: request structure - * - * Configure the serial port specified by the request. If the - * port exists and is in use an error is returned. If the port - * is not currently in the table it is added. - * - * The port is then probed and if necessary the IRQ is autodetected - * If this fails an error is returned. - * - * On success the port is ready to use and the line number is returned. - * - * Note: this function is deprecated - use serial8250_register_port - * instead. - */ -int register_serial(struct serial_struct *req) -{ - struct uart_port port; - - port.iobase = req->port; - port.membase = req->iomem_base; - port.irq = req->irq; - port.uartclk = req->baud_base * 16; - port.fifosize = req->xmit_fifo_size; - port.regshift = req->iomem_reg_shift; - port.iotype = req->io_type; - port.flags = req->flags | UPF_BOOT_AUTOCONF; - port.mapbase = req->iomap_base; - port.dev = NULL; - - if (share_irqs) - port.flags |= UPF_SHARE_IRQ; - - if (HIGH_BITS_OFFSET) - port.iobase |= (long) req->port_high << HIGH_BITS_OFFSET; - - /* - * If a clock rate wasn't specified by the low level driver, then - * default to the standard clock rate. This should be 115200 (*16) - * and should not depend on the architecture's BASE_BAUD definition. - * However, since this API will be deprecated, it's probably a - * better idea to convert the drivers to use the new API - * (serial8250_register_port and serial8250_unregister_port). - */ - if (port.uartclk == 0) { - printk(KERN_WARNING - "Serial: registering port at [%08x,%08lx,%p] irq %d with zero baud_base\n", - port.iobase, port.mapbase, port.membase, port.irq); - printk(KERN_WARNING "Serial: see %s:%d for more information\n", - __FILE__, __LINE__); - dump_stack(); - - /* - * Fix it up for now, but this is only a temporary measure. - */ - port.uartclk = BASE_BAUD * 16; - } - - return serial8250_register_port(&port); -} -EXPORT_SYMBOL(register_serial); - -/** - * unregister_serial - remove a 16x50 serial port at runtime - * @line: serial line number - * - * Remove one serial port. This may not be called from interrupt - * context. We hand the port back to our local PM control. - * - * Note: this function is deprecated - use serial8250_unregister_port - * instead. - */ -void unregister_serial(int line) -{ - serial8250_unregister_port(line); -} -EXPORT_SYMBOL(unregister_serial); diff --git a/drivers/serial/8250.h b/drivers/serial/8250.h index 9225c82faeb..b1b459efda5 100644 --- a/drivers/serial/8250.h +++ b/drivers/serial/8250.h @@ -16,11 +16,7 @@ */ #include <linux/config.h> - -int serial8250_register_port(struct uart_port *); -void serial8250_unregister_port(int line); -void serial8250_suspend_port(int line); -void serial8250_resume_port(int line); +#include <linux/serial_8250.h> struct old_serial_port { unsigned int uart; diff --git a/drivers/serial/8250_accent.c b/drivers/serial/8250_accent.c index 1f2c276063e..9c10262f246 100644 --- a/drivers/serial/8250_accent.c +++ b/drivers/serial/8250_accent.c @@ -29,7 +29,7 @@ static struct plat_serial8250_port accent_data[] = { static struct platform_device accent_device = { .name = "serial8250", - .id = 2, + .id = PLAT8250_DEV_ACCENT, .dev = { .platform_data = accent_data, }, diff --git a/drivers/serial/8250_acpi.c b/drivers/serial/8250_acpi.c index 6b9ead28851..a802bdce6e5 100644 --- a/drivers/serial/8250_acpi.c +++ b/drivers/serial/8250_acpi.c @@ -47,18 +47,30 @@ static acpi_status acpi_serial_port(struct uart_port *port, static acpi_status acpi_serial_ext_irq(struct uart_port *port, struct acpi_resource_ext_irq *ext_irq) { - if (ext_irq->number_of_interrupts > 0) - port->irq = acpi_register_gsi(ext_irq->interrupts[0], + int rc; + + if (ext_irq->number_of_interrupts > 0) { + rc = acpi_register_gsi(ext_irq->interrupts[0], ext_irq->edge_level, ext_irq->active_high_low); + if (rc < 0) + return AE_ERROR; + port->irq = rc; + } return AE_OK; } static acpi_status acpi_serial_irq(struct uart_port *port, struct acpi_resource_irq *irq) { - if (irq->number_of_interrupts > 0) - port->irq = acpi_register_gsi(irq->interrupts[0], + int rc; + + if (irq->number_of_interrupts > 0) { + rc = acpi_register_gsi(irq->interrupts[0], irq->edge_level, irq->active_high_low); + if (rc < 0) + return AE_ERROR; + port->irq = rc; + } return AE_OK; } diff --git a/drivers/serial/8250_boca.c b/drivers/serial/8250_boca.c index 465c9ea1e7a..3bfe0f7b26f 100644 --- a/drivers/serial/8250_boca.c +++ b/drivers/serial/8250_boca.c @@ -43,7 +43,7 @@ static struct plat_serial8250_port boca_data[] = { static struct platform_device boca_device = { .name = "serial8250", - .id = 3, + .id = PLAT8250_DEV_BOCA, .dev = { .platform_data = boca_data, }, diff --git a/drivers/serial/8250_fourport.c b/drivers/serial/8250_fourport.c index e9b4d908ef4..6375d68b791 100644 --- a/drivers/serial/8250_fourport.c +++ b/drivers/serial/8250_fourport.c @@ -35,7 +35,7 @@ static struct plat_serial8250_port fourport_data[] = { static struct platform_device fourport_device = { .name = "serial8250", - .id = 1, + .id = PLAT8250_DEV_FOURPORT, .dev = { .platform_data = fourport_data, }, diff --git a/drivers/serial/8250_hub6.c b/drivers/serial/8250_hub6.c index 77f396f84b4..daf569cd3c8 100644 --- a/drivers/serial/8250_hub6.c +++ b/drivers/serial/8250_hub6.c @@ -40,7 +40,7 @@ static struct plat_serial8250_port hub6_data[] = { static struct platform_device hub6_device = { .name = "serial8250", - .id = 4, + .id = PLAT8250_DEV_HUB6, .dev = { .platform_data = hub6_data, }, diff --git a/drivers/serial/8250_mca.c b/drivers/serial/8250_mca.c index f0c40d68b8c..ac205256d5f 100644 --- a/drivers/serial/8250_mca.c +++ b/drivers/serial/8250_mca.c @@ -44,7 +44,7 @@ static struct plat_serial8250_port mca_data[] = { static struct platform_device mca_device = { .name = "serial8250", - .id = 5, + .id = PLAT8250_DEV_MCA, .dev = { .platform_data = mca_data, }, diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index d5797618a3b..b745a1b9e83 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -80,7 +80,7 @@ config SERIAL_8250_CS config SERIAL_8250_ACPI bool "8250/16550 device discovery via ACPI namespace" default y if IA64 - depends on ACPI_BUS && SERIAL_8250 + depends on ACPI && SERIAL_8250 ---help--- If you wish to enable serial port discovery via the ACPI namespace, say Y here. If unsure, say N. @@ -308,7 +308,7 @@ config SERIAL_S3C2410_CONSOLE config SERIAL_DZ bool "DECstation DZ serial driver" - depends on MACH_DECSTATION && MIPS32 + depends on MACH_DECSTATION && 32BIT select SERIAL_CORE help DZ11-family serial controllers for VAXstations, including the @@ -830,7 +830,7 @@ config SERIAL_M32R_PLDSIO config SERIAL_TXX9 bool "TMPTX39XX/49XX SIO support" - depends HAS_TXX9_SERIAL + depends HAS_TXX9_SERIAL && BROKEN select SERIAL_CORE default y diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c index 2884b310e54..978e12437e6 100644 --- a/drivers/serial/amba-pl010.c +++ b/drivers/serial/amba-pl010.c @@ -105,7 +105,7 @@ struct uart_amba_port { unsigned int old_status; }; -static void pl010_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void pl010_stop_tx(struct uart_port *port) { unsigned int cr; @@ -114,7 +114,7 @@ static void pl010_stop_tx(struct uart_port *port, unsigned int tty_stop) UART_PUT_CR(port, cr); } -static void pl010_start_tx(struct uart_port *port, unsigned int tty_start) +static void pl010_start_tx(struct uart_port *port) { unsigned int cr; @@ -219,7 +219,7 @@ static void pl010_tx_chars(struct uart_port *port) return; } if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { - pl010_stop_tx(port, 0); + pl010_stop_tx(port); return; } @@ -236,7 +236,7 @@ static void pl010_tx_chars(struct uart_port *port) uart_write_wakeup(port); if (uart_circ_empty(xmit)) - pl010_stop_tx(port, 0); + pl010_stop_tx(port); } static void pl010_modem_status(struct uart_port *port) diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 7db88ee18f7..56071309744 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c @@ -74,7 +74,7 @@ struct uart_amba_port { unsigned int old_status; }; -static void pl011_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void pl011_stop_tx(struct uart_port *port) { struct uart_amba_port *uap = (struct uart_amba_port *)port; @@ -82,7 +82,7 @@ static void pl011_stop_tx(struct uart_port *port, unsigned int tty_stop) writew(uap->im, uap->port.membase + UART011_IMSC); } -static void pl011_start_tx(struct uart_port *port, unsigned int tty_start) +static void pl011_start_tx(struct uart_port *port) { struct uart_amba_port *uap = (struct uart_amba_port *)port; @@ -184,7 +184,7 @@ static void pl011_tx_chars(struct uart_amba_port *uap) return; } if (uart_circ_empty(xmit) || uart_tx_stopped(&uap->port)) { - pl011_stop_tx(&uap->port, 0); + pl011_stop_tx(&uap->port); return; } @@ -201,7 +201,7 @@ static void pl011_tx_chars(struct uart_amba_port *uap) uart_write_wakeup(&uap->port); if (uart_circ_empty(xmit)) - pl011_stop_tx(&uap->port, 0); + pl011_stop_tx(&uap->port); } static void pl011_modem_status(struct uart_amba_port *uap) diff --git a/drivers/serial/au1x00_uart.c b/drivers/serial/au1x00_uart.c index 6104aeef124..a274ebf256a 100644 --- a/drivers/serial/au1x00_uart.c +++ b/drivers/serial/au1x00_uart.c @@ -200,7 +200,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags) DEBUG_AUTOCONF("type=%s\n", uart_config[up->port.type].name); } -static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void serial8250_stop_tx(struct uart_port *port) { struct uart_8250_port *up = (struct uart_8250_port *)port; @@ -210,7 +210,7 @@ static void serial8250_stop_tx(struct uart_port *port, unsigned int tty_stop) } } -static void serial8250_start_tx(struct uart_port *port, unsigned int tty_start) +static void serial8250_start_tx(struct uart_port *port) { struct uart_8250_port *up = (struct uart_8250_port *)port; @@ -337,7 +337,7 @@ static _INLINE_ void transmit_chars(struct uart_8250_port *up) return; } if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { - serial8250_stop_tx(&up->port, 0); + serial8250_stop_tx(&up->port); return; } @@ -356,7 +356,7 @@ static _INLINE_ void transmit_chars(struct uart_8250_port *up) DEBUG_INTR("THRE..."); if (uart_circ_empty(xmit)) - serial8250_stop_tx(&up->port, 0); + serial8250_stop_tx(&up->port); } static _INLINE_ void check_modem_status(struct uart_8250_port *up) diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c index e92522b33c4..d822896b488 100644 --- a/drivers/serial/clps711x.c +++ b/drivers/serial/clps711x.c @@ -69,8 +69,7 @@ #define tx_enabled(port) ((port)->unused[0]) -static void -clps711xuart_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void clps711xuart_stop_tx(struct uart_port *port) { if (tx_enabled(port)) { disable_irq(TX_IRQ(port)); @@ -78,8 +77,7 @@ clps711xuart_stop_tx(struct uart_port *port, unsigned int tty_stop) } } -static void -clps711xuart_start_tx(struct uart_port *port, unsigned int tty_start) +static void clps711xuart_start_tx(struct uart_port *port) { if (!tx_enabled(port)) { enable_irq(TX_IRQ(port)); @@ -165,7 +163,7 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *re return IRQ_HANDLED; } if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { - clps711xuart_stop_tx(port, 0); + clps711xuart_stop_tx(port); return IRQ_HANDLED; } @@ -182,7 +180,7 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *re uart_write_wakeup(port); if (uart_circ_empty(xmit)) - clps711xuart_stop_tx(port, 0); + clps711xuart_stop_tx(port); return IRQ_HANDLED; } diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index d639ac92a11..25825f2aba2 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c @@ -124,7 +124,7 @@ static unsigned int cpm_uart_get_mctrl(struct uart_port *port) /* * Stop transmitter */ -static void cpm_uart_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void cpm_uart_stop_tx(struct uart_port *port) { struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; volatile smc_t *smcp = pinfo->smcp; @@ -141,7 +141,7 @@ static void cpm_uart_stop_tx(struct uart_port *port, unsigned int tty_stop) /* * Start transmitter */ -static void cpm_uart_start_tx(struct uart_port *port, unsigned int tty_start) +static void cpm_uart_start_tx(struct uart_port *port) { struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; volatile smc_t *smcp = pinfo->smcp; @@ -403,10 +403,8 @@ static int cpm_uart_startup(struct uart_port *port) inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo) { - unsigned long target_jiffies = jiffies + pinfo->wait_closing; - - while (!time_after(jiffies, target_jiffies)) - schedule(); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(pinfo->wait_closing); } /* @@ -425,9 +423,12 @@ static void cpm_uart_shutdown(struct uart_port *port) /* If the port is not the console, disable Rx and Tx. */ if (!(pinfo->flags & FLAG_CONSOLE)) { /* Wait for all the BDs marked sent */ - while(!cpm_uart_tx_empty(port)) + while(!cpm_uart_tx_empty(port)) { + set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(2); - if(pinfo->wait_closing) + } + + if (pinfo->wait_closing) cpm_uart_wait_until_send(pinfo); /* Stop uarts */ @@ -623,7 +624,7 @@ static int cpm_uart_tx_pump(struct uart_port *port) } if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { - cpm_uart_stop_tx(port, 0); + cpm_uart_stop_tx(port); return 0; } @@ -656,7 +657,7 @@ static int cpm_uart_tx_pump(struct uart_port *port) uart_write_wakeup(port); if (uart_circ_empty(xmit)) { - cpm_uart_stop_tx(port, 0); + cpm_uart_stop_tx(port); return 0; } diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c index c4c8f4b44f5..15ad58d9488 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c @@ -142,6 +142,14 @@ void scc2_lineif(struct uart_cpm_port *pinfo) * be supported in a sane fashion. */ #ifndef CONFIG_STX_GP3 +#ifdef CONFIG_MPC8560_ADS + volatile iop_cpm2_t *io = &cpm2_immr->im_ioport; + io->iop_ppard |= 0x00000018; + io->iop_psord &= ~0x00000008; /* Rx */ + io->iop_psord &= ~0x00000010; /* Tx */ + io->iop_pdird &= ~0x00000008; /* Rx */ + io->iop_pdird |= 0x00000010; /* Tx */ +#else volatile iop_cpm2_t *io = &cpm2_immr->im_ioport; io->iop_pparb |= 0x008b0000; io->iop_pdirb |= 0x00880000; @@ -149,6 +157,7 @@ void scc2_lineif(struct uart_cpm_port *pinfo) io->iop_pdirb &= ~0x00030000; io->iop_psorb &= ~0x00030000; #endif +#endif cpm2_immr->im_cpmux.cmx_scr &= 0xff00ffff; cpm2_immr->im_cpmux.cmx_scr |= 0x00090000; pinfo->brg = 2; @@ -257,6 +266,7 @@ int cpm_uart_init_portdesc(void) cpm_uart_ports[UART_SMC1].smcp = (smc_t *) & cpm2_immr->im_smc[0]; cpm_uart_ports[UART_SMC1].smcup = (smc_uart_t *) & cpm2_immr->im_dprambase[PROFF_SMC1]; + *(u16 *)(&cpm2_immr->im_dprambase[PROFF_SMC1_BASE]) = PROFF_SMC1; cpm_uart_ports[UART_SMC1].port.mapbase = (unsigned long)&cpm2_immr->im_smc[0]; cpm_uart_ports[UART_SMC1].smcp->smc_smcm |= (SMCM_RX | SMCM_TX); @@ -269,6 +279,7 @@ int cpm_uart_init_portdesc(void) cpm_uart_ports[UART_SMC2].smcp = (smc_t *) & cpm2_immr->im_smc[1]; cpm_uart_ports[UART_SMC2].smcup = (smc_uart_t *) & cpm2_immr->im_dprambase[PROFF_SMC2]; + *(u16 *)(&cpm2_immr->im_dprambase[PROFF_SMC2_BASE]) = PROFF_SMC2; cpm_uart_ports[UART_SMC2].port.mapbase = (unsigned long)&cpm2_immr->im_smc[1]; cpm_uart_ports[UART_SMC2].smcp->smc_smcm |= (SMCM_RX | SMCM_TX); diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c index 23b8871e74c..40d3e7139cf 100644 --- a/drivers/serial/crisv10.c +++ b/drivers/serial/crisv10.c @@ -446,7 +446,6 @@ static char *serial_version = "$Revision: 1.25 $"; #include <asm/io.h> #include <asm/irq.h> #include <asm/system.h> -#include <asm/segment.h> #include <asm/bitops.h> #include <linux/delay.h> @@ -5041,17 +5040,3 @@ rs_init(void) /* this makes sure that rs_init is called during kernel boot */ module_init(rs_init); - -/* - * register_serial and unregister_serial allows for serial ports to be - * configured at run-time, to support PCMCIA modems. - */ -int -register_serial(struct serial_struct *req) -{ - return -1; -} - -void unregister_serial(int line) -{ -} diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c index 97824eeeafa..e63b9dffc8d 100644 --- a/drivers/serial/dz.c +++ b/drivers/serial/dz.c @@ -112,7 +112,7 @@ static inline void dz_out(struct dz_port *dport, unsigned offset, * ------------------------------------------------------------ */ -static void dz_stop_tx(struct uart_port *uport, unsigned int tty_stop) +static void dz_stop_tx(struct uart_port *uport) { struct dz_port *dport = (struct dz_port *)uport; unsigned short tmp, mask = 1 << dport->port.line; @@ -125,7 +125,7 @@ static void dz_stop_tx(struct uart_port *uport, unsigned int tty_stop) spin_unlock_irqrestore(&dport->port.lock, flags); } -static void dz_start_tx(struct uart_port *uport, unsigned int tty_start) +static void dz_start_tx(struct uart_port *uport) { struct dz_port *dport = (struct dz_port *)uport; unsigned short tmp, mask = 1 << dport->port.line; @@ -290,7 +290,7 @@ static inline void dz_transmit_chars(struct dz_port *dport) } /* if nothing to do or stopped or hardware stopped */ if (uart_circ_empty(xmit) || uart_tx_stopped(&dport->port)) { - dz_stop_tx(&dport->port, 0); + dz_stop_tx(&dport->port); return; } @@ -308,7 +308,7 @@ static inline void dz_transmit_chars(struct dz_port *dport) /* Are we done */ if (uart_circ_empty(xmit)) - dz_stop_tx(&dport->port, 0); + dz_stop_tx(&dport->port); } /* @@ -440,7 +440,7 @@ static int dz_startup(struct uart_port *uport) */ static void dz_shutdown(struct uart_port *uport) { - dz_stop_tx(uport, 0); + dz_stop_tx(uport); } /* diff --git a/drivers/serial/icom.c b/drivers/serial/icom.c index c112b32764e..eb31125c6a3 100644 --- a/drivers/serial/icom.c +++ b/drivers/serial/icom.c @@ -56,7 +56,6 @@ #include <linux/bitops.h> #include <asm/system.h> -#include <asm/segment.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/uaccess.h> @@ -989,18 +988,16 @@ static unsigned int icom_get_mctrl(struct uart_port *port) return result; } -static void icom_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void icom_stop_tx(struct uart_port *port) { unsigned char cmdReg; - if (tty_stop) { - trace(ICOM_PORT, "STOP", 0); - cmdReg = readb(&ICOM_PORT->dram->CmdReg); - writeb(cmdReg | CMD_HOLD_XMIT, &ICOM_PORT->dram->CmdReg); - } + trace(ICOM_PORT, "STOP", 0); + cmdReg = readb(&ICOM_PORT->dram->CmdReg); + writeb(cmdReg | CMD_HOLD_XMIT, &ICOM_PORT->dram->CmdReg); } -static void icom_start_tx(struct uart_port *port, unsigned int tty_start) +static void icom_start_tx(struct uart_port *port) { unsigned char cmdReg; diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index 01a8726a3f9..4c985e6b378 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c @@ -124,7 +124,7 @@ static void imx_timeout(unsigned long data) /* * interrupts disabled on entry */ -static void imx_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void imx_stop_tx(struct uart_port *port) { struct imx_port *sport = (struct imx_port *)port; UCR1((u32)sport->port.membase) &= ~UCR1_TXMPTYEN; @@ -165,13 +165,13 @@ static inline void imx_transmit_buffer(struct imx_port *sport) } while (!(UTS((u32)sport->port.membase) & UTS_TXFULL)); if (uart_circ_empty(xmit)) - imx_stop_tx(&sport->port, 0); + imx_stop_tx(&sport->port); } /* * interrupts disabled on entry */ -static void imx_start_tx(struct uart_port *port, unsigned int tty_start) +static void imx_start_tx(struct uart_port *port) { struct imx_port *sport = (struct imx_port *)port; @@ -196,7 +196,7 @@ static irqreturn_t imx_txint(int irq, void *dev_id, struct pt_regs *regs) } if (uart_circ_empty(xmit) || uart_tx_stopped(&sport->port)) { - imx_stop_tx(&sport->port, 0); + imx_stop_tx(&sport->port); goto out; } @@ -291,13 +291,31 @@ static unsigned int imx_tx_empty(struct uart_port *port) return USR2((u32)sport->port.membase) & USR2_TXDC ? TIOCSER_TEMT : 0; } +/* + * We have a modem side uart, so the meanings of RTS and CTS are inverted. + */ static unsigned int imx_get_mctrl(struct uart_port *port) { - return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; + struct imx_port *sport = (struct imx_port *)port; + unsigned int tmp = TIOCM_DSR | TIOCM_CAR; + + if (USR1((u32)sport->port.membase) & USR1_RTSS) + tmp |= TIOCM_CTS; + + if (UCR2((u32)sport->port.membase) & UCR2_CTS) + tmp |= TIOCM_RTS; + + return tmp; } static void imx_set_mctrl(struct uart_port *port, unsigned int mctrl) { + struct imx_port *sport = (struct imx_port *)port; + + if (mctrl & TIOCM_RTS) + UCR2((u32)sport->port.membase) |= UCR2_CTS; + else + UCR2((u32)sport->port.membase) &= ~UCR2_CTS; } /* diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c index 793c3a7cbe4..0c5c96a582b 100644 --- a/drivers/serial/ioc4_serial.c +++ b/drivers/serial/ioc4_serial.c @@ -2373,10 +2373,9 @@ static unsigned int ic4_tx_empty(struct uart_port *the_port) /** * ic4_stop_tx - stop the transmitter * @port: Port to operate on - * @tty_stop: Set to 1 if called via uart_stop * */ -static void ic4_stop_tx(struct uart_port *the_port, unsigned int tty_stop) +static void ic4_stop_tx(struct uart_port *the_port) { } @@ -2471,10 +2470,9 @@ static unsigned int ic4_get_mctrl(struct uart_port *the_port) /** * ic4_start_tx - Start transmitter, flush any output * @port: Port to operate on - * @tty_stop: Set to 1 if called via uart_start * */ -static void ic4_start_tx(struct uart_port *the_port, unsigned int tty_stop) +static void ic4_start_tx(struct uart_port *the_port) { struct ioc4_port *port = get_ioc4_port(the_port); unsigned long flags; diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c index ea5bf4d4daa..ef132349f31 100644 --- a/drivers/serial/ip22zilog.c +++ b/drivers/serial/ip22zilog.c @@ -592,7 +592,7 @@ static void ip22zilog_set_mctrl(struct uart_port *port, unsigned int mctrl) } /* The port lock is held and interrupts are disabled. */ -static void ip22zilog_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void ip22zilog_stop_tx(struct uart_port *port) { struct uart_ip22zilog_port *up = (struct uart_ip22zilog_port *) port; @@ -600,7 +600,7 @@ static void ip22zilog_stop_tx(struct uart_port *port, unsigned int tty_stop) } /* The port lock is held and interrupts are disabled. */ -static void ip22zilog_start_tx(struct uart_port *port, unsigned int tty_start) +static void ip22zilog_start_tx(struct uart_port *port) { struct uart_ip22zilog_port *up = (struct uart_ip22zilog_port *) port; struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port); diff --git a/drivers/serial/jsm/jsm_tty.c b/drivers/serial/jsm/jsm_tty.c index 98de2258fd0..6fa0d62d6f6 100644 --- a/drivers/serial/jsm/jsm_tty.c +++ b/drivers/serial/jsm/jsm_tty.c @@ -113,7 +113,7 @@ static void jsm_tty_set_mctrl(struct uart_port *port, unsigned int mctrl) udelay(10); } -static void jsm_tty_start_tx(struct uart_port *port, unsigned int tty_start) +static void jsm_tty_start_tx(struct uart_port *port) { struct jsm_channel *channel = (struct jsm_channel *)port; @@ -125,7 +125,7 @@ static void jsm_tty_start_tx(struct uart_port *port, unsigned int tty_start) jsm_printk(IOCTL, INFO, &channel->ch_bd->pci_dev, "finish\n"); } -static void jsm_tty_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void jsm_tty_stop_tx(struct uart_port *port) { struct jsm_channel *channel = (struct jsm_channel *)port; diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c index 9b50560b9d1..b0ecc7537ce 100644 --- a/drivers/serial/m32r_sio.c +++ b/drivers/serial/m32r_sio.c @@ -275,7 +275,7 @@ serial_out(struct uart_sio_port *up, int offset, int value) __sio_out(value, offset); } -static void m32r_sio_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void m32r_sio_stop_tx(struct uart_port *port) { struct uart_sio_port *up = (struct uart_sio_port *)port; @@ -285,7 +285,7 @@ static void m32r_sio_stop_tx(struct uart_port *port, unsigned int tty_stop) } } -static void m32r_sio_start_tx(struct uart_port *port, unsigned int tty_start) +static void m32r_sio_start_tx(struct uart_port *port) { #ifdef CONFIG_SERIAL_M32R_PLDSIO struct uart_sio_port *up = (struct uart_sio_port *)port; @@ -425,7 +425,7 @@ static _INLINE_ void transmit_chars(struct uart_sio_port *up) return; } if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { - m32r_sio_stop_tx(&up->port, 0); + m32r_sio_stop_tx(&up->port); return; } @@ -446,7 +446,7 @@ static _INLINE_ void transmit_chars(struct uart_sio_port *up) DEBUG_INTR("THRE..."); if (uart_circ_empty(xmit)) - m32r_sio_stop_tx(&up->port, 0); + m32r_sio_stop_tx(&up->port); } /* diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c index 8c40167778d..43b03c55f45 100644 --- a/drivers/serial/mcfserial.c +++ b/drivers/serial/mcfserial.c @@ -40,7 +40,6 @@ #include <asm/io.h> #include <asm/irq.h> #include <asm/system.h> -#include <asm/segment.h> #include <asm/semaphore.h> #include <asm/delay.h> #include <asm/coldfire.h> diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 2a5cf174ca3..a3cd0ee8486 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c @@ -119,7 +119,7 @@ mpc52xx_uart_get_mctrl(struct uart_port *port) } static void -mpc52xx_uart_stop_tx(struct uart_port *port, unsigned int tty_stop) +mpc52xx_uart_stop_tx(struct uart_port *port) { /* port->lock taken by caller */ port->read_status_mask &= ~MPC52xx_PSC_IMR_TXRDY; @@ -127,7 +127,7 @@ mpc52xx_uart_stop_tx(struct uart_port *port, unsigned int tty_stop) } static void -mpc52xx_uart_start_tx(struct uart_port *port, unsigned int tty_start) +mpc52xx_uart_start_tx(struct uart_port *port) { /* port->lock taken by caller */ port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY; @@ -485,7 +485,7 @@ mpc52xx_uart_int_tx_chars(struct uart_port *port) /* Nothing to do ? */ if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { - mpc52xx_uart_stop_tx(port,0); + mpc52xx_uart_stop_tx(port); return 0; } @@ -504,7 +504,7 @@ mpc52xx_uart_int_tx_chars(struct uart_port *port) /* Maybe we're done after all */ if (uart_circ_empty(xmit)) { - mpc52xx_uart_stop_tx(port,0); + mpc52xx_uart_stop_tx(port); return 0; } diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c index e43276c6a95..efe79b1fd43 100644 --- a/drivers/serial/mpsc.c +++ b/drivers/serial/mpsc.c @@ -1072,18 +1072,18 @@ mpsc_get_mctrl(struct uart_port *port) } static void -mpsc_stop_tx(struct uart_port *port, uint tty_start) +mpsc_stop_tx(struct uart_port *port) { struct mpsc_port_info *pi = (struct mpsc_port_info *)port; - pr_debug("mpsc_stop_tx[%d]: tty_start: %d\n", port->line, tty_start); + pr_debug("mpsc_stop_tx[%d]\n", port->line); mpsc_freeze(pi); return; } static void -mpsc_start_tx(struct uart_port *port, uint tty_start) +mpsc_start_tx(struct uart_port *port) { struct mpsc_port_info *pi = (struct mpsc_port_info *)port; @@ -1091,7 +1091,7 @@ mpsc_start_tx(struct uart_port *port, uint tty_start) mpsc_copy_tx_data(pi); mpsc_sdma_start_tx(pi); - pr_debug("mpsc_start_tx[%d]: tty_start: %d\n", port->line, tty_start); + pr_debug("mpsc_start_tx[%d]\n", port->line); return; } diff --git a/drivers/serial/mux.c b/drivers/serial/mux.c index dadd7e19714..18906460770 100644 --- a/drivers/serial/mux.c +++ b/drivers/serial/mux.c @@ -111,22 +111,20 @@ static unsigned int mux_get_mctrl(struct uart_port *port) /** * mux_stop_tx - Stop transmitting characters. * @port: Ptr to the uart_port. - * @tty_stop: tty layer issue this command? * * The Serial MUX does not support this function. */ -static void mux_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void mux_stop_tx(struct uart_port *port) { } /** * mux_start_tx - Start transmitting characters. * @port: Ptr to the uart_port. - * @tty_start: tty layer issue this command? * * The Serial Mux does not support this function. */ -static void mux_start_tx(struct uart_port *port, unsigned int tty_start) +static void mux_start_tx(struct uart_port *port) { } @@ -181,7 +179,7 @@ static void mux_write(struct uart_port *port) } if(uart_circ_empty(xmit) || uart_tx_stopped(port)) { - mux_stop_tx(port, 0); + mux_stop_tx(port); return; } @@ -202,7 +200,7 @@ static void mux_write(struct uart_port *port) uart_write_wakeup(port); if (uart_circ_empty(xmit)) - mux_stop_tx(port, 0); + mux_stop_tx(port); } /** diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c index 7db2f37532c..5ddd8ab1f10 100644 --- a/drivers/serial/pmac_zilog.c +++ b/drivers/serial/pmac_zilog.c @@ -630,11 +630,10 @@ static unsigned int pmz_get_mctrl(struct uart_port *port) /* * Stop TX side. Dealt like sunzilog at next Tx interrupt, - * though for DMA, we will have to do a bit more. What is - * the meaning of the tty_stop bit ? XXX + * though for DMA, we will have to do a bit more. * The port lock is held and interrupts are disabled. */ -static void pmz_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void pmz_stop_tx(struct uart_port *port) { to_pmz(port)->flags |= PMACZILOG_FLAG_TX_STOPPED; } @@ -643,7 +642,7 @@ static void pmz_stop_tx(struct uart_port *port, unsigned int tty_stop) * Kick the Tx side. * The port lock is held and interrupts are disabled. */ -static void pmz_start_tx(struct uart_port *port, unsigned int tty_start) +static void pmz_start_tx(struct uart_port *port) { struct uart_pmac_port *uap = to_pmz(port); unsigned char status; @@ -1601,7 +1600,7 @@ static int pmz_suspend(struct macio_dev *mdev, pm_message_t pm_state) return 0; } - if (pm_state == mdev->ofdev.dev.power.power_state || pm_state < 2) + if (pm_state.event == mdev->ofdev.dev.power.power_state.event) return 0; pmz_debug("suspend, switching to state %d\n", pm_state); @@ -1661,7 +1660,7 @@ static int pmz_resume(struct macio_dev *mdev) if (uap == NULL) return 0; - if (mdev->ofdev.dev.power.power_state == 0) + if (mdev->ofdev.dev.power.power_state.event == PM_EVENT_ON) return 0; pmz_debug("resume, switching to state 0\n"); @@ -1714,7 +1713,7 @@ static int pmz_resume(struct macio_dev *mdev) pmz_debug("resume, switching complete\n"); - mdev->ofdev.dev.power.power_state = 0; + mdev->ofdev.dev.power.power_state.event = PM_EVENT_ON; return 0; } diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c index 461c81c9320..eaa0af83529 100644 --- a/drivers/serial/pxa.c +++ b/drivers/serial/pxa.c @@ -80,7 +80,7 @@ static void serial_pxa_enable_ms(struct uart_port *port) serial_out(up, UART_IER, up->ier); } -static void serial_pxa_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void serial_pxa_stop_tx(struct uart_port *port) { struct uart_pxa_port *up = (struct uart_pxa_port *)port; @@ -185,7 +185,7 @@ static void transmit_chars(struct uart_pxa_port *up) return; } if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { - serial_pxa_stop_tx(&up->port, 0); + serial_pxa_stop_tx(&up->port); return; } @@ -203,10 +203,10 @@ static void transmit_chars(struct uart_pxa_port *up) if (uart_circ_empty(xmit)) - serial_pxa_stop_tx(&up->port, 0); + serial_pxa_stop_tx(&up->port); } -static void serial_pxa_start_tx(struct uart_port *port, unsigned int tty_start) +static void serial_pxa_start_tx(struct uart_port *port) { struct uart_pxa_port *up = (struct uart_pxa_port *)port; diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c index 7365d4b50b9..c361c6fb080 100644 --- a/drivers/serial/s3c2410.c +++ b/drivers/serial/s3c2410.c @@ -246,8 +246,7 @@ static void s3c24xx_serial_rx_disable(struct uart_port *port) spin_unlock_irqrestore(&port->lock, flags); } -static void -s3c24xx_serial_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void s3c24xx_serial_stop_tx(struct uart_port *port) { if (tx_enabled(port)) { disable_irq(TX_IRQ(port)); @@ -257,8 +256,7 @@ s3c24xx_serial_stop_tx(struct uart_port *port, unsigned int tty_stop) } } -static void -s3c24xx_serial_start_tx(struct uart_port *port, unsigned int tty_start) +static void s3c24xx_serial_start_tx(struct uart_port *port) { if (!tx_enabled(port)) { if (port->flags & UPF_CONS_FLOW) @@ -424,7 +422,7 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id, struct pt_regs *re */ if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { - s3c24xx_serial_stop_tx(port, 0); + s3c24xx_serial_stop_tx(port); goto out; } @@ -443,7 +441,7 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id, struct pt_regs *re uart_write_wakeup(port); if (uart_circ_empty(xmit)) - s3c24xx_serial_stop_tx(port, 0); + s3c24xx_serial_stop_tx(port); out: return IRQ_HANDLED; diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index 98641c3f5ab..1225b14f6e9 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c @@ -145,7 +145,7 @@ static void sa1100_timeout(unsigned long data) /* * interrupts disabled on entry */ -static void sa1100_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void sa1100_stop_tx(struct uart_port *port) { struct sa1100_port *sport = (struct sa1100_port *)port; u32 utcr3; @@ -158,7 +158,7 @@ static void sa1100_stop_tx(struct uart_port *port, unsigned int tty_stop) /* * interrupts may not be disabled on entry */ -static void sa1100_start_tx(struct uart_port *port, unsigned int tty_start) +static void sa1100_start_tx(struct uart_port *port) { struct sa1100_port *sport = (struct sa1100_port *)port; unsigned long flags; @@ -264,7 +264,7 @@ static void sa1100_tx_chars(struct sa1100_port *sport) sa1100_mctrl_check(sport); if (uart_circ_empty(xmit) || uart_tx_stopped(&sport->port)) { - sa1100_stop_tx(&sport->port, 0); + sa1100_stop_tx(&sport->port); return; } @@ -284,7 +284,7 @@ static void sa1100_tx_chars(struct sa1100_port *sport) uart_write_wakeup(&sport->port); if (uart_circ_empty(xmit)) - sa1100_stop_tx(&sport->port, 0); + sa1100_stop_tx(&sport->port); } static irqreturn_t sa1100_int(int irq, void *dev_id, struct pt_regs *regs) diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 54699c3a00a..2d8622eef70 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -80,7 +80,7 @@ static void uart_stop(struct tty_struct *tty) unsigned long flags; spin_lock_irqsave(&port->lock, flags); - port->ops->stop_tx(port, 1); + port->ops->stop_tx(port); spin_unlock_irqrestore(&port->lock, flags); } @@ -91,7 +91,7 @@ static void __uart_start(struct tty_struct *tty) if (!uart_circ_empty(&state->info->xmit) && state->info->xmit.buf && !tty->stopped && !tty->hw_stopped) - port->ops->start_tx(port, 1); + port->ops->start_tx(port); } static void uart_start(struct tty_struct *tty) @@ -542,7 +542,7 @@ static void uart_send_xchar(struct tty_struct *tty, char ch) port->x_char = ch; if (ch) { spin_lock_irqsave(&port->lock, flags); - port->ops->start_tx(port, 0); + port->ops->start_tx(port); spin_unlock_irqrestore(&port->lock, flags); } } @@ -1146,7 +1146,7 @@ static void uart_set_termios(struct tty_struct *tty, struct termios *old_termios spin_lock_irqsave(&state->port->lock, flags); if (!(state->port->ops->get_mctrl(state->port) & TIOCM_CTS)) { tty->hw_stopped = 1; - state->port->ops->stop_tx(state->port, 0); + state->port->ops->stop_tx(state->port); } spin_unlock_irqrestore(&state->port->lock, flags); } @@ -1869,7 +1869,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port) struct uart_ops *ops = port->ops; spin_lock_irq(&port->lock); - ops->stop_tx(port, 0); + ops->stop_tx(port); ops->set_mctrl(port, 0); ops->stop_rx(port); spin_unlock_irq(&port->lock); @@ -1935,7 +1935,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port) uart_change_speed(state, NULL); spin_lock_irq(&port->lock); ops->set_mctrl(port, port->mctrl); - ops->start_tx(port, 0); + ops->start_tx(port); spin_unlock_irq(&port->lock); } @@ -1947,21 +1947,29 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port) static inline void uart_report_port(struct uart_driver *drv, struct uart_port *port) { - printk("%s%d", drv->dev_name, port->line); - printk(" at "); + char address[64]; + switch (port->iotype) { case UPIO_PORT: - printk("I/O 0x%x", port->iobase); + snprintf(address, sizeof(address), + "I/O 0x%x", port->iobase); break; case UPIO_HUB6: - printk("I/O 0x%x offset 0x%x", port->iobase, port->hub6); + snprintf(address, sizeof(address), + "I/O 0x%x offset 0x%x", port->iobase, port->hub6); break; case UPIO_MEM: case UPIO_MEM32: - printk("MMIO 0x%lx", port->mapbase); + snprintf(address, sizeof(address), + "MMIO 0x%lx", port->mapbase); + break; + default: + strlcpy(address, "*unknown*", sizeof(address)); break; } - printk(" (irq = %d) is a %s\n", port->irq, uart_type(port)); + + printk(KERN_INFO "%s%d at %s (irq = %d) is a %s\n", + drv->dev_name, port->line, address, port->irq, uart_type(port)); } static void @@ -2289,143 +2297,11 @@ int uart_match_port(struct uart_port *port1, struct uart_port *port2) } EXPORT_SYMBOL(uart_match_port); -/* - * Try to find an unused uart_state slot for a port. - */ -static struct uart_state * -uart_find_match_or_unused(struct uart_driver *drv, struct uart_port *port) -{ - int i; - - /* - * First, find a port entry which matches. Note: if we do - * find a matching entry, and it has a non-zero use count, - * then we can't register the port. - */ - for (i = 0; i < drv->nr; i++) - if (uart_match_port(drv->state[i].port, port)) - return &drv->state[i]; - - /* - * We didn't find a matching entry, so look for the first - * free entry. We look for one which hasn't been previously - * used (indicated by zero iobase). - */ - for (i = 0; i < drv->nr; i++) - if (drv->state[i].port->type == PORT_UNKNOWN && - drv->state[i].port->iobase == 0 && - drv->state[i].count == 0) - return &drv->state[i]; - - /* - * That also failed. Last resort is to find any currently - * entry which doesn't have a real port associated with it. - */ - for (i = 0; i < drv->nr; i++) - if (drv->state[i].port->type == PORT_UNKNOWN && - drv->state[i].count == 0) - return &drv->state[i]; - - return NULL; -} - -/** - * uart_register_port: register uart settings with a port - * @drv: pointer to the uart low level driver structure for this port - * @port: uart port structure describing the port - * - * Register UART settings with the specified low level driver. Detect - * the type of the port if UPF_BOOT_AUTOCONF is set, and detect the - * IRQ if UPF_AUTO_IRQ is set. - * - * We try to pick the same port for the same IO base address, so that - * when a modem is plugged in, unplugged and plugged back in, it gets - * allocated the same port. - * - * Returns negative error, or positive line number. - */ -int uart_register_port(struct uart_driver *drv, struct uart_port *port) -{ - struct uart_state *state; - int ret; - - down(&port_sem); - - state = uart_find_match_or_unused(drv, port); - - if (state) { - /* - * Ok, we've found a line that we can use. - * - * If we find a port that matches this one, and it appears - * to be in-use (even if it doesn't have a type) we shouldn't - * alter it underneath itself - the port may be open and - * trying to do useful work. - */ - if (uart_users(state) != 0) { - ret = -EBUSY; - goto out; - } - - /* - * If the port is already initialised, don't touch it. - */ - if (state->port->type == PORT_UNKNOWN) { - state->port->iobase = port->iobase; - state->port->membase = port->membase; - state->port->irq = port->irq; - state->port->uartclk = port->uartclk; - state->port->fifosize = port->fifosize; - state->port->regshift = port->regshift; - state->port->iotype = port->iotype; - state->port->flags = port->flags; - state->port->line = state - drv->state; - state->port->mapbase = port->mapbase; - - uart_configure_port(drv, state, state->port); - } - - ret = state->port->line; - } else - ret = -ENOSPC; - out: - up(&port_sem); - return ret; -} - -/** - * uart_unregister_port - de-allocate a port - * @drv: pointer to the uart low level driver structure for this port - * @line: line index previously returned from uart_register_port() - * - * Hang up the specified line associated with the low level driver, - * and mark the port as unused. - */ -void uart_unregister_port(struct uart_driver *drv, int line) -{ - struct uart_state *state; - - if (line < 0 || line >= drv->nr) { - printk(KERN_ERR "Attempt to unregister "); - printk("%s%d", drv->dev_name, line); - printk("\n"); - return; - } - - state = drv->state + line; - - down(&port_sem); - uart_unconfigure_port(drv, state); - up(&port_sem); -} - EXPORT_SYMBOL(uart_write_wakeup); EXPORT_SYMBOL(uart_register_driver); EXPORT_SYMBOL(uart_unregister_driver); EXPORT_SYMBOL(uart_suspend_port); EXPORT_SYMBOL(uart_resume_port); -EXPORT_SYMBOL(uart_register_port); -EXPORT_SYMBOL(uart_unregister_port); EXPORT_SYMBOL(uart_add_one_port); EXPORT_SYMBOL(uart_remove_one_port); diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c index 56f269b6bfb..8302376800c 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); @@ -208,7 +207,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 +229,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) diff --git a/drivers/serial/serial_txx9.c b/drivers/serial/serial_txx9.c index d085030df70..f10c86d60b6 100644 --- a/drivers/serial/serial_txx9.c +++ b/drivers/serial/serial_txx9.c @@ -31,6 +31,8 @@ * 1.01 Set fifosize to make tx_empry called properly. * Use standard uart_get_divisor. * 1.02 Cleanup. (import 8250.c changes) + * 1.03 Fix low-latency mode. (import 8250.c changes) + * 1.04 Remove usage of deprecated functions, cleanup. */ #include <linux/config.h> @@ -54,7 +56,7 @@ #include <asm/io.h> #include <asm/irq.h> -static char *serial_version = "1.02"; +static char *serial_version = "1.04"; static char *serial_name = "TX39/49 Serial driver"; #define PASS_LIMIT 256 @@ -86,9 +88,9 @@ static char *serial_name = "TX39/49 Serial driver"; */ #ifdef ENABLE_SERIAL_TXX9_PCI #define NR_PCI_BOARDS 4 -#define UART_NR (2 + NR_PCI_BOARDS) +#define UART_NR (4 + NR_PCI_BOARDS) #else -#define UART_NR 2 +#define UART_NR 4 #endif struct uart_txx9_port { @@ -253,7 +255,7 @@ sio_quot_set(struct uart_txx9_port *up, int quot) sio_out(up, TXX9_SIBGR, 0xff | TXX9_SIBGR_BCLK_T6); } -static void serial_txx9_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void serial_txx9_stop_tx(struct uart_port *port) { struct uart_txx9_port *up = (struct uart_txx9_port *)port; unsigned long flags; @@ -263,7 +265,7 @@ static void serial_txx9_stop_tx(struct uart_port *port, unsigned int tty_stop) spin_unlock_irqrestore(&up->port.lock, flags); } -static void serial_txx9_start_tx(struct uart_port *port, unsigned int tty_start) +static void serial_txx9_start_tx(struct uart_port *port) { struct uart_txx9_port *up = (struct uart_txx9_port *)port; unsigned long flags; @@ -304,8 +306,11 @@ receive_chars(struct uart_txx9_port *up, unsigned int *status, struct pt_regs *r /* The following is not allowed by the tty layer and unsafe. It should be fixed ASAP */ if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) { - if(tty->low_latency) + if (tty->low_latency) { + spin_unlock(&up->port.lock); tty_flip_buffer_push(tty); + spin_lock(&up->port.lock); + } /* If this failed then we will throw away the bytes but must do so to clear interrupts */ } @@ -356,7 +361,9 @@ receive_chars(struct uart_txx9_port *up, unsigned int *status, struct pt_regs *r ignore_char: disr = sio_in(up, TXX9_SIDISR); } while (!(disr & TXX9_SIDISR_UVALID) && (max_count-- > 0)); + spin_unlock(&up->port.lock); tty_flip_buffer_push(tty); + spin_lock(&up->port.lock); *status = disr; } @@ -372,7 +379,7 @@ static inline void transmit_chars(struct uart_txx9_port *up) return; } if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { - serial_txx9_stop_tx(&up->port, 0); + serial_txx9_stop_tx(&up->port); return; } @@ -389,7 +396,7 @@ static inline void transmit_chars(struct uart_txx9_port *up) uart_write_wakeup(&up->port); if (uart_circ_empty(xmit)) - serial_txx9_stop_tx(&up->port, 0); + serial_txx9_stop_tx(&up->port); } static irqreturn_t serial_txx9_interrupt(int irq, void *dev_id, struct pt_regs *regs) @@ -667,17 +674,8 @@ serial_txx9_pm(struct uart_port *port, unsigned int state, unsigned int oldstate) { struct uart_txx9_port *up = (struct uart_txx9_port *)port; - if (state) { - /* sleep */ - - if (up->pm) - up->pm(port, state, oldstate); - } else { - /* wake */ - - if (up->pm) - up->pm(port, state, oldstate); - } + if (up->pm) + up->pm(port, state, oldstate); } static int serial_txx9_request_resource(struct uart_txx9_port *up) @@ -979,14 +977,6 @@ static int __init serial_txx9_console_init(void) } console_initcall(serial_txx9_console_init); -static int __init serial_txx9_late_console_init(void) -{ - if (!(serial_txx9_console.flags & CON_ENABLED)) - register_console(&serial_txx9_console); - return 0; -} -late_initcall(serial_txx9_late_console_init); - #define SERIAL_TXX9_CONSOLE &serial_txx9_console #else #define SERIAL_TXX9_CONSOLE NULL @@ -1039,6 +1029,73 @@ static void serial_txx9_resume_port(int line) uart_resume_port(&serial_txx9_reg, &serial_txx9_ports[line].port); } +static DECLARE_MUTEX(serial_txx9_sem); + +/** + * serial_txx9_register_port - register a serial port + * @port: serial port template + * + * Configure the serial port specified by the request. + * + * The port is then probed and if necessary the IRQ is autodetected + * If this fails an error is returned. + * + * On success the port is ready to use and the line number is returned. + */ +static int __devinit serial_txx9_register_port(struct uart_port *port) +{ + int i; + struct uart_txx9_port *uart; + int ret = -ENOSPC; + + down(&serial_txx9_sem); + for (i = 0; i < UART_NR; i++) { + uart = &serial_txx9_ports[i]; + if (uart->port.type == PORT_UNKNOWN) + break; + } + if (i < UART_NR) { + uart_remove_one_port(&serial_txx9_reg, &uart->port); + uart->port.iobase = port->iobase; + uart->port.membase = port->membase; + uart->port.irq = port->irq; + uart->port.uartclk = port->uartclk; + uart->port.iotype = port->iotype; + uart->port.flags = port->flags | UPF_BOOT_AUTOCONF; + uart->port.mapbase = port->mapbase; + if (port->dev) + uart->port.dev = port->dev; + ret = uart_add_one_port(&serial_txx9_reg, &uart->port); + if (ret == 0) + ret = uart->port.line; + } + up(&serial_txx9_sem); + return ret; +} + +/** + * serial_txx9_unregister_port - remove a txx9 serial port at runtime + * @line: serial line number + * + * Remove one serial port. This may not be called from interrupt + * context. We hand the port back to the our control. + */ +static void __devexit serial_txx9_unregister_port(int line) +{ + struct uart_txx9_port *uart = &serial_txx9_ports[line]; + + down(&serial_txx9_sem); + uart_remove_one_port(&serial_txx9_reg, &uart->port); + uart->port.flags = 0; + uart->port.type = PORT_UNKNOWN; + uart->port.iobase = 0; + uart->port.mapbase = 0; + uart->port.membase = 0; + uart->port.dev = NULL; + uart_add_one_port(&serial_txx9_reg, &uart->port); + up(&serial_txx9_sem); +} + /* * Probe one serial board. Unfortunately, there is no rhyme nor reason * to the arrangement of serial ports on a PCI card. @@ -1056,13 +1113,13 @@ pciserial_txx9_init_one(struct pci_dev *dev, const struct pci_device_id *ent) memset(&port, 0, sizeof(port)); port.ops = &serial_txx9_pops; - port.flags |= UPF_BOOT_AUTOCONF; /* uart_ops.config_port will be called */ port.flags |= UPF_TXX9_HAVE_CTS_LINE; port.uartclk = 66670000; port.irq = dev->irq; port.iotype = UPIO_PORT; port.iobase = pci_resource_start(dev, 1); - line = uart_register_port(&serial_txx9_reg, &port); + port.dev = &dev->dev; + line = serial_txx9_register_port(&port); if (line < 0) { printk(KERN_WARNING "Couldn't register serial port %s: %d\n", pci_name(dev), line); } @@ -1078,7 +1135,7 @@ static void __devexit pciserial_txx9_remove_one(struct pci_dev *dev) pci_set_drvdata(dev, NULL); if (line) { - uart_unregister_port(&serial_txx9_reg, line); + serial_txx9_unregister_port(line); pci_disable_device(dev); } } @@ -1089,6 +1146,8 @@ static int pciserial_txx9_suspend_one(struct pci_dev *dev, pm_message_t state) if (line) serial_txx9_suspend_port(line); + pci_save_state(dev); + pci_set_power_state(dev, pci_choose_state(dev, state)); return 0; } @@ -1096,8 +1155,13 @@ static int pciserial_txx9_resume_one(struct pci_dev *dev) { int line = (int)(long)pci_get_drvdata(dev); - if (line) + pci_set_power_state(dev, PCI_D0); + pci_restore_state(dev); + + if (line) { + pci_enable_device(dev); serial_txx9_resume_port(line); + } return 0; } diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index ad5b776d779..51226630786 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c @@ -79,8 +79,8 @@ static struct sci_port *serial_console_port = 0; #endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */ /* Function prototypes */ -static void sci_stop_tx(struct uart_port *port, unsigned int tty_stop); -static void sci_start_tx(struct uart_port *port, unsigned int tty_start); +static void sci_stop_tx(struct uart_port *port); +static void sci_start_tx(struct uart_port *port); static void sci_start_rx(struct uart_port *port, unsigned int tty_start); static void sci_stop_rx(struct uart_port *port); static int sci_request_irq(struct sci_port *port); @@ -455,7 +455,7 @@ static void sci_transmit_chars(struct uart_port *port) if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(port); if (uart_circ_empty(xmit)) { - sci_stop_tx(port, 0); + sci_stop_tx(port); } else { local_irq_save(flags); ctrl = sci_in(port, SCSCR); @@ -900,7 +900,7 @@ static unsigned int sci_get_mctrl(struct uart_port *port) return TIOCM_DTR | TIOCM_RTS | TIOCM_DSR; } -static void sci_start_tx(struct uart_port *port, unsigned int tty_start) +static void sci_start_tx(struct uart_port *port) { struct sci_port *s = &sci_ports[port->line]; @@ -909,7 +909,7 @@ static void sci_start_tx(struct uart_port *port, unsigned int tty_start) enable_irq(s->irqs[SCIx_TXI_IRQ]); } -static void sci_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void sci_stop_tx(struct uart_port *port) { unsigned long flags; unsigned short ctrl; @@ -978,7 +978,7 @@ static void sci_shutdown(struct uart_port *port) struct sci_port *s = &sci_ports[port->line]; sci_stop_rx(port); - sci_stop_tx(port, 1); + sci_stop_tx(port); sci_free_irq(s); #if defined(__H8300S__) diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c index 12d1f14e78c..313f9df24a2 100644 --- a/drivers/serial/sn_console.c +++ b/drivers/serial/sn_console.c @@ -259,10 +259,9 @@ static unsigned int snp_tx_empty(struct uart_port *port) /** * snp_stop_tx - stop the transmitter - no-op for us * @port: Port to operat eon - we ignore - no-op function - * @tty_stop: Set to 1 if called via uart_stop * */ -static void snp_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void snp_stop_tx(struct uart_port *port) { } @@ -325,10 +324,9 @@ static void snp_stop_rx(struct uart_port *port) /** * snp_start_tx - Start transmitter * @port: Port to operate on - * @tty_stop: Set to 1 if called via uart_start * */ -static void snp_start_tx(struct uart_port *port, unsigned int tty_stop) +static void snp_start_tx(struct uart_port *port) { if (sal_console_port.sc_ops->sal_wakeup_transmit) sal_console_port.sc_ops->sal_wakeup_transmit(&sal_console_port, @@ -615,7 +613,7 @@ static void sn_transmit_chars(struct sn_cons_port *port, int raw) uart_write_wakeup(&port->sc_port); if (uart_circ_empty(xmit)) - snp_stop_tx(&port->sc_port, 0); /* no-op for us */ + snp_stop_tx(&port->sc_port); /* no-op for us */ } /** diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index 8d198880756..e971156daa6 100644 --- a/drivers/serial/sunsab.c +++ b/drivers/serial/sunsab.c @@ -245,7 +245,7 @@ receive_chars(struct uart_sunsab_port *up, return tty; } -static void sunsab_stop_tx(struct uart_port *, unsigned int); +static void sunsab_stop_tx(struct uart_port *); static void sunsab_tx_idle(struct uart_sunsab_port *); static void transmit_chars(struct uart_sunsab_port *up, @@ -301,7 +301,7 @@ static void transmit_chars(struct uart_sunsab_port *up, uart_write_wakeup(&up->port); if (uart_circ_empty(xmit)) - sunsab_stop_tx(&up->port, 0); + sunsab_stop_tx(&up->port); } static void check_status(struct uart_sunsab_port *up, @@ -448,7 +448,7 @@ static unsigned int sunsab_get_mctrl(struct uart_port *port) } /* port->lock held by caller. */ -static void sunsab_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void sunsab_stop_tx(struct uart_port *port) { struct uart_sunsab_port *up = (struct uart_sunsab_port *) port; @@ -476,7 +476,7 @@ static void sunsab_tx_idle(struct uart_sunsab_port *up) } /* port->lock held by caller. */ -static void sunsab_start_tx(struct uart_port *port, unsigned int tty_start) +static void sunsab_start_tx(struct uart_port *port) { struct uart_sunsab_port *up = (struct uart_sunsab_port *) port; struct circ_buf *xmit = &up->port.info->xmit; diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index d57a3553aea..5959e6755a8 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c @@ -255,21 +255,30 @@ static void disable_rsa(struct uart_sunsu_port *up) } #endif /* CONFIG_SERIAL_8250_RSA */ -static void sunsu_stop_tx(struct uart_port *port, unsigned int tty_stop) +static inline void __stop_tx(struct uart_sunsu_port *p) +{ + if (p->ier & UART_IER_THRI) { + p->ier &= ~UART_IER_THRI; + serial_out(p, UART_IER, p->ier); + } +} + +static void sunsu_stop_tx(struct uart_port *port) { struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; - if (up->ier & UART_IER_THRI) { - up->ier &= ~UART_IER_THRI; - serial_out(up, UART_IER, up->ier); - } - if (up->port.type == PORT_16C950 && tty_stop) { + __stop_tx(up); + + /* + * We really want to stop the transmitter from sending. + */ + if (up->port.type == PORT_16C950) { up->acr |= UART_ACR_TXDIS; serial_icr_write(up, UART_ACR, up->acr); } } -static void sunsu_start_tx(struct uart_port *port, unsigned int tty_start) +static void sunsu_start_tx(struct uart_port *port) { struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; @@ -277,10 +286,11 @@ static void sunsu_start_tx(struct uart_port *port, unsigned int tty_start) up->ier |= UART_IER_THRI; serial_out(up, UART_IER, up->ier); } + /* - * We only do this from uart_start + * Re-enable the transmitter if we disabled it. */ - if (tty_start && up->port.type == PORT_16C950) { + if (up->port.type == PORT_16C950 && up->acr & UART_ACR_TXDIS) { up->acr &= ~UART_ACR_TXDIS; serial_icr_write(up, UART_ACR, up->acr); } @@ -413,8 +423,12 @@ static _INLINE_ void transmit_chars(struct uart_sunsu_port *up) up->port.x_char = 0; return; } - if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) { - sunsu_stop_tx(&up->port, 0); + if (uart_tx_stopped(&up->port)) { + sunsu_stop_tx(&up->port); + return; + } + if (uart_circ_empty(xmit)) { + __stop_tx(up); return; } @@ -431,7 +445,7 @@ static _INLINE_ void transmit_chars(struct uart_sunsu_port *up) uart_write_wakeup(&up->port); if (uart_circ_empty(xmit)) - sunsu_stop_tx(&up->port, 0); + __stop_tx(up); } static _INLINE_ void check_modem_status(struct uart_sunsu_port *up) diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index bff42a7b89d..d75445738c8 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c @@ -684,7 +684,7 @@ static void sunzilog_set_mctrl(struct uart_port *port, unsigned int mctrl) } /* The port lock is held and interrupts are disabled. */ -static void sunzilog_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void sunzilog_stop_tx(struct uart_port *port) { struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port; @@ -692,7 +692,7 @@ static void sunzilog_stop_tx(struct uart_port *port, unsigned int tty_stop) } /* The port lock is held and interrupts are disabled. */ -static void sunzilog_start_tx(struct uart_port *port, unsigned int tty_start) +static void sunzilog_start_tx(struct uart_port *port) { struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port; struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port); diff --git a/drivers/serial/uart00.c b/drivers/serial/uart00.c index 186f1300cea..47b504ff38b 100644 --- a/drivers/serial/uart00.c +++ b/drivers/serial/uart00.c @@ -87,7 +87,7 @@ #define UART_TX_READY(s) (((s) & UART_TSR_TX_LEVEL_MSK) < 15) //#define UART_TX_EMPTY(p) ((UART_GET_FR(p) & UART00_UARTFR_TMSK) == 0) -static void uart00_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void uart00_stop_tx(struct uart_port *port) { UART_PUT_IEC(port, UART_IEC_TIE_MSK); } @@ -199,7 +199,7 @@ static void uart00_tx_chars(struct uart_port *port) return; } if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { - uart00_stop_tx(port, 0); + uart00_stop_tx(port); return; } @@ -218,10 +218,10 @@ static void uart00_tx_chars(struct uart_port *port) uart_write_wakeup(port); if (uart_circ_empty(xmit)) - uart00_stop_tx(port, 0); + uart00_stop_tx(port); } -static void uart00_start_tx(struct uart_port *port, unsigned int tty_start) +static void uart00_start_tx(struct uart_port *port) { UART_PUT_IES(port, UART_IES_TIE_MSK); uart00_tx_chars(port); diff --git a/drivers/serial/v850e_uart.c b/drivers/serial/v850e_uart.c index bb482780a41..9378895a8d5 100644 --- a/drivers/serial/v850e_uart.c +++ b/drivers/serial/v850e_uart.c @@ -240,7 +240,7 @@ console_initcall(v850e_uart_console_init); /* TX/RX interrupt handlers. */ -static void v850e_uart_stop_tx (struct uart_port *port, unsigned tty_stop); +static void v850e_uart_stop_tx (struct uart_port *port); void v850e_uart_tx (struct uart_port *port) { @@ -339,14 +339,14 @@ static unsigned v850e_uart_get_mctrl (struct uart_port *port) return mctrl; } -static void v850e_uart_start_tx (struct uart_port *port, unsigned tty_start) +static void v850e_uart_start_tx (struct uart_port *port) { v850e_intc_disable_irq (V850E_UART_TX_IRQ (port->line)); v850e_uart_tx (port); v850e_intc_enable_irq (V850E_UART_TX_IRQ (port->line)); } -static void v850e_uart_stop_tx (struct uart_port *port, unsigned tty_stop) +static void v850e_uart_stop_tx (struct uart_port *port) { v850e_intc_disable_irq (V850E_UART_TX_IRQ (port->line)); } diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c index 1f985327b0d..0c5d65a08f6 100644 --- a/drivers/serial/vr41xx_siu.c +++ b/drivers/serial/vr41xx_siu.c @@ -284,7 +284,7 @@ static unsigned int siu_get_mctrl(struct uart_port *port) return mctrl; } -static void siu_stop_tx(struct uart_port *port, unsigned int tty_stop) +static void siu_stop_tx(struct uart_port *port) { unsigned long flags; uint8_t ier; @@ -298,7 +298,7 @@ static void siu_stop_tx(struct uart_port *port, unsigned int tty_stop) spin_unlock_irqrestore(&port->lock, flags); } -static void siu_start_tx(struct uart_port *port, unsigned int tty_start) +static void siu_start_tx(struct uart_port *port) { unsigned long flags; uint8_t ier; @@ -458,7 +458,7 @@ static inline void transmit_chars(struct uart_port *port) } if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { - siu_stop_tx(port, 0); + siu_stop_tx(port); return; } @@ -474,7 +474,7 @@ static inline void transmit_chars(struct uart_port *port) uart_write_wakeup(port); if (uart_circ_empty(xmit)) - siu_stop_tx(port, 0); + siu_stop_tx(port); } static irqreturn_t siu_interrupt(int irq, void *dev_id, struct pt_regs *regs) |