Commit 7f729ccf authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/home/rmk/linux-2.6-serial

parents cbc74951 ee31b337
...@@ -999,7 +999,10 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags) ...@@ -999,7 +999,10 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
serial_outp(up, UART_MCR, save_mcr); serial_outp(up, UART_MCR, save_mcr);
serial8250_clear_fifos(up); serial8250_clear_fifos(up);
(void)serial_in(up, UART_RX); (void)serial_in(up, UART_RX);
serial_outp(up, UART_IER, 0); if (up->capabilities & UART_CAP_UUE)
serial_outp(up, UART_IER, UART_IER_UUE);
else
serial_outp(up, UART_IER, 0);
out: out:
spin_unlock_irqrestore(&up->port.lock, flags); spin_unlock_irqrestore(&up->port.lock, flags);
......
...@@ -323,6 +323,8 @@ static const struct pnp_device_id pnp_dev_table[] = { ...@@ -323,6 +323,8 @@ static const struct pnp_device_id pnp_dev_table[] = {
{ "USR9180", 0 }, { "USR9180", 0 },
/* U.S. Robotics 56K Voice INT PnP*/ /* U.S. Robotics 56K Voice INT PnP*/
{ "USR9190", 0 }, { "USR9190", 0 },
/* HP Compaq Tablet PC tc1100 Wacom tablet */
{ "WACF005", 0 },
/* Rockwell's (PORALiNK) 33600 INT PNP */ /* Rockwell's (PORALiNK) 33600 INT PNP */
{ "WCI0003", 0 }, { "WCI0003", 0 },
/* Unkown PnP modems */ /* Unkown PnP modems */
......
/* /*
* dz.c: Serial port driver for DECStations equiped * dz.c: Serial port driver for DECStations equiped
* with the DZ chipset. * with the DZ chipset.
* *
* Copyright (C) 1998 Olivier A. D. Lebaillif * Copyright (C) 1998 Olivier A. D. Lebaillif
* *
* Email: olivier.lebaillif@ifrsys.com * Email: olivier.lebaillif@ifrsys.com
* *
* [31-AUG-98] triemer * [31-AUG-98] triemer
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
* removed base_addr code - moving address assignment to setup.c * removed base_addr code - moving address assignment to setup.c
* Changed name of dz_init to rs_init to be consistent with tc code * Changed name of dz_init to rs_init to be consistent with tc code
* [13-NOV-98] triemer fixed code to receive characters * [13-NOV-98] triemer fixed code to receive characters
* after patches by harald to irq code. * after patches by harald to irq code.
* [09-JAN-99] triemer minor fix for schedule - due to removal of timeout * [09-JAN-99] triemer minor fix for schedule - due to removal of timeout
* field from "current" - somewhere between 2.1.121 and 2.1.131 * field from "current" - somewhere between 2.1.121 and 2.1.131
Qua Jun 27 15:02:26 BRT 2001 Qua Jun 27 15:02:26 BRT 2001
* [27-JUN-2001] Arnaldo Carvalho de Melo <acme@conectiva.com.br> - cleanups * [27-JUN-2001] Arnaldo Carvalho de Melo <acme@conectiva.com.br> - cleanups
* *
* Parts (C) 1999 David Airlie, airlied@linux.ie * Parts (C) 1999 David Airlie, airlied@linux.ie
* [07-SEP-99] Bugfixes * [07-SEP-99] Bugfixes
* *
* [06-Jan-2002] Russell King <rmk@arm.linux.org.uk> * [06-Jan-2002] Russell King <rmk@arm.linux.org.uk>
* Converted to new serial core * Converted to new serial core
...@@ -64,7 +64,7 @@ static struct dz_port dz_ports[DZ_NB_PORT]; ...@@ -64,7 +64,7 @@ static struct dz_port dz_ports[DZ_NB_PORT];
#ifdef DEBUG_DZ #ifdef DEBUG_DZ
/* /*
* debugging code to send out chars via prom * debugging code to send out chars via prom
*/ */
static void debug_console(const char *s, int count) static void debug_console(const char *s, int count)
{ {
...@@ -82,7 +82,7 @@ static void debug_console(const char *s, int count) ...@@ -82,7 +82,7 @@ static void debug_console(const char *s, int count)
* ------------------------------------------------------------ * ------------------------------------------------------------
* dz_in () and dz_out () * dz_in () and dz_out ()
* *
* These routines are used to access the registers of the DZ * These routines are used to access the registers of the DZ
* chip, hiding relocation differences between implementation. * chip, hiding relocation differences between implementation.
* ------------------------------------------------------------ * ------------------------------------------------------------
*/ */
...@@ -106,8 +106,8 @@ static inline void dz_out(struct dz_port *dport, unsigned offset, ...@@ -106,8 +106,8 @@ static inline void dz_out(struct dz_port *dport, unsigned offset,
* ------------------------------------------------------------ * ------------------------------------------------------------
* rs_stop () and rs_start () * rs_stop () and rs_start ()
* *
* These routines are called before setting or resetting * These routines are called before setting or resetting
* tty->stopped. They enable or disable transmitter interrupts, * tty->stopped. They enable or disable transmitter interrupts,
* as necessary. * as necessary.
* ------------------------------------------------------------ * ------------------------------------------------------------
*/ */
...@@ -156,17 +156,17 @@ static void dz_enable_ms(struct uart_port *port) ...@@ -156,17 +156,17 @@ static void dz_enable_ms(struct uart_port *port)
/* /*
* ------------------------------------------------------------ * ------------------------------------------------------------
* Here starts the interrupt handling routines. All of the * Here starts the interrupt handling routines. All of the
* following subroutines are declared as inline and are folded * following subroutines are declared as inline and are folded
* into dz_interrupt. They were separated out for readability's * into dz_interrupt. They were separated out for readability's
* sake. * sake.
* *
* Note: rs_interrupt() is a "fast" interrupt, which means that it * Note: rs_interrupt() is a "fast" interrupt, which means that it
* runs with interrupts turned off. People who may want to modify * runs with interrupts turned off. People who may want to modify
* rs_interrupt() should try to keep the interrupt handler as fast as * rs_interrupt() should try to keep the interrupt handler as fast as
* possible. After you are done making modifications, it is not a bad * possible. After you are done making modifications, it is not a bad
* idea to do: * idea to do:
* *
* make drivers/serial/dz.s * make drivers/serial/dz.s
* *
* and look at the resulting assemble code in dz.s. * and look at the resulting assemble code in dz.s.
...@@ -403,7 +403,7 @@ static void dz_set_mctrl(struct uart_port *uport, unsigned int mctrl) ...@@ -403,7 +403,7 @@ static void dz_set_mctrl(struct uart_port *uport, unsigned int mctrl)
* startup () * startup ()
* *
* various initialization tasks * various initialization tasks
* ------------------------------------------------------------------- * -------------------------------------------------------------------
*/ */
static int dz_startup(struct uart_port *uport) static int dz_startup(struct uart_port *uport)
{ {
...@@ -430,13 +430,13 @@ static int dz_startup(struct uart_port *uport) ...@@ -430,13 +430,13 @@ static int dz_startup(struct uart_port *uport)
return 0; return 0;
} }
/* /*
* ------------------------------------------------------------------- * -------------------------------------------------------------------
* shutdown () * shutdown ()
* *
* This routine will shutdown a serial port; interrupts are disabled, and * This routine will shutdown a serial port; interrupts are disabled, and
* DTR is dropped if the hangup on close termio flag is on. * DTR is dropped if the hangup on close termio flag is on.
* ------------------------------------------------------------------- * -------------------------------------------------------------------
*/ */
static void dz_shutdown(struct uart_port *uport) static void dz_shutdown(struct uart_port *uport)
{ {
...@@ -451,7 +451,7 @@ static void dz_shutdown(struct uart_port *uport) ...@@ -451,7 +451,7 @@ static void dz_shutdown(struct uart_port *uport)
* release the bus after transmitting. This must be done when * release the bus after transmitting. This must be done when
* the transmit shift register is empty, not be done when the * the transmit shift register is empty, not be done when the
* transmit holding register is empty. This functionality * transmit holding register is empty. This functionality
* allows an RS485 driver to be written in user space. * allows an RS485 driver to be written in user space.
*/ */
static unsigned int dz_tx_empty(struct uart_port *uport) static unsigned int dz_tx_empty(struct uart_port *uport)
{ {
...@@ -645,9 +645,9 @@ static void __init dz_init_ports(void) ...@@ -645,9 +645,9 @@ static void __init dz_init_ports(void)
if (mips_machtype == MACH_DS23100 || if (mips_machtype == MACH_DS23100 ||
mips_machtype == MACH_DS5100) mips_machtype == MACH_DS5100)
base = (unsigned long) KN01_DZ11_BASE; base = CKSEG1ADDR(KN01_SLOT_BASE + KN01_DZ11);
else else
base = (unsigned long) KN02_DZ11_BASE; base = CKSEG1ADDR(KN02_SLOT_BASE + KN02_DZ11);
for (i = 0, dport = dz_ports; i < DZ_NB_PORT; i++, dport++) { for (i = 0, dport = dz_ports; i < DZ_NB_PORT; i++, dport++) {
spin_lock_init(&dport->port.lock); spin_lock_init(&dport->port.lock);
...@@ -695,13 +695,13 @@ static void dz_console_put_char(struct dz_port *dport, unsigned char ch) ...@@ -695,13 +695,13 @@ static void dz_console_put_char(struct dz_port *dport, unsigned char ch)
spin_unlock_irqrestore(&dport->port.lock, flags); spin_unlock_irqrestore(&dport->port.lock, flags);
} }
/* /*
* ------------------------------------------------------------------- * -------------------------------------------------------------------
* dz_console_print () * dz_console_print ()
* *
* dz_console_print is registered for printk. * dz_console_print is registered for printk.
* The console must be locked when we get here. * The console must be locked when we get here.
* ------------------------------------------------------------------- * -------------------------------------------------------------------
*/ */
static void dz_console_print(struct console *cons, static void dz_console_print(struct console *cons,
const char *str, const char *str,
......
...@@ -725,7 +725,7 @@ mpc52xx_uart_probe(struct platform_device *dev) ...@@ -725,7 +725,7 @@ mpc52xx_uart_probe(struct platform_device *dev)
int i, idx, ret; int i, idx, ret;
/* Check validity & presence */ /* Check validity & presence */
idx = pdev->id; idx = dev->id;
if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM) if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM)
return -EINVAL; return -EINVAL;
...@@ -748,7 +748,7 @@ mpc52xx_uart_probe(struct platform_device *dev) ...@@ -748,7 +748,7 @@ mpc52xx_uart_probe(struct platform_device *dev)
port->ops = &mpc52xx_uart_ops; port->ops = &mpc52xx_uart_ops;
/* Search for IRQ and mapbase */ /* Search for IRQ and mapbase */
for (i=0 ; i<pdev->num_resources ; i++, res++) { for (i=0 ; i<dev->num_resources ; i++, res++) {
if (res->flags & IORESOURCE_MEM) if (res->flags & IORESOURCE_MEM)
port->mapbase = res->start; port->mapbase = res->start;
else if (res->flags & IORESOURCE_IRQ) else if (res->flags & IORESOURCE_IRQ)
......
...@@ -156,7 +156,7 @@ static void sa1100_stop_tx(struct uart_port *port) ...@@ -156,7 +156,7 @@ static void sa1100_stop_tx(struct uart_port *port)
} }
/* /*
* interrupts may not be disabled on entry * port locked and interrupts disabled
*/ */
static void sa1100_start_tx(struct uart_port *port) static void sa1100_start_tx(struct uart_port *port)
{ {
...@@ -164,11 +164,9 @@ static void sa1100_start_tx(struct uart_port *port) ...@@ -164,11 +164,9 @@ static void sa1100_start_tx(struct uart_port *port)
unsigned long flags; unsigned long flags;
u32 utcr3; u32 utcr3;
spin_lock_irqsave(&sport->port.lock, flags);
utcr3 = UART_GET_UTCR3(sport); utcr3 = UART_GET_UTCR3(sport);
sport->port.read_status_mask |= UTSR0_TO_SM(UTSR0_TFS); sport->port.read_status_mask |= UTSR0_TO_SM(UTSR0_TFS);
UART_PUT_UTCR3(sport, utcr3 | UTCR3_TIE); UART_PUT_UTCR3(sport, utcr3 | UTCR3_TIE);
spin_unlock_irqrestore(&sport->port.lock, flags);
} }
/* /*
......
...@@ -209,33 +209,45 @@ static void uart_shutdown(struct uart_state *state) ...@@ -209,33 +209,45 @@ static void uart_shutdown(struct uart_state *state)
struct uart_info *info = state->info; struct uart_info *info = state->info;
struct uart_port *port = state->port; struct uart_port *port = state->port;
if (!(info->flags & UIF_INITIALIZED))
return;
/* /*
* Turn off DTR and RTS early. * Set the TTY IO error marker
*/ */
if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) if (info->tty)
uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); set_bit(TTY_IO_ERROR, &info->tty->flags);
/* if (info->flags & UIF_INITIALIZED) {
* clear delta_msr_wait queue to avoid mem leaks: we may free info->flags &= ~UIF_INITIALIZED;
* the irq here so the queue might never be woken up. Note
* that we won't end up waiting on delta_msr_wait again since
* any outstanding file descriptors should be pointing at
* hung_up_tty_fops now.
*/
wake_up_interruptible(&info->delta_msr_wait);
/* /*
* Free the IRQ and disable the port. * Turn off DTR and RTS early.
*/ */
port->ops->shutdown(port); if (!info->tty || (info->tty->termios->c_cflag & HUPCL))
uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
/*
* clear delta_msr_wait queue to avoid mem leaks: we may free
* the irq here so the queue might never be woken up. Note
* that we won't end up waiting on delta_msr_wait again since
* any outstanding file descriptors should be pointing at
* hung_up_tty_fops now.
*/
wake_up_interruptible(&info->delta_msr_wait);
/*
* Free the IRQ and disable the port.
*/
port->ops->shutdown(port);
/*
* Ensure that the IRQ handler isn't running on another CPU.
*/
synchronize_irq(port->irq);
}
/* /*
* Ensure that the IRQ handler isn't running on another CPU. * kill off our tasklet
*/ */
synchronize_irq(port->irq); tasklet_kill(&info->tlet);
/* /*
* Free the transmit buffer page. * Free the transmit buffer page.
...@@ -244,15 +256,6 @@ static void uart_shutdown(struct uart_state *state) ...@@ -244,15 +256,6 @@ static void uart_shutdown(struct uart_state *state)
free_page((unsigned long)info->xmit.buf); free_page((unsigned long)info->xmit.buf);
info->xmit.buf = NULL; info->xmit.buf = NULL;
} }
/*
* kill off our tasklet
*/
tasklet_kill(&info->tlet);
if (info->tty)
set_bit(TTY_IO_ERROR, &info->tty->flags);
info->flags &= ~UIF_INITIALIZED;
} }
/** /**
...@@ -1928,14 +1931,25 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port) ...@@ -1928,14 +1931,25 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
if (state->info && state->info->flags & UIF_INITIALIZED) { if (state->info && state->info->flags & UIF_INITIALIZED) {
struct uart_ops *ops = port->ops; struct uart_ops *ops = port->ops;
int ret;
ops->set_mctrl(port, 0); ops->set_mctrl(port, 0);
ops->startup(port); ret = ops->startup(port);
uart_change_speed(state, NULL); if (ret == 0) {
spin_lock_irq(&port->lock); uart_change_speed(state, NULL);
ops->set_mctrl(port, port->mctrl); spin_lock_irq(&port->lock);
ops->start_tx(port); ops->set_mctrl(port, port->mctrl);
spin_unlock_irq(&port->lock); ops->start_tx(port);
spin_unlock_irq(&port->lock);
} else {
/*
* Failed to resume - maybe hardware went away?
* Clear the "initialized" flag so we won't try
* to call the low level drivers shutdown method.
*/
state->info->flags &= ~UIF_INITIALIZED;
uart_shutdown(state);
}
} }
up(&state->sem); up(&state->sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment