aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/8250.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 12:13:29 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 12:13:29 -0400
commit6f3a28f7d1f0a65a78443c273b6e8ec01becf301 (patch)
treeea57276725b31ba115f44cb5267a7d85b133e6fb /drivers/serial/8250.c
parent6ebfc0e20b409f13e62bbb84ce70102b49945cfd (diff)
parent75fde2eddcfcd1dcc87a72dc6cd3c859420b6148 (diff)
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial
* '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 ...
Diffstat (limited to 'drivers/serial/8250.c')
-rw-r--r--drivers/serial/8250.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 10c2daab99ac..cc2a205d4230 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1896,6 +1896,17 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,
1896 serial_outp(up, UART_EFR, efr); 1896 serial_outp(up, UART_EFR, efr);
1897 } 1897 }
1898 1898
1899#ifdef CONFIG_ARCH_OMAP15XX
1900 /* Workaround to enable 115200 baud on OMAP1510 internal ports */
1901 if (cpu_is_omap1510() && is_omap_port((unsigned int)up->port.membase)) {
1902 if (baud == 115200) {
1903 quot = 1;
1904 serial_out(up, UART_OMAP_OSC_12M_SEL, 1);
1905 } else
1906 serial_out(up, UART_OMAP_OSC_12M_SEL, 0);
1907 }
1908#endif
1909
1899 if (up->capabilities & UART_NATSEMI) { 1910 if (up->capabilities & UART_NATSEMI) {
1900 /* Switch to bank 2 not bank 1, to avoid resetting EXCR2 */ 1911 /* Switch to bank 2 not bank 1, to avoid resetting EXCR2 */
1901 serial_outp(up, UART_LCR, 0xe0); 1912 serial_outp(up, UART_LCR, 0xe0);
@@ -1949,6 +1960,8 @@ static int serial8250_request_std_resource(struct uart_8250_port *up)
1949 case UPIO_AU: 1960 case UPIO_AU:
1950 size = 0x100000; 1961 size = 0x100000;
1951 /* fall thru */ 1962 /* fall thru */
1963 case UPIO_TSI:
1964 case UPIO_MEM32:
1952 case UPIO_MEM: 1965 case UPIO_MEM:
1953 if (!up->port.mapbase) 1966 if (!up->port.mapbase)
1954 break; 1967 break;
@@ -1984,6 +1997,8 @@ static void serial8250_release_std_resource(struct uart_8250_port *up)
1984 case UPIO_AU: 1997 case UPIO_AU:
1985 size = 0x100000; 1998 size = 0x100000;
1986 /* fall thru */ 1999 /* fall thru */
2000 case UPIO_TSI:
2001 case UPIO_MEM32:
1987 case UPIO_MEM: 2002 case UPIO_MEM:
1988 if (!up->port.mapbase) 2003 if (!up->port.mapbase)
1989 break; 2004 break;
@@ -2007,17 +2022,15 @@ static int serial8250_request_rsa_resource(struct uart_8250_port *up)
2007{ 2022{
2008 unsigned long start = UART_RSA_BASE << up->port.regshift; 2023 unsigned long start = UART_RSA_BASE << up->port.regshift;
2009 unsigned int size = 8 << up->port.regshift; 2024 unsigned int size = 8 << up->port.regshift;
2010 int ret = 0; 2025 int ret = -EINVAL;
2011 2026
2012 switch (up->port.iotype) { 2027 switch (up->port.iotype) {
2013 case UPIO_MEM:
2014 ret = -EINVAL;
2015 break;
2016
2017 case UPIO_HUB6: 2028 case UPIO_HUB6:
2018 case UPIO_PORT: 2029 case UPIO_PORT:
2019 start += up->port.iobase; 2030 start += up->port.iobase;
2020 if (!request_region(start, size, "serial-rsa")) 2031 if (request_region(start, size, "serial-rsa"))
2032 ret = 0;
2033 else
2021 ret = -EBUSY; 2034 ret = -EBUSY;
2022 break; 2035 break;
2023 } 2036 }
@@ -2031,9 +2044,6 @@ static void serial8250_release_rsa_resource(struct uart_8250_port *up)
2031 unsigned int size = 8 << up->port.regshift; 2044 unsigned int size = 8 << up->port.regshift;
2032 2045
2033 switch (up->port.iotype) { 2046 switch (up->port.iotype) {
2034 case UPIO_MEM:
2035 break;
2036
2037 case UPIO_HUB6: 2047 case UPIO_HUB6:
2038 case UPIO_PORT: 2048 case UPIO_PORT:
2039 release_region(up->port.iobase + offset, size); 2049 release_region(up->port.iobase + offset, size);
@@ -2222,9 +2232,10 @@ static inline void wait_for_xmitr(struct uart_8250_port *up, int bits)
2222 /* Wait up to 1s for flow control if necessary */ 2232 /* Wait up to 1s for flow control if necessary */
2223 if (up->port.flags & UPF_CONS_FLOW) { 2233 if (up->port.flags & UPF_CONS_FLOW) {
2224 tmout = 1000000; 2234 tmout = 1000000;
2225 while (--tmout && 2235 while (!(serial_in(up, UART_MSR) & UART_MSR_CTS) && --tmout) {
2226 ((serial_in(up, UART_MSR) & UART_MSR_CTS) == 0))
2227 udelay(1); 2236 udelay(1);
2237 touch_nmi_watchdog();
2238 }
2228 } 2239 }
2229} 2240}
2230 2241
@@ -2397,7 +2408,6 @@ int __init early_serial_setup(struct uart_port *port)
2397/** 2408/**
2398 * serial8250_suspend_port - suspend one serial port 2409 * serial8250_suspend_port - suspend one serial port
2399 * @line: serial line number 2410 * @line: serial line number
2400 * @level: the level of port suspension, as per uart_suspend_port
2401 * 2411 *
2402 * Suspend one serial port. 2412 * Suspend one serial port.
2403 */ 2413 */
@@ -2409,7 +2419,6 @@ void serial8250_suspend_port(int line)
2409/** 2419/**
2410 * serial8250_resume_port - resume one serial port 2420 * serial8250_resume_port - resume one serial port
2411 * @line: serial line number 2421 * @line: serial line number
2412 * @level: the level of port resumption, as per uart_resume_port
2413 * 2422 *
2414 * Resume one serial port. 2423 * Resume one serial port.
2415 */ 2424 */