aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-06-08 14:27:13 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-06-08 14:27:13 -0400
commit7698fdedcfa3cab3dd40c9b685590b23be02e267 (patch)
tree207ddae0f963174356b1a9de7fff8e48a9c1e9c1 /drivers/serial
parent2d8d24935d372175786ebefa8a2de8680831b67f (diff)
parentae5c8c83735f5fcb09b380944e4854a383006998 (diff)
Merge branch 'for-rmk' of git://git.marvell.com/orion into devel
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/8250.c15
-rw-r--r--drivers/serial/8250_gsc.c4
-rw-r--r--drivers/serial/mpc52xx_uart.c2
3 files changed, 18 insertions, 3 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index b4b39811b445..a0127e93ade0 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -137,6 +137,7 @@ struct uart_8250_port {
137 unsigned char mcr; 137 unsigned char mcr;
138 unsigned char mcr_mask; /* mask of user bits */ 138 unsigned char mcr_mask; /* mask of user bits */
139 unsigned char mcr_force; /* mask of forced bits */ 139 unsigned char mcr_force; /* mask of forced bits */
140 unsigned char cur_iotype; /* Running I/O type */
140 141
141 /* 142 /*
142 * Some bits in registers are cleared on a read, so they must 143 * Some bits in registers are cleared on a read, so they must
@@ -471,6 +472,7 @@ static void io_serial_out(struct uart_port *p, int offset, int value)
471 472
472static void set_io_from_upio(struct uart_port *p) 473static void set_io_from_upio(struct uart_port *p)
473{ 474{
475 struct uart_8250_port *up = (struct uart_8250_port *)p;
474 switch (p->iotype) { 476 switch (p->iotype) {
475 case UPIO_HUB6: 477 case UPIO_HUB6:
476 p->serial_in = hub6_serial_in; 478 p->serial_in = hub6_serial_in;
@@ -509,6 +511,8 @@ static void set_io_from_upio(struct uart_port *p)
509 p->serial_out = io_serial_out; 511 p->serial_out = io_serial_out;
510 break; 512 break;
511 } 513 }
514 /* Remember loaded iotype */
515 up->cur_iotype = p->iotype;
512} 516}
513 517
514static void 518static void
@@ -1937,6 +1941,9 @@ static int serial8250_startup(struct uart_port *port)
1937 up->capabilities = uart_config[up->port.type].flags; 1941 up->capabilities = uart_config[up->port.type].flags;
1938 up->mcr = 0; 1942 up->mcr = 0;
1939 1943
1944 if (up->port.iotype != up->cur_iotype)
1945 set_io_from_upio(port);
1946
1940 if (up->port.type == PORT_16C950) { 1947 if (up->port.type == PORT_16C950) {
1941 /* Wake up and initialize UART */ 1948 /* Wake up and initialize UART */
1942 up->acr = 0; 1949 up->acr = 0;
@@ -2563,6 +2570,9 @@ static void serial8250_config_port(struct uart_port *port, int flags)
2563 if (ret < 0) 2570 if (ret < 0)
2564 probeflags &= ~PROBE_RSA; 2571 probeflags &= ~PROBE_RSA;
2565 2572
2573 if (up->port.iotype != up->cur_iotype)
2574 set_io_from_upio(port);
2575
2566 if (flags & UART_CONFIG_TYPE) 2576 if (flags & UART_CONFIG_TYPE)
2567 autoconfig(up, probeflags); 2577 autoconfig(up, probeflags);
2568 if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ) 2578 if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ)
@@ -2671,6 +2681,11 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev)
2671{ 2681{
2672 int i; 2682 int i;
2673 2683
2684 for (i = 0; i < nr_uarts; i++) {
2685 struct uart_8250_port *up = &serial8250_ports[i];
2686 up->cur_iotype = 0xFF;
2687 }
2688
2674 serial8250_isa_init_ports(); 2689 serial8250_isa_init_ports();
2675 2690
2676 for (i = 0; i < nr_uarts; i++) { 2691 for (i = 0; i < nr_uarts; i++) {
diff --git a/drivers/serial/8250_gsc.c b/drivers/serial/8250_gsc.c
index 418b4fe9a0a1..33149d982e82 100644
--- a/drivers/serial/8250_gsc.c
+++ b/drivers/serial/8250_gsc.c
@@ -39,9 +39,9 @@ static int __init serial_init_chip(struct parisc_device *dev)
39 */ 39 */
40 if (parisc_parent(dev)->id.hw_type != HPHW_IOA) 40 if (parisc_parent(dev)->id.hw_type != HPHW_IOA)
41 printk(KERN_INFO 41 printk(KERN_INFO
42 "Serial: device 0x%lx not configured.\n" 42 "Serial: device 0x%llx not configured.\n"
43 "Enable support for Wax, Lasi, Asp or Dino.\n", 43 "Enable support for Wax, Lasi, Asp or Dino.\n",
44 dev->hpa.start); 44 (unsigned long long)dev->hpa.start);
45 return -ENODEV; 45 return -ENODEV;
46 } 46 }
47 47
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 7f72f8ceaa6f..b3feb6198d57 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -988,7 +988,7 @@ mpc52xx_console_setup(struct console *co, char *options)
988 pr_debug("mpc52xx_console_setup co=%p, co->index=%i, options=%s\n", 988 pr_debug("mpc52xx_console_setup co=%p, co->index=%i, options=%s\n",
989 co, co->index, options); 989 co, co->index, options);
990 990
991 if ((co->index < 0) || (co->index > MPC52xx_PSC_MAXNUM)) { 991 if ((co->index < 0) || (co->index >= MPC52xx_PSC_MAXNUM)) {
992 pr_debug("PSC%x out of range\n", co->index); 992 pr_debug("PSC%x out of range\n", co->index);
993 return -EINVAL; 993 return -EINVAL;
994 } 994 }