diff options
author | Paul Mackerras <paulus@samba.org> | 2005-10-30 21:37:12 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-30 21:37:12 -0500 |
commit | 23fd07750a789a66fe88cf173d52a18f1a387da4 (patch) | |
tree | 06fdd6df35fdb835abdaa9b754d62f6b84b97250 /drivers/serial | |
parent | bd787d438a59266af3c9f6351644c85ef1dd21fe (diff) | |
parent | ed28f96ac1960f30f818374d65be71d2fdf811b0 (diff) |
Merge ../linux-2.6 by hand
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/8250.c | 10 | ||||
-rw-r--r-- | drivers/serial/8250_gsc.c | 6 | ||||
-rw-r--r-- | drivers/serial/amba-pl010.c | 1 | ||||
-rw-r--r-- | drivers/serial/amba-pl011.c | 1 | ||||
-rw-r--r-- | drivers/serial/clps711x.c | 9 | ||||
-rw-r--r-- | drivers/serial/imx.c | 8 | ||||
-rw-r--r-- | drivers/serial/ioc4_serial.c | 80 | ||||
-rw-r--r-- | drivers/serial/mpc52xx_uart.c | 8 | ||||
-rw-r--r-- | drivers/serial/mpsc.c | 2 | ||||
-rw-r--r-- | drivers/serial/mux.c | 11 | ||||
-rw-r--r-- | drivers/serial/pxa.c | 29 | ||||
-rw-r--r-- | drivers/serial/s3c2410.c | 9 | ||||
-rw-r--r-- | drivers/serial/sa1100.c | 8 | ||||
-rw-r--r-- | drivers/serial/serial_core.c | 3 | ||||
-rw-r--r-- | drivers/serial/vr41xx_siu.c | 10 |
15 files changed, 112 insertions, 83 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 4d75cdfa0a0a..afb7ddf200e0 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -2358,13 +2358,10 @@ static int __devexit serial8250_remove(struct device *dev) | |||
2358 | return 0; | 2358 | return 0; |
2359 | } | 2359 | } |
2360 | 2360 | ||
2361 | static int serial8250_suspend(struct device *dev, pm_message_t state, u32 level) | 2361 | static int serial8250_suspend(struct device *dev, pm_message_t state) |
2362 | { | 2362 | { |
2363 | int i; | 2363 | int i; |
2364 | 2364 | ||
2365 | if (level != SUSPEND_DISABLE) | ||
2366 | return 0; | ||
2367 | |||
2368 | for (i = 0; i < UART_NR; i++) { | 2365 | for (i = 0; i < UART_NR; i++) { |
2369 | struct uart_8250_port *up = &serial8250_ports[i]; | 2366 | struct uart_8250_port *up = &serial8250_ports[i]; |
2370 | 2367 | ||
@@ -2375,13 +2372,10 @@ static int serial8250_suspend(struct device *dev, pm_message_t state, u32 level) | |||
2375 | return 0; | 2372 | return 0; |
2376 | } | 2373 | } |
2377 | 2374 | ||
2378 | static int serial8250_resume(struct device *dev, u32 level) | 2375 | static int serial8250_resume(struct device *dev) |
2379 | { | 2376 | { |
2380 | int i; | 2377 | int i; |
2381 | 2378 | ||
2382 | if (level != RESUME_ENABLE) | ||
2383 | return 0; | ||
2384 | |||
2385 | for (i = 0; i < UART_NR; i++) { | 2379 | for (i = 0; i < UART_NR; i++) { |
2386 | struct uart_8250_port *up = &serial8250_ports[i]; | 2380 | struct uart_8250_port *up = &serial8250_ports[i]; |
2387 | 2381 | ||
diff --git a/drivers/serial/8250_gsc.c b/drivers/serial/8250_gsc.c index 431aa5761a7a..8b4947933d9b 100644 --- a/drivers/serial/8250_gsc.c +++ b/drivers/serial/8250_gsc.c | |||
@@ -29,7 +29,6 @@ | |||
29 | static int __init | 29 | static int __init |
30 | serial_init_chip(struct parisc_device *dev) | 30 | serial_init_chip(struct parisc_device *dev) |
31 | { | 31 | { |
32 | static int serial_line_nr; | ||
33 | struct uart_port port; | 32 | struct uart_port port; |
34 | unsigned long address; | 33 | unsigned long address; |
35 | int err; | 34 | int err; |
@@ -42,12 +41,13 @@ serial_init_chip(struct parisc_device *dev) | |||
42 | */ | 41 | */ |
43 | if (parisc_parent(dev)->id.hw_type != HPHW_IOA) { | 42 | if (parisc_parent(dev)->id.hw_type != HPHW_IOA) { |
44 | printk(KERN_INFO "Serial: device 0x%lx not configured.\n" | 43 | printk(KERN_INFO "Serial: device 0x%lx not configured.\n" |
45 | "Enable support for Wax, Lasi, Asp or Dino.\n", dev->hpa); | 44 | "Enable support for Wax, Lasi, Asp or Dino.\n", |
45 | dev->hpa.start); | ||
46 | } | 46 | } |
47 | return -ENODEV; | 47 | return -ENODEV; |
48 | } | 48 | } |
49 | 49 | ||
50 | address = dev->hpa; | 50 | address = dev->hpa.start; |
51 | if (dev->id.sversion != 0x8d) { | 51 | if (dev->id.sversion != 0x8d) { |
52 | address += 0x800; | 52 | address += 0x800; |
53 | } | 53 | } |
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c index 679e678c7e6a..ddd0307fece2 100644 --- a/drivers/serial/amba-pl010.c +++ b/drivers/serial/amba-pl010.c | |||
@@ -50,6 +50,7 @@ | |||
50 | 50 | ||
51 | #include <asm/io.h> | 51 | #include <asm/io.h> |
52 | #include <asm/irq.h> | 52 | #include <asm/irq.h> |
53 | #include <asm/hardware.h> | ||
53 | #include <asm/hardware/amba.h> | 54 | #include <asm/hardware/amba.h> |
54 | #include <asm/hardware/amba_serial.h> | 55 | #include <asm/hardware/amba_serial.h> |
55 | 56 | ||
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 1ff629c74750..938d185841c9 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c | |||
@@ -50,6 +50,7 @@ | |||
50 | 50 | ||
51 | #include <asm/io.h> | 51 | #include <asm/io.h> |
52 | #include <asm/irq.h> | 52 | #include <asm/irq.h> |
53 | #include <asm/sizes.h> | ||
53 | #include <asm/hardware/amba.h> | 54 | #include <asm/hardware/amba.h> |
54 | #include <asm/hardware/clock.h> | 55 | #include <asm/hardware/clock.h> |
55 | #include <asm/hardware/amba_serial.h> | 56 | #include <asm/hardware/amba_serial.h> |
diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c index 87ef368384fb..6a67e8f585b3 100644 --- a/drivers/serial/clps711x.c +++ b/drivers/serial/clps711x.c | |||
@@ -408,7 +408,11 @@ static struct uart_port clps711x_ports[UART_NR] = { | |||
408 | { | 408 | { |
409 | .iobase = SYSCON1, | 409 | .iobase = SYSCON1, |
410 | .irq = IRQ_UTXINT1, /* IRQ_URXINT1, IRQ_UMSINT */ | 410 | .irq = IRQ_UTXINT1, /* IRQ_URXINT1, IRQ_UMSINT */ |
411 | #ifdef CONFIG_MP1000_90MHZ | ||
412 | .uartclk = 4515840, | ||
413 | #else | ||
411 | .uartclk = 3686400, | 414 | .uartclk = 3686400, |
415 | #endif | ||
412 | .fifosize = 16, | 416 | .fifosize = 16, |
413 | .ops = &clps711x_pops, | 417 | .ops = &clps711x_pops, |
414 | .line = 0, | 418 | .line = 0, |
@@ -417,7 +421,11 @@ static struct uart_port clps711x_ports[UART_NR] = { | |||
417 | { | 421 | { |
418 | .iobase = SYSCON2, | 422 | .iobase = SYSCON2, |
419 | .irq = IRQ_UTXINT2, /* IRQ_URXINT2 */ | 423 | .irq = IRQ_UTXINT2, /* IRQ_URXINT2 */ |
424 | #ifdef CONFIG_MP1000_90MHZ | ||
425 | .uartclk = 4515840, | ||
426 | #else | ||
420 | .uartclk = 3686400, | 427 | .uartclk = 3686400, |
428 | #endif | ||
421 | .fifosize = 16, | 429 | .fifosize = 16, |
422 | .ops = &clps711x_pops, | 430 | .ops = &clps711x_pops, |
423 | .line = 1, | 431 | .line = 1, |
@@ -551,6 +559,7 @@ console_initcall(clps711xuart_console_init); | |||
551 | static struct uart_driver clps711x_reg = { | 559 | static struct uart_driver clps711x_reg = { |
552 | .driver_name = "ttyCL", | 560 | .driver_name = "ttyCL", |
553 | .dev_name = "ttyCL", | 561 | .dev_name = "ttyCL", |
562 | .devfs_name = "ttyCL", | ||
554 | .major = SERIAL_CLPS711X_MAJOR, | 563 | .major = SERIAL_CLPS711X_MAJOR, |
555 | .minor = SERIAL_CLPS711X_MINOR, | 564 | .minor = SERIAL_CLPS711X_MINOR, |
556 | .nr = UART_NR, | 565 | .nr = UART_NR, |
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index bdb4e454b8b0..5b3933b0c997 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
@@ -921,21 +921,21 @@ static struct uart_driver imx_reg = { | |||
921 | .cons = IMX_CONSOLE, | 921 | .cons = IMX_CONSOLE, |
922 | }; | 922 | }; |
923 | 923 | ||
924 | static int serial_imx_suspend(struct device *_dev, pm_message_t state, u32 level) | 924 | static int serial_imx_suspend(struct device *_dev, pm_message_t state) |
925 | { | 925 | { |
926 | struct imx_port *sport = dev_get_drvdata(_dev); | 926 | struct imx_port *sport = dev_get_drvdata(_dev); |
927 | 927 | ||
928 | if (sport && level == SUSPEND_DISABLE) | 928 | if (sport) |
929 | uart_suspend_port(&imx_reg, &sport->port); | 929 | uart_suspend_port(&imx_reg, &sport->port); |
930 | 930 | ||
931 | return 0; | 931 | return 0; |
932 | } | 932 | } |
933 | 933 | ||
934 | static int serial_imx_resume(struct device *_dev, u32 level) | 934 | static int serial_imx_resume(struct device *_dev) |
935 | { | 935 | { |
936 | struct imx_port *sport = dev_get_drvdata(_dev); | 936 | struct imx_port *sport = dev_get_drvdata(_dev); |
937 | 937 | ||
938 | if (sport && level == RESUME_ENABLE) | 938 | if (sport) |
939 | uart_resume_port(&imx_reg, &sport->port); | 939 | uart_resume_port(&imx_reg, &sport->port); |
940 | 940 | ||
941 | return 0; | 941 | return 0; |
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c index f88fdd480685..771676abee60 100644 --- a/drivers/serial/ioc4_serial.c +++ b/drivers/serial/ioc4_serial.c | |||
@@ -308,6 +308,8 @@ struct ioc4_serial { | |||
308 | typedef void ioc4_intr_func_f(void *, uint32_t); | 308 | typedef void ioc4_intr_func_f(void *, uint32_t); |
309 | typedef ioc4_intr_func_f *ioc4_intr_func_t; | 309 | typedef ioc4_intr_func_f *ioc4_intr_func_t; |
310 | 310 | ||
311 | static unsigned int Num_of_ioc4_cards; | ||
312 | |||
311 | /* defining this will get you LOTS of great debug info */ | 313 | /* defining this will get you LOTS of great debug info */ |
312 | //#define DEBUG_INTERRUPTS | 314 | //#define DEBUG_INTERRUPTS |
313 | #define DPRINT_CONFIG(_x...) ; | 315 | #define DPRINT_CONFIG(_x...) ; |
@@ -317,7 +319,8 @@ typedef ioc4_intr_func_f *ioc4_intr_func_t; | |||
317 | #define WAKEUP_CHARS 256 | 319 | #define WAKEUP_CHARS 256 |
318 | 320 | ||
319 | /* number of characters we want to transmit to the lower level at a time */ | 321 | /* number of characters we want to transmit to the lower level at a time */ |
320 | #define IOC4_MAX_CHARS 128 | 322 | #define IOC4_MAX_CHARS 256 |
323 | #define IOC4_FIFO_CHARS 255 | ||
321 | 324 | ||
322 | /* Device name we're using */ | 325 | /* Device name we're using */ |
323 | #define DEVICE_NAME "ttyIOC" | 326 | #define DEVICE_NAME "ttyIOC" |
@@ -1038,6 +1041,7 @@ static int inline ioc4_attach_local(struct ioc4_driver_data *idd) | |||
1038 | return -ENOMEM; | 1041 | return -ENOMEM; |
1039 | } | 1042 | } |
1040 | memset(port, 0, sizeof(struct ioc4_port)); | 1043 | memset(port, 0, sizeof(struct ioc4_port)); |
1044 | spin_lock_init(&port->ip_lock); | ||
1041 | 1045 | ||
1042 | /* we need to remember the previous ones, to point back to | 1046 | /* we need to remember the previous ones, to point back to |
1043 | * them farther down - setting up the ring buffers. | 1047 | * them farther down - setting up the ring buffers. |
@@ -1691,12 +1695,14 @@ ioc4_change_speed(struct uart_port *the_port, | |||
1691 | baud = 9600; | 1695 | baud = 9600; |
1692 | 1696 | ||
1693 | if (!the_port->fifosize) | 1697 | if (!the_port->fifosize) |
1694 | the_port->fifosize = IOC4_MAX_CHARS; | 1698 | the_port->fifosize = IOC4_FIFO_CHARS; |
1695 | the_port->timeout = ((the_port->fifosize * HZ * bits) / (baud / 10)); | 1699 | the_port->timeout = ((the_port->fifosize * HZ * bits) / (baud / 10)); |
1696 | the_port->timeout += HZ / 50; /* Add .02 seconds of slop */ | 1700 | the_port->timeout += HZ / 50; /* Add .02 seconds of slop */ |
1697 | 1701 | ||
1698 | the_port->ignore_status_mask = N_ALL_INPUT; | 1702 | the_port->ignore_status_mask = N_ALL_INPUT; |
1699 | 1703 | ||
1704 | info->tty->low_latency = 1; | ||
1705 | |||
1700 | if (I_IGNPAR(info->tty)) | 1706 | if (I_IGNPAR(info->tty)) |
1701 | the_port->ignore_status_mask &= ~(N_PARITY_ERROR | 1707 | the_port->ignore_status_mask &= ~(N_PARITY_ERROR |
1702 | | N_FRAMING_ERROR); | 1708 | | N_FRAMING_ERROR); |
@@ -1742,7 +1748,6 @@ ioc4_change_speed(struct uart_port *the_port, | |||
1742 | */ | 1748 | */ |
1743 | static inline int ic4_startup_local(struct uart_port *the_port) | 1749 | static inline int ic4_startup_local(struct uart_port *the_port) |
1744 | { | 1750 | { |
1745 | int retval = 0; | ||
1746 | struct ioc4_port *port; | 1751 | struct ioc4_port *port; |
1747 | struct uart_info *info; | 1752 | struct uart_info *info; |
1748 | 1753 | ||
@@ -1754,9 +1759,6 @@ static inline int ic4_startup_local(struct uart_port *the_port) | |||
1754 | return -1; | 1759 | return -1; |
1755 | 1760 | ||
1756 | info = the_port->info; | 1761 | info = the_port->info; |
1757 | if (info->flags & UIF_INITIALIZED) { | ||
1758 | return retval; | ||
1759 | } | ||
1760 | 1762 | ||
1761 | if (info->tty) { | 1763 | if (info->tty) { |
1762 | set_bit(TTY_IO_ERROR, &info->tty->flags); | 1764 | set_bit(TTY_IO_ERROR, &info->tty->flags); |
@@ -1775,7 +1777,6 @@ static inline int ic4_startup_local(struct uart_port *the_port) | |||
1775 | /* set the speed of the serial port */ | 1777 | /* set the speed of the serial port */ |
1776 | ioc4_change_speed(the_port, info->tty->termios, (struct termios *)0); | 1778 | ioc4_change_speed(the_port, info->tty->termios, (struct termios *)0); |
1777 | 1779 | ||
1778 | info->flags |= UIF_INITIALIZED; | ||
1779 | return 0; | 1780 | return 0; |
1780 | } | 1781 | } |
1781 | 1782 | ||
@@ -1785,9 +1786,13 @@ static inline int ic4_startup_local(struct uart_port *the_port) | |||
1785 | */ | 1786 | */ |
1786 | static void ioc4_cb_output_lowat(struct ioc4_port *port) | 1787 | static void ioc4_cb_output_lowat(struct ioc4_port *port) |
1787 | { | 1788 | { |
1789 | unsigned long pflags; | ||
1790 | |||
1788 | /* ip_lock is set on the call here */ | 1791 | /* ip_lock is set on the call here */ |
1789 | if (port->ip_port) { | 1792 | if (port->ip_port) { |
1793 | spin_lock_irqsave(&port->ip_port->lock, pflags); | ||
1790 | transmit_chars(port->ip_port); | 1794 | transmit_chars(port->ip_port); |
1795 | spin_unlock_irqrestore(&port->ip_port->lock, pflags); | ||
1791 | } | 1796 | } |
1792 | } | 1797 | } |
1793 | 1798 | ||
@@ -2064,8 +2069,7 @@ static inline int do_read(struct uart_port *the_port, unsigned char *buf, | |||
2064 | * available data as long as it returns some. | 2069 | * available data as long as it returns some. |
2065 | */ | 2070 | */ |
2066 | /* Re-arm the timer */ | 2071 | /* Re-arm the timer */ |
2067 | writel(port->ip_rx_cons | IOC4_SRCIR_ARM, | 2072 | writel(port->ip_rx_cons | IOC4_SRCIR_ARM, &port->ip_serial_regs->srcir); |
2068 | &port->ip_serial_regs->srcir); | ||
2069 | 2073 | ||
2070 | prod_ptr = readl(&port->ip_serial_regs->srpir) & PROD_CONS_MASK; | 2074 | prod_ptr = readl(&port->ip_serial_regs->srpir) & PROD_CONS_MASK; |
2071 | cons_ptr = port->ip_rx_cons; | 2075 | cons_ptr = port->ip_rx_cons; |
@@ -2299,6 +2303,7 @@ static inline int do_read(struct uart_port *the_port, unsigned char *buf, | |||
2299 | } | 2303 | } |
2300 | return total; | 2304 | return total; |
2301 | } | 2305 | } |
2306 | |||
2302 | /** | 2307 | /** |
2303 | * receive_chars - upper level read. Called with ip_lock. | 2308 | * receive_chars - upper level read. Called with ip_lock. |
2304 | * @the_port: port to read from | 2309 | * @the_port: port to read from |
@@ -2307,9 +2312,11 @@ static void receive_chars(struct uart_port *the_port) | |||
2307 | { | 2312 | { |
2308 | struct tty_struct *tty; | 2313 | struct tty_struct *tty; |
2309 | unsigned char ch[IOC4_MAX_CHARS]; | 2314 | unsigned char ch[IOC4_MAX_CHARS]; |
2310 | int read_count, request_count; | 2315 | int read_count, request_count = IOC4_MAX_CHARS; |
2311 | struct uart_icount *icount; | 2316 | struct uart_icount *icount; |
2312 | struct uart_info *info = the_port->info; | 2317 | struct uart_info *info = the_port->info; |
2318 | int flip = 0; | ||
2319 | unsigned long pflags; | ||
2313 | 2320 | ||
2314 | /* Make sure all the pointers are "good" ones */ | 2321 | /* Make sure all the pointers are "good" ones */ |
2315 | if (!info) | 2322 | if (!info) |
@@ -2317,16 +2324,17 @@ static void receive_chars(struct uart_port *the_port) | |||
2317 | if (!info->tty) | 2324 | if (!info->tty) |
2318 | return; | 2325 | return; |
2319 | 2326 | ||
2327 | spin_lock_irqsave(&the_port->lock, pflags); | ||
2320 | tty = info->tty; | 2328 | tty = info->tty; |
2321 | 2329 | ||
2322 | request_count = TTY_FLIPBUF_SIZE - tty->flip.count - 1; | 2330 | if (request_count > TTY_FLIPBUF_SIZE - tty->flip.count) |
2331 | request_count = TTY_FLIPBUF_SIZE - tty->flip.count; | ||
2323 | 2332 | ||
2324 | if (request_count > 0) { | 2333 | if (request_count > 0) { |
2325 | if (request_count > IOC4_MAX_CHARS - 2) | ||
2326 | request_count = IOC4_MAX_CHARS - 2; | ||
2327 | icount = &the_port->icount; | 2334 | icount = &the_port->icount; |
2328 | read_count = do_read(the_port, ch, request_count); | 2335 | read_count = do_read(the_port, ch, request_count); |
2329 | if (read_count > 0) { | 2336 | if (read_count > 0) { |
2337 | flip = 1; | ||
2330 | memcpy(tty->flip.char_buf_ptr, ch, read_count); | 2338 | memcpy(tty->flip.char_buf_ptr, ch, read_count); |
2331 | memset(tty->flip.flag_buf_ptr, TTY_NORMAL, read_count); | 2339 | memset(tty->flip.flag_buf_ptr, TTY_NORMAL, read_count); |
2332 | tty->flip.char_buf_ptr += read_count; | 2340 | tty->flip.char_buf_ptr += read_count; |
@@ -2335,7 +2343,11 @@ static void receive_chars(struct uart_port *the_port) | |||
2335 | icount->rx += read_count; | 2343 | icount->rx += read_count; |
2336 | } | 2344 | } |
2337 | } | 2345 | } |
2338 | tty_flip_buffer_push(tty); | 2346 | |
2347 | spin_unlock_irqrestore(&the_port->lock, pflags); | ||
2348 | |||
2349 | if (flip) | ||
2350 | tty_flip_buffer_push(tty); | ||
2339 | } | 2351 | } |
2340 | 2352 | ||
2341 | /** | 2353 | /** |
@@ -2393,18 +2405,14 @@ static void ic4_shutdown(struct uart_port *the_port) | |||
2393 | 2405 | ||
2394 | info = the_port->info; | 2406 | info = the_port->info; |
2395 | 2407 | ||
2396 | if (!(info->flags & UIF_INITIALIZED)) | ||
2397 | return; | ||
2398 | |||
2399 | wake_up_interruptible(&info->delta_msr_wait); | 2408 | wake_up_interruptible(&info->delta_msr_wait); |
2400 | 2409 | ||
2401 | if (info->tty) | 2410 | if (info->tty) |
2402 | set_bit(TTY_IO_ERROR, &info->tty->flags); | 2411 | set_bit(TTY_IO_ERROR, &info->tty->flags); |
2403 | 2412 | ||
2404 | spin_lock_irqsave(&port->ip_lock, port_flags); | 2413 | spin_lock_irqsave(&the_port->lock, port_flags); |
2405 | set_notification(port, N_ALL, 0); | 2414 | set_notification(port, N_ALL, 0); |
2406 | info->flags &= ~UIF_INITIALIZED; | 2415 | spin_unlock_irqrestore(&the_port->lock, port_flags); |
2407 | spin_unlock_irqrestore(&port->ip_lock, port_flags); | ||
2408 | } | 2416 | } |
2409 | 2417 | ||
2410 | /** | 2418 | /** |
@@ -2463,12 +2471,10 @@ static unsigned int ic4_get_mctrl(struct uart_port *the_port) | |||
2463 | static void ic4_start_tx(struct uart_port *the_port) | 2471 | static void ic4_start_tx(struct uart_port *the_port) |
2464 | { | 2472 | { |
2465 | struct ioc4_port *port = get_ioc4_port(the_port); | 2473 | struct ioc4_port *port = get_ioc4_port(the_port); |
2466 | unsigned long flags; | ||
2467 | 2474 | ||
2468 | if (port) { | 2475 | if (port) { |
2469 | spin_lock_irqsave(&port->ip_lock, flags); | 2476 | set_notification(port, N_OUTPUT_LOWAT, 1); |
2470 | transmit_chars(the_port); | 2477 | enable_intrs(port, port->ip_hooks->intr_tx_mt); |
2471 | spin_unlock_irqrestore(&port->ip_lock, flags); | ||
2472 | } | 2478 | } |
2473 | } | 2479 | } |
2474 | 2480 | ||
@@ -2510,9 +2516,9 @@ static int ic4_startup(struct uart_port *the_port) | |||
2510 | } | 2516 | } |
2511 | 2517 | ||
2512 | /* Start up the serial port */ | 2518 | /* Start up the serial port */ |
2513 | spin_lock_irqsave(&port->ip_lock, port_flags); | 2519 | spin_lock_irqsave(&the_port->lock, port_flags); |
2514 | retval = ic4_startup_local(the_port); | 2520 | retval = ic4_startup_local(the_port); |
2515 | spin_unlock_irqrestore(&port->ip_lock, port_flags); | 2521 | spin_unlock_irqrestore(&the_port->lock, port_flags); |
2516 | return retval; | 2522 | return retval; |
2517 | } | 2523 | } |
2518 | 2524 | ||
@@ -2527,12 +2533,11 @@ static void | |||
2527 | ic4_set_termios(struct uart_port *the_port, | 2533 | ic4_set_termios(struct uart_port *the_port, |
2528 | struct termios *termios, struct termios *old_termios) | 2534 | struct termios *termios, struct termios *old_termios) |
2529 | { | 2535 | { |
2530 | struct ioc4_port *port = get_ioc4_port(the_port); | ||
2531 | unsigned long port_flags; | 2536 | unsigned long port_flags; |
2532 | 2537 | ||
2533 | spin_lock_irqsave(&port->ip_lock, port_flags); | 2538 | spin_lock_irqsave(&the_port->lock, port_flags); |
2534 | ioc4_change_speed(the_port, termios, old_termios); | 2539 | ioc4_change_speed(the_port, termios, old_termios); |
2535 | spin_unlock_irqrestore(&port->ip_lock, port_flags); | 2540 | spin_unlock_irqrestore(&the_port->lock, port_flags); |
2536 | } | 2541 | } |
2537 | 2542 | ||
2538 | /** | 2543 | /** |
@@ -2607,24 +2612,25 @@ ioc4_serial_core_attach(struct pci_dev *pdev) | |||
2607 | __FUNCTION__, (void *)the_port, | 2612 | __FUNCTION__, (void *)the_port, |
2608 | (void *)port)); | 2613 | (void *)port)); |
2609 | 2614 | ||
2610 | spin_lock_init(&the_port->lock); | ||
2611 | /* membase, iobase and mapbase just need to be non-0 */ | 2615 | /* membase, iobase and mapbase just need to be non-0 */ |
2612 | the_port->membase = (unsigned char __iomem *)1; | 2616 | the_port->membase = (unsigned char __iomem *)1; |
2613 | the_port->line = the_port->iobase = ii; | 2617 | the_port->iobase = (pdev->bus->number << 16) | ii; |
2618 | the_port->line = (Num_of_ioc4_cards << 2) | ii; | ||
2614 | the_port->mapbase = 1; | 2619 | the_port->mapbase = 1; |
2615 | the_port->type = PORT_16550A; | 2620 | the_port->type = PORT_16550A; |
2616 | the_port->fifosize = IOC4_MAX_CHARS; | 2621 | the_port->fifosize = IOC4_FIFO_CHARS; |
2617 | the_port->ops = &ioc4_ops; | 2622 | the_port->ops = &ioc4_ops; |
2618 | the_port->irq = control->ic_irq; | 2623 | the_port->irq = control->ic_irq; |
2619 | the_port->dev = &pdev->dev; | 2624 | the_port->dev = &pdev->dev; |
2625 | spin_lock_init(&the_port->lock); | ||
2620 | if (uart_add_one_port(&ioc4_uart, the_port) < 0) { | 2626 | if (uart_add_one_port(&ioc4_uart, the_port) < 0) { |
2621 | printk(KERN_WARNING | 2627 | printk(KERN_WARNING |
2622 | "%s: unable to add port %d\n", | 2628 | "%s: unable to add port %d bus %d\n", |
2623 | __FUNCTION__, the_port->line); | 2629 | __FUNCTION__, the_port->line, pdev->bus->number); |
2624 | } else { | 2630 | } else { |
2625 | DPRINT_CONFIG( | 2631 | DPRINT_CONFIG( |
2626 | ("IOC4 serial driver port %d irq = %d\n", | 2632 | ("IOC4 serial port %d irq = %d, bus %d\n", |
2627 | the_port->line, the_port->irq)); | 2633 | the_port->line, the_port->irq, pdev->bus->number)); |
2628 | } | 2634 | } |
2629 | /* all ports are rs232 for now */ | 2635 | /* all ports are rs232 for now */ |
2630 | ioc4_set_proto(port, PROTO_RS232); | 2636 | ioc4_set_proto(port, PROTO_RS232); |
@@ -2734,6 +2740,8 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd) | |||
2734 | if ((ret = ioc4_serial_core_attach(idd->idd_pdev))) | 2740 | if ((ret = ioc4_serial_core_attach(idd->idd_pdev))) |
2735 | goto out4; | 2741 | goto out4; |
2736 | 2742 | ||
2743 | Num_of_ioc4_cards++; | ||
2744 | |||
2737 | return ret; | 2745 | return ret; |
2738 | 2746 | ||
2739 | /* error exits that give back resources */ | 2747 | /* error exits that give back resources */ |
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 0585ab27ffde..8a79968f8ce1 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c | |||
@@ -781,22 +781,22 @@ mpc52xx_uart_remove(struct device *dev) | |||
781 | 781 | ||
782 | #ifdef CONFIG_PM | 782 | #ifdef CONFIG_PM |
783 | static int | 783 | static int |
784 | mpc52xx_uart_suspend(struct device *dev, pm_message_t state, u32 level) | 784 | mpc52xx_uart_suspend(struct device *dev, pm_message_t state) |
785 | { | 785 | { |
786 | struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); | 786 | struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); |
787 | 787 | ||
788 | if (sport && level == SUSPEND_DISABLE) | 788 | if (sport) |
789 | uart_suspend_port(&mpc52xx_uart_driver, port); | 789 | uart_suspend_port(&mpc52xx_uart_driver, port); |
790 | 790 | ||
791 | return 0; | 791 | return 0; |
792 | } | 792 | } |
793 | 793 | ||
794 | static int | 794 | static int |
795 | mpc52xx_uart_resume(struct device *dev, u32 level) | 795 | mpc52xx_uart_resume(struct device *dev) |
796 | { | 796 | { |
797 | struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); | 797 | struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); |
798 | 798 | ||
799 | if (port && level == RESUME_ENABLE) | 799 | if (port) |
800 | uart_resume_port(&mpc52xx_uart_driver, port); | 800 | uart_resume_port(&mpc52xx_uart_driver, port); |
801 | 801 | ||
802 | return 0; | 802 | return 0; |
diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c index efe79b1fd431..aec83f577ce6 100644 --- a/drivers/serial/mpsc.c +++ b/drivers/serial/mpsc.c | |||
@@ -1100,6 +1100,8 @@ mpsc_start_rx(struct mpsc_port_info *pi) | |||
1100 | { | 1100 | { |
1101 | pr_debug("mpsc_start_rx[%d]: Starting...\n", pi->port.line); | 1101 | pr_debug("mpsc_start_rx[%d]: Starting...\n", pi->port.line); |
1102 | 1102 | ||
1103 | /* Issue a Receive Abort to clear any receive errors */ | ||
1104 | writel(MPSC_CHR_2_RA, pi->mpsc_base + MPSC_CHR_2); | ||
1103 | if (pi->rcv_data) { | 1105 | if (pi->rcv_data) { |
1104 | mpsc_enter_hunt(pi); | 1106 | mpsc_enter_hunt(pi); |
1105 | mpsc_sdma_cmd(pi, SDMA_SDCM_ERD); | 1107 | mpsc_sdma_cmd(pi, SDMA_SDCM_ERD); |
diff --git a/drivers/serial/mux.c b/drivers/serial/mux.c index 189064607709..660bae5ba179 100644 --- a/drivers/serial/mux.c +++ b/drivers/serial/mux.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/delay.h> /* for udelay */ | 27 | #include <linux/delay.h> /* for udelay */ |
28 | #include <linux/device.h> | 28 | #include <linux/device.h> |
29 | #include <asm/io.h> | 29 | #include <asm/io.h> |
30 | #include <asm/irq.h> | ||
30 | #include <asm/parisc-device.h> | 31 | #include <asm/parisc-device.h> |
31 | 32 | ||
32 | #ifdef CONFIG_MAGIC_SYSRQ | 33 | #ifdef CONFIG_MAGIC_SYSRQ |
@@ -444,7 +445,7 @@ static int __init mux_probe(struct parisc_device *dev) | |||
444 | unsigned long bytecnt; | 445 | unsigned long bytecnt; |
445 | struct uart_port *port; | 446 | struct uart_port *port; |
446 | 447 | ||
447 | status = pdc_iodc_read(&bytecnt, dev->hpa, 0, iodc_data, 32); | 448 | status = pdc_iodc_read(&bytecnt, dev->hpa.start, 0, iodc_data, 32); |
448 | if(status != PDC_OK) { | 449 | if(status != PDC_OK) { |
449 | printk(KERN_ERR "Serial mux: Unable to read IODC.\n"); | 450 | printk(KERN_ERR "Serial mux: Unable to read IODC.\n"); |
450 | return 1; | 451 | return 1; |
@@ -469,16 +470,18 @@ static int __init mux_probe(struct parisc_device *dev) | |||
469 | for(i = 0; i < ports; ++i, ++port_cnt) { | 470 | for(i = 0; i < ports; ++i, ++port_cnt) { |
470 | port = &mux_ports[port_cnt]; | 471 | port = &mux_ports[port_cnt]; |
471 | port->iobase = 0; | 472 | port->iobase = 0; |
472 | port->mapbase = dev->hpa + MUX_OFFSET + (i * MUX_LINE_OFFSET); | 473 | port->mapbase = dev->hpa.start + MUX_OFFSET + |
474 | (i * MUX_LINE_OFFSET); | ||
473 | port->membase = ioremap(port->mapbase, MUX_LINE_OFFSET); | 475 | port->membase = ioremap(port->mapbase, MUX_LINE_OFFSET); |
474 | port->iotype = SERIAL_IO_MEM; | 476 | port->iotype = SERIAL_IO_MEM; |
475 | port->type = PORT_MUX; | 477 | port->type = PORT_MUX; |
476 | port->irq = SERIAL_IRQ_NONE; | 478 | port->irq = NO_IRQ; |
477 | port->uartclk = 0; | 479 | port->uartclk = 0; |
478 | port->fifosize = MUX_FIFO_SIZE; | 480 | port->fifosize = MUX_FIFO_SIZE; |
479 | port->ops = &mux_pops; | 481 | port->ops = &mux_pops; |
480 | port->flags = UPF_BOOT_AUTOCONF; | 482 | port->flags = UPF_BOOT_AUTOCONF; |
481 | port->line = port_cnt; | 483 | port->line = port_cnt; |
484 | spin_lock_init(&port->lock); | ||
482 | status = uart_add_one_port(&mux_driver, port); | 485 | status = uart_add_one_port(&mux_driver, port); |
483 | BUG_ON(status); | 486 | BUG_ON(status); |
484 | } | 487 | } |
@@ -497,7 +500,7 @@ static struct parisc_device_id mux_tbl[] = { | |||
497 | MODULE_DEVICE_TABLE(parisc, mux_tbl); | 500 | MODULE_DEVICE_TABLE(parisc, mux_tbl); |
498 | 501 | ||
499 | static struct parisc_driver serial_mux_driver = { | 502 | static struct parisc_driver serial_mux_driver = { |
500 | .name = "Serial MUX", | 503 | .name = "serial_mux", |
501 | .id_table = mux_tbl, | 504 | .id_table = mux_tbl, |
502 | .probe = mux_probe, | 505 | .probe = mux_probe, |
503 | }; | 506 | }; |
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c index 90c2a86c421b..8cc4cedadd99 100644 --- a/drivers/serial/pxa.c +++ b/drivers/serial/pxa.c | |||
@@ -358,6 +358,9 @@ static int serial_pxa_startup(struct uart_port *port) | |||
358 | unsigned long flags; | 358 | unsigned long flags; |
359 | int retval; | 359 | int retval; |
360 | 360 | ||
361 | if (port->line == 3) /* HWUART */ | ||
362 | up->mcr |= UART_MCR_AFE; | ||
363 | else | ||
361 | up->mcr = 0; | 364 | up->mcr = 0; |
362 | 365 | ||
363 | /* | 366 | /* |
@@ -481,8 +484,10 @@ serial_pxa_set_termios(struct uart_port *port, struct termios *termios, | |||
481 | 484 | ||
482 | if ((up->port.uartclk / quot) < (2400 * 16)) | 485 | if ((up->port.uartclk / quot) < (2400 * 16)) |
483 | fcr = UART_FCR_ENABLE_FIFO | UART_FCR_PXAR1; | 486 | fcr = UART_FCR_ENABLE_FIFO | UART_FCR_PXAR1; |
484 | else | 487 | else if ((up->port.uartclk / quot) < (230400 * 16)) |
485 | fcr = UART_FCR_ENABLE_FIFO | UART_FCR_PXAR8; | 488 | fcr = UART_FCR_ENABLE_FIFO | UART_FCR_PXAR8; |
489 | else | ||
490 | fcr = UART_FCR_ENABLE_FIFO | UART_FCR_PXAR32; | ||
486 | 491 | ||
487 | /* | 492 | /* |
488 | * Ok, we're now changing the port state. Do it with | 493 | * Ok, we're now changing the port state. Do it with |
@@ -772,6 +777,20 @@ static struct uart_pxa_port serial_pxa_ports[] = { | |||
772 | .ops = &serial_pxa_pops, | 777 | .ops = &serial_pxa_pops, |
773 | .line = 2, | 778 | .line = 2, |
774 | }, | 779 | }, |
780 | }, { /* HWUART */ | ||
781 | .name = "HWUART", | ||
782 | .cken = CKEN4_HWUART, | ||
783 | .port = { | ||
784 | .type = PORT_PXA, | ||
785 | .iotype = UPIO_MEM, | ||
786 | .membase = (void *)&HWUART, | ||
787 | .mapbase = __PREG(HWUART), | ||
788 | .irq = IRQ_HWUART, | ||
789 | .uartclk = 921600 * 16, | ||
790 | .fifosize = 64, | ||
791 | .ops = &serial_pxa_pops, | ||
792 | .line = 3, | ||
793 | }, | ||
775 | } | 794 | } |
776 | }; | 795 | }; |
777 | 796 | ||
@@ -786,21 +805,21 @@ static struct uart_driver serial_pxa_reg = { | |||
786 | .cons = PXA_CONSOLE, | 805 | .cons = PXA_CONSOLE, |
787 | }; | 806 | }; |
788 | 807 | ||
789 | static int serial_pxa_suspend(struct device *_dev, pm_message_t state, u32 level) | 808 | static int serial_pxa_suspend(struct device *_dev, pm_message_t state) |
790 | { | 809 | { |
791 | struct uart_pxa_port *sport = dev_get_drvdata(_dev); | 810 | struct uart_pxa_port *sport = dev_get_drvdata(_dev); |
792 | 811 | ||
793 | if (sport && level == SUSPEND_DISABLE) | 812 | if (sport) |
794 | uart_suspend_port(&serial_pxa_reg, &sport->port); | 813 | uart_suspend_port(&serial_pxa_reg, &sport->port); |
795 | 814 | ||
796 | return 0; | 815 | return 0; |
797 | } | 816 | } |
798 | 817 | ||
799 | static int serial_pxa_resume(struct device *_dev, u32 level) | 818 | static int serial_pxa_resume(struct device *_dev) |
800 | { | 819 | { |
801 | struct uart_pxa_port *sport = dev_get_drvdata(_dev); | 820 | struct uart_pxa_port *sport = dev_get_drvdata(_dev); |
802 | 821 | ||
803 | if (sport && level == RESUME_ENABLE) | 822 | if (sport) |
804 | uart_resume_port(&serial_pxa_reg, &sport->port); | 823 | uart_resume_port(&serial_pxa_reg, &sport->port); |
805 | 824 | ||
806 | return 0; | 825 | return 0; |
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c index 52692aa345ec..06a17dff1a73 100644 --- a/drivers/serial/s3c2410.c +++ b/drivers/serial/s3c2410.c | |||
@@ -1134,23 +1134,22 @@ static int s3c24xx_serial_remove(struct device *_dev) | |||
1134 | 1134 | ||
1135 | #ifdef CONFIG_PM | 1135 | #ifdef CONFIG_PM |
1136 | 1136 | ||
1137 | static int s3c24xx_serial_suspend(struct device *dev, pm_message_t state, | 1137 | static int s3c24xx_serial_suspend(struct device *dev, pm_message_t state) |
1138 | u32 level) | ||
1139 | { | 1138 | { |
1140 | struct uart_port *port = s3c24xx_dev_to_port(dev); | 1139 | struct uart_port *port = s3c24xx_dev_to_port(dev); |
1141 | 1140 | ||
1142 | if (port && level == SUSPEND_DISABLE) | 1141 | if (port) |
1143 | uart_suspend_port(&s3c24xx_uart_drv, port); | 1142 | uart_suspend_port(&s3c24xx_uart_drv, port); |
1144 | 1143 | ||
1145 | return 0; | 1144 | return 0; |
1146 | } | 1145 | } |
1147 | 1146 | ||
1148 | static int s3c24xx_serial_resume(struct device *dev, u32 level) | 1147 | static int s3c24xx_serial_resume(struct device *dev) |
1149 | { | 1148 | { |
1150 | struct uart_port *port = s3c24xx_dev_to_port(dev); | 1149 | struct uart_port *port = s3c24xx_dev_to_port(dev); |
1151 | struct s3c24xx_uart_port *ourport = to_ourport(port); | 1150 | struct s3c24xx_uart_port *ourport = to_ourport(port); |
1152 | 1151 | ||
1153 | if (port && level == RESUME_ENABLE) { | 1152 | if (port) { |
1154 | clk_enable(ourport->clk); | 1153 | clk_enable(ourport->clk); |
1155 | s3c24xx_serial_resetport(port, s3c24xx_port_to_cfg(port)); | 1154 | s3c24xx_serial_resetport(port, s3c24xx_port_to_cfg(port)); |
1156 | clk_disable(ourport->clk); | 1155 | clk_disable(ourport->clk); |
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index dd8aed242357..c4a789e6af44 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c | |||
@@ -834,21 +834,21 @@ static struct uart_driver sa1100_reg = { | |||
834 | .cons = SA1100_CONSOLE, | 834 | .cons = SA1100_CONSOLE, |
835 | }; | 835 | }; |
836 | 836 | ||
837 | static int sa1100_serial_suspend(struct device *_dev, pm_message_t state, u32 level) | 837 | static int sa1100_serial_suspend(struct device *_dev, pm_message_t state) |
838 | { | 838 | { |
839 | struct sa1100_port *sport = dev_get_drvdata(_dev); | 839 | struct sa1100_port *sport = dev_get_drvdata(_dev); |
840 | 840 | ||
841 | if (sport && level == SUSPEND_DISABLE) | 841 | if (sport) |
842 | uart_suspend_port(&sa1100_reg, &sport->port); | 842 | uart_suspend_port(&sa1100_reg, &sport->port); |
843 | 843 | ||
844 | return 0; | 844 | return 0; |
845 | } | 845 | } |
846 | 846 | ||
847 | static int sa1100_serial_resume(struct device *_dev, u32 level) | 847 | static int sa1100_serial_resume(struct device *_dev) |
848 | { | 848 | { |
849 | struct sa1100_port *sport = dev_get_drvdata(_dev); | 849 | struct sa1100_port *sport = dev_get_drvdata(_dev); |
850 | 850 | ||
851 | if (sport && level == RESUME_ENABLE) | 851 | if (sport) |
852 | uart_resume_port(&sa1100_reg, &sport->port); | 852 | uart_resume_port(&sa1100_reg, &sport->port); |
853 | 853 | ||
854 | return 0; | 854 | return 0; |
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 2d8622eef701..401d94a7fe2e 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -147,8 +147,7 @@ static int uart_startup(struct uart_state *state, int init_hw) | |||
147 | * once we have successfully opened the port. Also set | 147 | * once we have successfully opened the port. Also set |
148 | * up the tty->alt_speed kludge | 148 | * up the tty->alt_speed kludge |
149 | */ | 149 | */ |
150 | if (info->tty) | 150 | set_bit(TTY_IO_ERROR, &info->tty->flags); |
151 | set_bit(TTY_IO_ERROR, &info->tty->flags); | ||
152 | 151 | ||
153 | if (port->type == PORT_UNKNOWN) | 152 | if (port->type == PORT_UNKNOWN) |
154 | return 0; | 153 | return 0; |
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c index 0c5d65a08f6e..2b623ab0e36e 100644 --- a/drivers/serial/vr41xx_siu.c +++ b/drivers/serial/vr41xx_siu.c | |||
@@ -976,14 +976,11 @@ static int siu_remove(struct device *dev) | |||
976 | return 0; | 976 | return 0; |
977 | } | 977 | } |
978 | 978 | ||
979 | static int siu_suspend(struct device *dev, pm_message_t state, u32 level) | 979 | static int siu_suspend(struct device *dev, pm_message_t state) |
980 | { | 980 | { |
981 | struct uart_port *port; | 981 | struct uart_port *port; |
982 | int i; | 982 | int i; |
983 | 983 | ||
984 | if (level != SUSPEND_DISABLE) | ||
985 | return 0; | ||
986 | |||
987 | for (i = 0; i < siu_uart_driver.nr; i++) { | 984 | for (i = 0; i < siu_uart_driver.nr; i++) { |
988 | port = &siu_uart_ports[i]; | 985 | port = &siu_uart_ports[i]; |
989 | if ((port->type == PORT_VR41XX_SIU || | 986 | if ((port->type == PORT_VR41XX_SIU || |
@@ -995,14 +992,11 @@ static int siu_suspend(struct device *dev, pm_message_t state, u32 level) | |||
995 | return 0; | 992 | return 0; |
996 | } | 993 | } |
997 | 994 | ||
998 | static int siu_resume(struct device *dev, u32 level) | 995 | static int siu_resume(struct device *dev) |
999 | { | 996 | { |
1000 | struct uart_port *port; | 997 | struct uart_port *port; |
1001 | int i; | 998 | int i; |
1002 | 999 | ||
1003 | if (level != RESUME_ENABLE) | ||
1004 | return 0; | ||
1005 | |||
1006 | for (i = 0; i < siu_uart_driver.nr; i++) { | 1000 | for (i = 0; i < siu_uart_driver.nr; i++) { |
1007 | port = &siu_uart_ports[i]; | 1001 | port = &siu_uart_ports[i]; |
1008 | if ((port->type == PORT_VR41XX_SIU || | 1002 | if ((port->type == PORT_VR41XX_SIU || |