diff options
Diffstat (limited to 'drivers/serial/8250.c')
-rw-r--r-- | drivers/serial/8250.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index c3e37c8e7e26..a81ff7bc5fa1 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -83,6 +83,9 @@ static unsigned int skip_txen_test; /* force skip of txen test at init time */ | |||
83 | 83 | ||
84 | #define PASS_LIMIT 256 | 84 | #define PASS_LIMIT 256 |
85 | 85 | ||
86 | #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) | ||
87 | |||
88 | |||
86 | /* | 89 | /* |
87 | * We default to IRQ0 for the "no irq" hack. Some | 90 | * We default to IRQ0 for the "no irq" hack. Some |
88 | * machine types want others as well - they're free | 91 | * machine types want others as well - they're free |
@@ -1214,12 +1217,6 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags) | |||
1214 | } | 1217 | } |
1215 | #endif | 1218 | #endif |
1216 | 1219 | ||
1217 | #ifdef CONFIG_SERIAL_8250_AU1X00 | ||
1218 | /* if access method is AU, it is a 16550 with a quirk */ | ||
1219 | if (up->port.type == PORT_16550A && up->port.iotype == UPIO_AU) | ||
1220 | up->bugs |= UART_BUG_NOMSR; | ||
1221 | #endif | ||
1222 | |||
1223 | serial_outp(up, UART_LCR, save_lcr); | 1220 | serial_outp(up, UART_LCR, save_lcr); |
1224 | 1221 | ||
1225 | if (up->capabilities != uart_config[up->port.type].flags) { | 1222 | if (up->capabilities != uart_config[up->port.type].flags) { |
@@ -1792,7 +1789,7 @@ static unsigned int serial8250_tx_empty(struct uart_port *port) | |||
1792 | up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; | 1789 | up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; |
1793 | spin_unlock_irqrestore(&up->port.lock, flags); | 1790 | spin_unlock_irqrestore(&up->port.lock, flags); |
1794 | 1791 | ||
1795 | return lsr & UART_LSR_TEMT ? TIOCSER_TEMT : 0; | 1792 | return (lsr & BOTH_EMPTY) == BOTH_EMPTY ? TIOCSER_TEMT : 0; |
1796 | } | 1793 | } |
1797 | 1794 | ||
1798 | static unsigned int serial8250_get_mctrl(struct uart_port *port) | 1795 | static unsigned int serial8250_get_mctrl(struct uart_port *port) |
@@ -1850,8 +1847,6 @@ static void serial8250_break_ctl(struct uart_port *port, int break_state) | |||
1850 | spin_unlock_irqrestore(&up->port.lock, flags); | 1847 | spin_unlock_irqrestore(&up->port.lock, flags); |
1851 | } | 1848 | } |
1852 | 1849 | ||
1853 | #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) | ||
1854 | |||
1855 | /* | 1850 | /* |
1856 | * Wait for transmitter & holding register to empty | 1851 | * Wait for transmitter & holding register to empty |
1857 | */ | 1852 | */ |
@@ -2427,7 +2422,7 @@ serial8250_pm(struct uart_port *port, unsigned int state, | |||
2427 | static unsigned int serial8250_port_size(struct uart_8250_port *pt) | 2422 | static unsigned int serial8250_port_size(struct uart_8250_port *pt) |
2428 | { | 2423 | { |
2429 | if (pt->port.iotype == UPIO_AU) | 2424 | if (pt->port.iotype == UPIO_AU) |
2430 | return 0x100000; | 2425 | return 0x1000; |
2431 | #ifdef CONFIG_ARCH_OMAP | 2426 | #ifdef CONFIG_ARCH_OMAP |
2432 | if (is_omap_port(pt)) | 2427 | if (is_omap_port(pt)) |
2433 | return 0x16 << pt->port.regshift; | 2428 | return 0x16 << pt->port.regshift; |
@@ -2584,6 +2579,13 @@ static void serial8250_config_port(struct uart_port *port, int flags) | |||
2584 | 2579 | ||
2585 | if (flags & UART_CONFIG_TYPE) | 2580 | if (flags & UART_CONFIG_TYPE) |
2586 | autoconfig(up, probeflags); | 2581 | autoconfig(up, probeflags); |
2582 | |||
2583 | #ifdef CONFIG_SERIAL_8250_AU1X00 | ||
2584 | /* if access method is AU, it is a 16550 with a quirk */ | ||
2585 | if (up->port.type == PORT_16550A && up->port.iotype == UPIO_AU) | ||
2586 | up->bugs |= UART_BUG_NOMSR; | ||
2587 | #endif | ||
2588 | |||
2587 | if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ) | 2589 | if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ) |
2588 | autoconfig_irq(up); | 2590 | autoconfig_irq(up); |
2589 | 2591 | ||