Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145349
b: refs/heads/master
c: b8e7e40
h: refs/heads/master
i:
  145347: cc9a890
v: v3
  • Loading branch information
Alan Cox authored and Linus Torvalds committed May 29, 2009
1 parent 93d6baf commit 680e4e0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 715fe7af9fd7328af661742bfadc195e665a837f
refs/heads/master: b8e7e40abeac49644fec4a4f52ffe74c7b05eca0
15 changes: 15 additions & 0 deletions trunk/drivers/serial/8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ struct uart_8250_port {
unsigned char mcr;
unsigned char mcr_mask; /* mask of user bits */
unsigned char mcr_force; /* mask of forced bits */
unsigned char cur_iotype; /* Running I/O type */

/*
* Some bits in registers are cleared on a read, so they must
Expand Down Expand Up @@ -471,6 +472,7 @@ static void io_serial_out(struct uart_port *p, int offset, int value)

static void set_io_from_upio(struct uart_port *p)
{
struct uart_8250_port *up = (struct uart_8250_port *)p;
switch (p->iotype) {
case UPIO_HUB6:
p->serial_in = hub6_serial_in;
Expand Down Expand Up @@ -509,6 +511,8 @@ static void set_io_from_upio(struct uart_port *p)
p->serial_out = io_serial_out;
break;
}
/* Remember loaded iotype */
up->cur_iotype = p->iotype;
}

static void
Expand Down Expand Up @@ -1937,6 +1941,9 @@ static int serial8250_startup(struct uart_port *port)
up->capabilities = uart_config[up->port.type].flags;
up->mcr = 0;

if (up->port.iotype != up->cur_iotype)
set_io_from_upio(port);

if (up->port.type == PORT_16C950) {
/* Wake up and initialize UART */
up->acr = 0;
Expand Down Expand Up @@ -2563,6 +2570,9 @@ static void serial8250_config_port(struct uart_port *port, int flags)
if (ret < 0)
probeflags &= ~PROBE_RSA;

if (up->port.iotype != up->cur_iotype)
set_io_from_upio(port);

if (flags & UART_CONFIG_TYPE)
autoconfig(up, probeflags);
if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ)
Expand Down Expand Up @@ -2671,6 +2681,11 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev)
{
int i;

for (i = 0; i < nr_uarts; i++) {
struct uart_8250_port *up = &serial8250_ports[i];
up->cur_iotype = 0xFF;
}

serial8250_isa_init_ports();

for (i = 0; i < nr_uarts; i++) {
Expand Down

0 comments on commit 680e4e0

Please sign in to comment.