]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial
authorLinus Torvalds <torvalds@g5.osdl.org>
Tue, 3 Oct 2006 16:13:29 +0000 (09:13 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 3 Oct 2006 16:13:29 +0000 (09:13 -0700)
* '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
  ...

1  2 
drivers/char/pcmcia/synclink_cs.c
drivers/char/synclink.c
drivers/serial/8250.c
drivers/serial/serial_core.c

index dd845cbefe94c271147d47031eb6e1767ce86d10,539efe7826185fe8c4fc72709b8a35ffa8be22b9..d1ecb2c6de98719803479876d3e9ea0d7f185c03
@@@ -57,7 -57,6 +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>
  
@@@ -3010,7 -3009,7 +3009,7 @@@ static struct pcmcia_driver mgslpc_driv
        .resume         = mgslpc_resume,
  };
  
 -static struct tty_operations mgslpc_ops = {
 +static const struct tty_operations mgslpc_ops = {
        .open = mgslpc_open,
        .close = mgslpc_close,
        .write = mgslpc_write,
diff --combined drivers/char/synclink.c
index 244dc308c7709cc18bfc5e608d63178fe6dc8cdb,c53f4579a59fa6e8e8beb8634e071f29940fd0ca..38d94987de8343988faa9ef3ffe0049a61d5be60
@@@ -87,7 -87,6 +87,6 @@@
  
  #include <linux/vmalloc.h>
  #include <linux/init.h>
- #include <asm/serial.h>
  
  #include <linux/delay.h>
  #include <linux/ioctl.h>
@@@ -4360,7 -4359,7 +4359,7 @@@ static struct mgsl_struct* mgsl_allocat
  
  }     /* end of mgsl_allocate_device()*/
  
 -static struct tty_operations mgsl_ops = {
 +static const struct tty_operations mgsl_ops = {
        .open = mgsl_open,
        .close = mgsl_close,
        .write = mgsl_write,
diff --combined drivers/serial/8250.c
index 10c2daab99ac1522ca224a6a7407eb6168fa6b19,0ede0ee64243fa24271b13224aa445fc4b7c8152..cc2a205d42300af96e6f0ecfda63172c5e151425
@@@ -320,8 -320,8 +320,8 @@@ static unsigned int serial_in(struct ua
  
        case UPIO_TSI:
                if (offset == UART_IIR) {
 -                      tmp = readl((u32 *)(up->port.membase + UART_RX));
 -                      return (cpu_to_le32(tmp) >> 8) & 0xff;
 +                      tmp = readl(up->port.membase + (UART_IIR & ~3));
 +                      return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */
                } else
                        return readb(up->port.membase + offset);
  
@@@ -1896,6 -1896,17 +1896,17 @@@ serial8250_set_termios(struct uart_por
                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);
@@@ -1949,6 -1960,8 +1960,8 @@@ static int serial8250_request_std_resou
        case UPIO_AU:
                size = 0x100000;
                /* fall thru */
+       case UPIO_TSI:
+       case UPIO_MEM32:
        case UPIO_MEM:
                if (!up->port.mapbase)
                        break;
@@@ -1984,6 -1997,8 +1997,8 @@@ static void serial8250_release_std_reso
        case UPIO_AU:
                size = 0x100000;
                /* fall thru */
+       case UPIO_TSI:
+       case UPIO_MEM32:
        case UPIO_MEM:
                if (!up->port.mapbase)
                        break;
@@@ -2007,17 -2022,15 +2022,15 @@@ static int serial8250_request_rsa_resou
  {
        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;
        }
@@@ -2031,9 -2044,6 +2044,6 @@@ static void serial8250_release_rsa_reso
        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);
@@@ -2222,9 -2232,10 +2232,10 @@@ static inline void wait_for_xmitr(struc
        /* 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();
+               }
        }
  }
  
@@@ -2397,7 -2408,6 +2408,6 @@@ int __init early_serial_setup(struct ua
  /**
   *    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.
   */
@@@ -2409,7 -2419,6 +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.
   */
index de5e8930a6fd49d64e332919f4d358ef0c3549d4,397147a7054f39fa0d4cb11dfd4d7e31f2954df3..c67b05e9a45144c3410c23ed0050f4f70ec26c9a
@@@ -792,6 -792,7 +792,7 @@@ static int uart_set_info(struct uart_st
                         * We failed anyway.
                         */
                        retval = -EBUSY;
+                       goto exit;  // Added to return the correct error -Ram Gupta
                }
        }
  
@@@ -1662,16 -1663,16 +1663,16 @@@ static int uart_line_info(char *buf, st
        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) {
@@@ -1939,6 -1940,9 +1940,9 @@@ int uart_suspend_port(struct uart_drive
        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);
@@@ -2005,7 -2009,7 +2009,7 @@@ int uart_resume_port(struct uart_drive
                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;
  
                        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);
@@@ -2111,7 -2117,7 +2117,7 @@@ uart_configure_port(struct uart_driver 
        }
  }
  
 -static struct tty_operations uart_ops = {
 +static const struct tty_operations uart_ops = {
        .open           = uart_open,
        .close          = uart_close,
        .write          = uart_write,