Skip to content

Commit

Permalink
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial
Browse files Browse the repository at this point in the history
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial: (21 commits)
  [SERIAL] add PNP IDs for FPI based touchscreens
  [SERIAL] Magic SysRq SAK does nothing on serial consoles
  [SERIAL] tickle NMI watchdog on serial output.
  [SERIAL] Fix oops when removing suspended serial port
  [SERIAL] Fix resume handling bug
  [SERIAL] Remove wrong asm/serial.h inclusions
  [SERIAL] CONFIG_PM=n slim: drivers/serial/8250_pci.c
  [SERIAL] OMAP1510 serial fix for 115200 baud
  [SERIAL] returning proper error from serial core driver
  [SERIAL] Make uart_line_info() correctly tell MMIO from I/O port
  [SERIAL] suspend/resume handlers don't have level arg anymore
  [SERIAL] 8250 resourse management fixes
  [SERIAL] serial_cs: Add quirk for brainboxes 2-port RS232 card
  [SERIAL] serial_cs: handle Nokia multi->single port bodge via config quirk
  [SERIAL] serial_cs: add configuration quirk
  [SERIAL] serial_cs: Convert Oxford 950 / Possio GCC wakeup quirk
  [SERIAL] serial_cs: convert IBM post-init handling to a quirk
  [SERIAL] serial_cs: allow wildcarded quirks
  [SERIAL] serial_cs: convert multi-port table to quirk table
  [SERIAL] serial_cs: Use clean up multiport card detection
  ...
  • Loading branch information
Linus Torvalds committed Oct 3, 2006
2 parents 6ebfc0e + 75fde2e commit 6f3a28f
Show file tree
Hide file tree
Showing 14 changed files with 270 additions and 108 deletions.
1 change: 0 additions & 1 deletion arch/frv/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <linux/serial_reg.h>

#include <asm/setup.h>
#include <asm/serial.h>
#include <asm/irq.h>
#include <asm/sections.h>
#include <asm/pgalloc.h>
Expand Down
1 change: 0 additions & 1 deletion arch/ia64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
#include <asm/processor.h>
#include <asm/sal.h>
#include <asm/sections.h>
#include <asm/serial.h>
#include <asm/setup.h>
#include <asm/smp.h>
#include <asm/system.h>
Expand Down
1 change: 0 additions & 1 deletion arch/mips/cobalt/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <asm/processor.h>
#include <asm/reboot.h>
#include <asm/gt64120.h>
#include <asm/serial.h>

#include <asm/mach-cobalt/cobalt.h>

Expand Down
1 change: 0 additions & 1 deletion arch/mips/lasat/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <asm/cpu.h>
#include <asm/bootinfo.h>
#include <asm/irq.h>
#include <asm/serial.h>
#include <asm/lasat/lasat.h>
#include <asm/lasat/serial.h>

Expand Down
1 change: 0 additions & 1 deletion drivers/char/pcmcia/synclink_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
#include <linux/netdevice.h>
#include <linux/vmalloc.h>
#include <linux/init.h>
#include <asm/serial.h>
#include <linux/delay.h>
#include <linux/ioctl.h>

Expand Down
1 change: 0 additions & 1 deletion drivers/char/synclink.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@

#include <linux/vmalloc.h>
#include <linux/init.h>
#include <asm/serial.h>

#include <linux/delay.h>
#include <linux/ioctl.h>
Expand Down
35 changes: 22 additions & 13 deletions drivers/serial/8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,17 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
serial_outp(up, UART_EFR, efr);
}

#ifdef CONFIG_ARCH_OMAP15XX
/* Workaround to enable 115200 baud on OMAP1510 internal ports */
if (cpu_is_omap1510() && is_omap_port((unsigned int)up->port.membase)) {
if (baud == 115200) {
quot = 1;
serial_out(up, UART_OMAP_OSC_12M_SEL, 1);
} else
serial_out(up, UART_OMAP_OSC_12M_SEL, 0);
}
#endif

if (up->capabilities & UART_NATSEMI) {
/* Switch to bank 2 not bank 1, to avoid resetting EXCR2 */
serial_outp(up, UART_LCR, 0xe0);
Expand Down Expand Up @@ -1949,6 +1960,8 @@ static int serial8250_request_std_resource(struct uart_8250_port *up)
case UPIO_AU:
size = 0x100000;
/* fall thru */
case UPIO_TSI:
case UPIO_MEM32:
case UPIO_MEM:
if (!up->port.mapbase)
break;
Expand Down Expand Up @@ -1984,6 +1997,8 @@ static void serial8250_release_std_resource(struct uart_8250_port *up)
case UPIO_AU:
size = 0x100000;
/* fall thru */
case UPIO_TSI:
case UPIO_MEM32:
case UPIO_MEM:
if (!up->port.mapbase)
break;
Expand All @@ -2007,17 +2022,15 @@ static int serial8250_request_rsa_resource(struct uart_8250_port *up)
{
unsigned long start = UART_RSA_BASE << up->port.regshift;
unsigned int size = 8 << up->port.regshift;
int ret = 0;
int ret = -EINVAL;

switch (up->port.iotype) {
case UPIO_MEM:
ret = -EINVAL;
break;

case UPIO_HUB6:
case UPIO_PORT:
start += up->port.iobase;
if (!request_region(start, size, "serial-rsa"))
if (request_region(start, size, "serial-rsa"))
ret = 0;
else
ret = -EBUSY;
break;
}
Expand All @@ -2031,9 +2044,6 @@ static void serial8250_release_rsa_resource(struct uart_8250_port *up)
unsigned int size = 8 << up->port.regshift;

switch (up->port.iotype) {
case UPIO_MEM:
break;

case UPIO_HUB6:
case UPIO_PORT:
release_region(up->port.iobase + offset, size);
Expand Down Expand Up @@ -2222,9 +2232,10 @@ static inline void wait_for_xmitr(struct uart_8250_port *up, int bits)
/* Wait up to 1s for flow control if necessary */
if (up->port.flags & UPF_CONS_FLOW) {
tmout = 1000000;
while (--tmout &&
((serial_in(up, UART_MSR) & UART_MSR_CTS) == 0))
while (!(serial_in(up, UART_MSR) & UART_MSR_CTS) && --tmout) {
udelay(1);
touch_nmi_watchdog();
}
}
}

Expand Down Expand Up @@ -2397,7 +2408,6 @@ int __init early_serial_setup(struct uart_port *port)
/**
* serial8250_suspend_port - suspend one serial port
* @line: serial line number
* @level: the level of port suspension, as per uart_suspend_port
*
* Suspend one serial port.
*/
Expand All @@ -2409,7 +2419,6 @@ void serial8250_suspend_port(int line)
/**
* serial8250_resume_port - resume one serial port
* @line: serial line number
* @level: the level of port resumption, as per uart_resume_port
*
* Resume one serial port.
*/
Expand Down
4 changes: 4 additions & 0 deletions drivers/serial/8250_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,7 @@ static void __devexit pciserial_remove_one(struct pci_dev *dev)
pci_disable_device(dev);
}

#ifdef CONFIG_PM
static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
{
struct serial_private *priv = pci_get_drvdata(dev);
Expand Down Expand Up @@ -1818,6 +1819,7 @@ static int pciserial_resume_one(struct pci_dev *dev)
}
return 0;
}
#endif

static struct pci_device_id serial_pci_tbl[] = {
{ PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
Expand Down Expand Up @@ -2375,8 +2377,10 @@ static struct pci_driver serial_pci_driver = {
.name = "serial",
.probe = pciserial_init_one,
.remove = __devexit_p(pciserial_remove_one),
#ifdef CONFIG_PM
.suspend = pciserial_suspend_one,
.resume = pciserial_resume_one,
#endif
.id_table = serial_pci_tbl,
};

Expand Down
13 changes: 13 additions & 0 deletions drivers/serial/8250_pnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,19 @@ static const struct pnp_device_id pnp_dev_table[] = {
{ "WACF004", 0 },
{ "WACF005", 0 },
{ "WACF006", 0 },
/* Compaq touchscreen */
{ "FPI2002", 0 },
/* Fujitsu Stylistic touchscreens */
{ "FUJ02B2", 0 },
{ "FUJ02B3", 0 },
/* Fujitsu Stylistic LT touchscreens */
{ "FUJ02B4", 0 },
/* Passive Fujitsu Stylistic touchscreens */
{ "FUJ02B6", 0 },
{ "FUJ02B7", 0 },
{ "FUJ02B8", 0 },
{ "FUJ02B9", 0 },
{ "FUJ02BC", 0 },
/* Rockwell's (PORALiNK) 33600 INT PNP */
{ "WCI0003", 0 },
/* Unkown PnP modems */
Expand Down
5 changes: 2 additions & 3 deletions drivers/serial/m32r_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
*/
#define is_real_interrupt(irq) ((irq) != 0)

#include <asm/serial.h>
#define BASE_BAUD 115200

/* Standard COM flags */
#define STD_COM_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST)
Expand All @@ -86,7 +86,6 @@
* standard enumeration mechanism. Platforms that can find all
* serial ports via mechanisms like ACPI or PCI need not supply it.
*/
#undef SERIAL_PORT_DFNS
#if defined(CONFIG_PLAT_USRV)

#define SERIAL_PORT_DFNS \
Expand All @@ -109,7 +108,7 @@
#endif /* !CONFIG_PLAT_USRV */

static struct old_serial_port old_serial_port[] = {
SERIAL_PORT_DFNS /* defined in asm/serial.h */
SERIAL_PORT_DFNS
};

#define UART_NR ARRAY_SIZE(old_serial_port)
Expand Down
18 changes: 12 additions & 6 deletions drivers/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ static int uart_set_info(struct uart_state *state,
* We failed anyway.
*/
retval = -EBUSY;
goto exit; // Added to return the correct error -Ram Gupta
}
}

Expand Down Expand Up @@ -1662,16 +1663,16 @@ static int uart_line_info(char *buf, struct uart_driver *drv, int i)
struct uart_port *port = state->port;
char stat_buf[32];
unsigned int status;
int ret;
int mmio, ret;

if (!port)
return 0;

mmio = port->iotype >= UPIO_MEM;
ret = sprintf(buf, "%d: uart:%s %s%08lX irq:%d",
port->line, uart_type(port),
port->iotype == UPIO_MEM ? "mmio:0x" : "port:",
port->iotype == UPIO_MEM ? port->mapbase :
(unsigned long) port->iobase,
mmio ? "mmio:0x" : "port:",
mmio ? port->mapbase : (unsigned long) port->iobase,
port->irq);

if (port->type == PORT_UNKNOWN) {
Expand Down Expand Up @@ -1939,6 +1940,9 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
if (state->info && state->info->flags & UIF_INITIALIZED) {
const struct uart_ops *ops = port->ops;

state->info->flags = (state->info->flags & ~UIF_INITIALIZED)
| UIF_SUSPENDED;

spin_lock_irq(&port->lock);
ops->stop_tx(port);
ops->set_mctrl(port, 0);
Expand Down Expand Up @@ -2005,7 +2009,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
console_start(port->cons);
}

if (state->info && state->info->flags & UIF_INITIALIZED) {
if (state->info && state->info->flags & UIF_SUSPENDED) {
const struct uart_ops *ops = port->ops;
int ret;

Expand All @@ -2017,15 +2021,17 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
ops->set_mctrl(port, port->mctrl);
ops->start_tx(port);
spin_unlock_irq(&port->lock);
state->info->flags |= UIF_INITIALIZED;
} 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);
}

state->info->flags &= ~UIF_SUSPENDED;
}

mutex_unlock(&state->mutex);
Expand Down
Loading

0 comments on commit 6f3a28f

Please sign in to comment.