diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-04-19 12:17:34 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-19 12:17:34 -0400 |
commit | cf816ecb533ab96b883dfdc0db174598b5b5c4d2 (patch) | |
tree | 1b7705db288ae2917105e624b01fdf81e0882bf1 /drivers/serial | |
parent | adf6d34e460387ee3e8f1e1875d52bff51212c7d (diff) | |
parent | 15f7d677ccff6f0f5de8a1ee43a792567e9f9de9 (diff) |
Merge branch 'merge-fixes' into devel
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/8250.c | 58 | ||||
-rw-r--r-- | drivers/serial/Kconfig | 3 | ||||
-rw-r--r-- | drivers/serial/Makefile | 1 | ||||
-rw-r--r-- | drivers/serial/amba-pl011.c | 30 | ||||
-rw-r--r-- | drivers/serial/atmel_serial.c | 1 | ||||
-rw-r--r-- | drivers/serial/bfin_5xx.c | 2 | ||||
-rw-r--r-- | drivers/serial/imx.c | 2 | ||||
-rw-r--r-- | drivers/serial/kgdboc.c | 168 | ||||
-rw-r--r-- | drivers/serial/mcf.c | 1 | ||||
-rw-r--r-- | drivers/serial/mpc52xx_uart.c | 2 | ||||
-rw-r--r-- | drivers/serial/mpsc.c | 2 | ||||
-rw-r--r-- | drivers/serial/netx-serial.c | 2 | ||||
-rw-r--r-- | drivers/serial/pnx8xxx_uart.c | 1 | ||||
-rw-r--r-- | drivers/serial/pxa.c | 3 | ||||
-rw-r--r-- | drivers/serial/s3c2410.c | 4 | ||||
-rw-r--r-- | drivers/serial/sa1100.c | 2 | ||||
-rw-r--r-- | drivers/serial/sc26xx.c | 2 | ||||
-rw-r--r-- | drivers/serial/serial_core.c | 74 | ||||
-rw-r--r-- | drivers/serial/sh-sci.c | 1 | ||||
-rw-r--r-- | drivers/serial/uartlite.c | 3 | ||||
-rw-r--r-- | drivers/serial/vr41xx_siu.c | 3 |
21 files changed, 360 insertions, 5 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 77f7a7f0646e..96a585e1cee8 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -1740,6 +1740,60 @@ static inline void wait_for_xmitr(struct uart_8250_port *up, int bits) | |||
1740 | } | 1740 | } |
1741 | } | 1741 | } |
1742 | 1742 | ||
1743 | #ifdef CONFIG_CONSOLE_POLL | ||
1744 | /* | ||
1745 | * Console polling routines for writing and reading from the uart while | ||
1746 | * in an interrupt or debug context. | ||
1747 | */ | ||
1748 | |||
1749 | static int serial8250_get_poll_char(struct uart_port *port) | ||
1750 | { | ||
1751 | struct uart_8250_port *up = (struct uart_8250_port *)port; | ||
1752 | unsigned char lsr = serial_inp(up, UART_LSR); | ||
1753 | |||
1754 | while (!(lsr & UART_LSR_DR)) | ||
1755 | lsr = serial_inp(up, UART_LSR); | ||
1756 | |||
1757 | return serial_inp(up, UART_RX); | ||
1758 | } | ||
1759 | |||
1760 | |||
1761 | static void serial8250_put_poll_char(struct uart_port *port, | ||
1762 | unsigned char c) | ||
1763 | { | ||
1764 | unsigned int ier; | ||
1765 | struct uart_8250_port *up = (struct uart_8250_port *)port; | ||
1766 | |||
1767 | /* | ||
1768 | * First save the IER then disable the interrupts | ||
1769 | */ | ||
1770 | ier = serial_in(up, UART_IER); | ||
1771 | if (up->capabilities & UART_CAP_UUE) | ||
1772 | serial_out(up, UART_IER, UART_IER_UUE); | ||
1773 | else | ||
1774 | serial_out(up, UART_IER, 0); | ||
1775 | |||
1776 | wait_for_xmitr(up, BOTH_EMPTY); | ||
1777 | /* | ||
1778 | * Send the character out. | ||
1779 | * If a LF, also do CR... | ||
1780 | */ | ||
1781 | serial_out(up, UART_TX, c); | ||
1782 | if (c == 10) { | ||
1783 | wait_for_xmitr(up, BOTH_EMPTY); | ||
1784 | serial_out(up, UART_TX, 13); | ||
1785 | } | ||
1786 | |||
1787 | /* | ||
1788 | * Finally, wait for transmitter to become empty | ||
1789 | * and restore the IER | ||
1790 | */ | ||
1791 | wait_for_xmitr(up, BOTH_EMPTY); | ||
1792 | serial_out(up, UART_IER, ier); | ||
1793 | } | ||
1794 | |||
1795 | #endif /* CONFIG_CONSOLE_POLL */ | ||
1796 | |||
1743 | static int serial8250_startup(struct uart_port *port) | 1797 | static int serial8250_startup(struct uart_port *port) |
1744 | { | 1798 | { |
1745 | struct uart_8250_port *up = (struct uart_8250_port *)port; | 1799 | struct uart_8250_port *up = (struct uart_8250_port *)port; |
@@ -2386,6 +2440,10 @@ static struct uart_ops serial8250_pops = { | |||
2386 | .request_port = serial8250_request_port, | 2440 | .request_port = serial8250_request_port, |
2387 | .config_port = serial8250_config_port, | 2441 | .config_port = serial8250_config_port, |
2388 | .verify_port = serial8250_verify_port, | 2442 | .verify_port = serial8250_verify_port, |
2443 | #ifdef CONFIG_CONSOLE_POLL | ||
2444 | .poll_get_char = serial8250_get_poll_char, | ||
2445 | .poll_put_char = serial8250_put_poll_char, | ||
2446 | #endif | ||
2389 | }; | 2447 | }; |
2390 | 2448 | ||
2391 | static struct uart_8250_port serial8250_ports[UART_NR]; | 2449 | static struct uart_8250_port serial8250_ports[UART_NR]; |
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index cf627cd1b4c8..f7cd9504d811 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig | |||
@@ -961,6 +961,9 @@ config SERIAL_CORE | |||
961 | config SERIAL_CORE_CONSOLE | 961 | config SERIAL_CORE_CONSOLE |
962 | bool | 962 | bool |
963 | 963 | ||
964 | config CONSOLE_POLL | ||
965 | bool | ||
966 | |||
964 | config SERIAL_68328 | 967 | config SERIAL_68328 |
965 | bool "68328 serial support" | 968 | bool "68328 serial support" |
966 | depends on M68328 || M68EZ328 || M68VZ328 | 969 | depends on M68328 || M68EZ328 || M68VZ328 |
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index 640cfe44a56d..3cbea5494724 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile | |||
@@ -66,4 +66,5 @@ obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o | |||
66 | obj-$(CONFIG_SERIAL_NETX) += netx-serial.o | 66 | obj-$(CONFIG_SERIAL_NETX) += netx-serial.o |
67 | obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o | 67 | obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o |
68 | obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o | 68 | obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o |
69 | obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o | ||
69 | obj-$(CONFIG_SERIAL_QE) += ucc_uart.o | 70 | obj-$(CONFIG_SERIAL_QE) += ucc_uart.o |
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 40604a092921..08adc1de4a79 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c | |||
@@ -314,6 +314,32 @@ static void pl011_break_ctl(struct uart_port *port, int break_state) | |||
314 | spin_unlock_irqrestore(&uap->port.lock, flags); | 314 | spin_unlock_irqrestore(&uap->port.lock, flags); |
315 | } | 315 | } |
316 | 316 | ||
317 | #ifdef CONFIG_CONSOLE_POLL | ||
318 | static int pl010_get_poll_char(struct uart_port *port) | ||
319 | { | ||
320 | struct uart_amba_port *uap = (struct uart_amba_port *)port; | ||
321 | unsigned int status; | ||
322 | |||
323 | do { | ||
324 | status = readw(uap->port.membase + UART01x_FR); | ||
325 | } while (status & UART01x_FR_RXFE); | ||
326 | |||
327 | return readw(uap->port.membase + UART01x_DR); | ||
328 | } | ||
329 | |||
330 | static void pl010_put_poll_char(struct uart_port *port, | ||
331 | unsigned char ch) | ||
332 | { | ||
333 | struct uart_amba_port *uap = (struct uart_amba_port *)port; | ||
334 | |||
335 | while (readw(uap->port.membase + UART01x_FR) & UART01x_FR_TXFF) | ||
336 | barrier(); | ||
337 | |||
338 | writew(ch, uap->port.membase + UART01x_DR); | ||
339 | } | ||
340 | |||
341 | #endif /* CONFIG_CONSOLE_POLL */ | ||
342 | |||
317 | static int pl011_startup(struct uart_port *port) | 343 | static int pl011_startup(struct uart_port *port) |
318 | { | 344 | { |
319 | struct uart_amba_port *uap = (struct uart_amba_port *)port; | 345 | struct uart_amba_port *uap = (struct uart_amba_port *)port; |
@@ -572,6 +598,10 @@ static struct uart_ops amba_pl011_pops = { | |||
572 | .request_port = pl010_request_port, | 598 | .request_port = pl010_request_port, |
573 | .config_port = pl010_config_port, | 599 | .config_port = pl010_config_port, |
574 | .verify_port = pl010_verify_port, | 600 | .verify_port = pl010_verify_port, |
601 | #ifdef CONFIG_CONSOLE_POLL | ||
602 | .poll_get_char = pl010_get_poll_char, | ||
603 | .poll_put_char = pl010_put_poll_char, | ||
604 | #endif | ||
575 | }; | 605 | }; |
576 | 606 | ||
577 | static struct uart_amba_port *amba_ports[UART_NR]; | 607 | static struct uart_amba_port *amba_ports[UART_NR]; |
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index 430997e33fc4..55492fa095a2 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -1577,3 +1577,4 @@ module_exit(atmel_serial_exit); | |||
1577 | MODULE_AUTHOR("Rick Bronson"); | 1577 | MODULE_AUTHOR("Rick Bronson"); |
1578 | MODULE_DESCRIPTION("Atmel AT91 / AT32 serial port driver"); | 1578 | MODULE_DESCRIPTION("Atmel AT91 / AT32 serial port driver"); |
1579 | MODULE_LICENSE("GPL"); | 1579 | MODULE_LICENSE("GPL"); |
1580 | MODULE_ALIAS("platform:atmel_usart"); | ||
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index 0aa345b9a38b..46bb47f37b9a 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c | |||
@@ -1243,6 +1243,7 @@ static struct platform_driver bfin_serial_driver = { | |||
1243 | .resume = bfin_serial_resume, | 1243 | .resume = bfin_serial_resume, |
1244 | .driver = { | 1244 | .driver = { |
1245 | .name = "bfin-uart", | 1245 | .name = "bfin-uart", |
1246 | .owner = THIS_MODULE, | ||
1246 | }, | 1247 | }, |
1247 | }; | 1248 | }; |
1248 | 1249 | ||
@@ -1301,3 +1302,4 @@ MODULE_AUTHOR("Aubrey.Li <aubrey.li@analog.com>"); | |||
1301 | MODULE_DESCRIPTION("Blackfin generic serial port driver"); | 1302 | MODULE_DESCRIPTION("Blackfin generic serial port driver"); |
1302 | MODULE_LICENSE("GPL"); | 1303 | MODULE_LICENSE("GPL"); |
1303 | MODULE_ALIAS_CHARDEV_MAJOR(BFIN_SERIAL_MAJOR); | 1304 | MODULE_ALIAS_CHARDEV_MAJOR(BFIN_SERIAL_MAJOR); |
1305 | MODULE_ALIAS("platform:bfin-uart"); | ||
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index cf29a2d0ba4c..5a375bf0ebf4 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
@@ -1085,6 +1085,7 @@ static struct platform_driver serial_imx_driver = { | |||
1085 | .resume = serial_imx_resume, | 1085 | .resume = serial_imx_resume, |
1086 | .driver = { | 1086 | .driver = { |
1087 | .name = "imx-uart", | 1087 | .name = "imx-uart", |
1088 | .owner = THIS_MODULE, | ||
1088 | }, | 1089 | }, |
1089 | }; | 1090 | }; |
1090 | 1091 | ||
@@ -1119,3 +1120,4 @@ module_exit(imx_serial_exit); | |||
1119 | MODULE_AUTHOR("Sascha Hauer"); | 1120 | MODULE_AUTHOR("Sascha Hauer"); |
1120 | MODULE_DESCRIPTION("IMX generic serial port driver"); | 1121 | MODULE_DESCRIPTION("IMX generic serial port driver"); |
1121 | MODULE_LICENSE("GPL"); | 1122 | MODULE_LICENSE("GPL"); |
1123 | MODULE_ALIAS("platform:imx-uart"); | ||
diff --git a/drivers/serial/kgdboc.c b/drivers/serial/kgdboc.c new file mode 100644 index 000000000000..9cf03327386a --- /dev/null +++ b/drivers/serial/kgdboc.c | |||
@@ -0,0 +1,168 @@ | |||
1 | /* | ||
2 | * Based on the same principle as kgdboe using the NETPOLL api, this | ||
3 | * driver uses a console polling api to implement a gdb serial inteface | ||
4 | * which is multiplexed on a console port. | ||
5 | * | ||
6 | * Maintainer: Jason Wessel <jason.wessel@windriver.com> | ||
7 | * | ||
8 | * 2007-2008 (c) Jason Wessel - Wind River Systems, Inc. | ||
9 | * | ||
10 | * This file is licensed under the terms of the GNU General Public | ||
11 | * License version 2. This program is licensed "as is" without any | ||
12 | * warranty of any kind, whether express or implied. | ||
13 | */ | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/ctype.h> | ||
16 | #include <linux/kgdb.h> | ||
17 | #include <linux/tty.h> | ||
18 | |||
19 | #define MAX_CONFIG_LEN 40 | ||
20 | |||
21 | static struct kgdb_io kgdboc_io_ops; | ||
22 | |||
23 | /* -1 = init not run yet, 0 = unconfigured, 1 = configured. */ | ||
24 | static int configured = -1; | ||
25 | |||
26 | static char config[MAX_CONFIG_LEN]; | ||
27 | static struct kparam_string kps = { | ||
28 | .string = config, | ||
29 | .maxlen = MAX_CONFIG_LEN, | ||
30 | }; | ||
31 | |||
32 | static struct tty_driver *kgdb_tty_driver; | ||
33 | static int kgdb_tty_line; | ||
34 | |||
35 | static int kgdboc_option_setup(char *opt) | ||
36 | { | ||
37 | if (strlen(opt) > MAX_CONFIG_LEN) { | ||
38 | printk(KERN_ERR "kgdboc: config string too long\n"); | ||
39 | return -ENOSPC; | ||
40 | } | ||
41 | strcpy(config, opt); | ||
42 | |||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | __setup("kgdboc=", kgdboc_option_setup); | ||
47 | |||
48 | static int configure_kgdboc(void) | ||
49 | { | ||
50 | struct tty_driver *p; | ||
51 | int tty_line = 0; | ||
52 | int err; | ||
53 | |||
54 | err = kgdboc_option_setup(config); | ||
55 | if (err || !strlen(config) || isspace(config[0])) | ||
56 | goto noconfig; | ||
57 | |||
58 | err = -ENODEV; | ||
59 | |||
60 | p = tty_find_polling_driver(config, &tty_line); | ||
61 | if (!p) | ||
62 | goto noconfig; | ||
63 | |||
64 | kgdb_tty_driver = p; | ||
65 | kgdb_tty_line = tty_line; | ||
66 | |||
67 | err = kgdb_register_io_module(&kgdboc_io_ops); | ||
68 | if (err) | ||
69 | goto noconfig; | ||
70 | |||
71 | configured = 1; | ||
72 | |||
73 | return 0; | ||
74 | |||
75 | noconfig: | ||
76 | config[0] = 0; | ||
77 | configured = 0; | ||
78 | |||
79 | return err; | ||
80 | } | ||
81 | |||
82 | static int __init init_kgdboc(void) | ||
83 | { | ||
84 | /* Already configured? */ | ||
85 | if (configured == 1) | ||
86 | return 0; | ||
87 | |||
88 | return configure_kgdboc(); | ||
89 | } | ||
90 | |||
91 | static void cleanup_kgdboc(void) | ||
92 | { | ||
93 | if (configured == 1) | ||
94 | kgdb_unregister_io_module(&kgdboc_io_ops); | ||
95 | } | ||
96 | |||
97 | static int kgdboc_get_char(void) | ||
98 | { | ||
99 | return kgdb_tty_driver->poll_get_char(kgdb_tty_driver, kgdb_tty_line); | ||
100 | } | ||
101 | |||
102 | static void kgdboc_put_char(u8 chr) | ||
103 | { | ||
104 | kgdb_tty_driver->poll_put_char(kgdb_tty_driver, kgdb_tty_line, chr); | ||
105 | } | ||
106 | |||
107 | static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp) | ||
108 | { | ||
109 | int len = strlen(kmessage); | ||
110 | |||
111 | if (len >= MAX_CONFIG_LEN) { | ||
112 | printk(KERN_ERR "kgdboc: config string too long\n"); | ||
113 | return -ENOSPC; | ||
114 | } | ||
115 | |||
116 | /* Only copy in the string if the init function has not run yet */ | ||
117 | if (configured < 0) { | ||
118 | strcpy(config, kmessage); | ||
119 | return 0; | ||
120 | } | ||
121 | |||
122 | if (kgdb_connected) { | ||
123 | printk(KERN_ERR | ||
124 | "kgdboc: Cannot reconfigure while KGDB is connected.\n"); | ||
125 | |||
126 | return -EBUSY; | ||
127 | } | ||
128 | |||
129 | strcpy(config, kmessage); | ||
130 | /* Chop out \n char as a result of echo */ | ||
131 | if (config[len - 1] == '\n') | ||
132 | config[len - 1] = '\0'; | ||
133 | |||
134 | if (configured == 1) | ||
135 | cleanup_kgdboc(); | ||
136 | |||
137 | /* Go and configure with the new params. */ | ||
138 | return configure_kgdboc(); | ||
139 | } | ||
140 | |||
141 | static void kgdboc_pre_exp_handler(void) | ||
142 | { | ||
143 | /* Increment the module count when the debugger is active */ | ||
144 | if (!kgdb_connected) | ||
145 | try_module_get(THIS_MODULE); | ||
146 | } | ||
147 | |||
148 | static void kgdboc_post_exp_handler(void) | ||
149 | { | ||
150 | /* decrement the module count when the debugger detaches */ | ||
151 | if (!kgdb_connected) | ||
152 | module_put(THIS_MODULE); | ||
153 | } | ||
154 | |||
155 | static struct kgdb_io kgdboc_io_ops = { | ||
156 | .name = "kgdboc", | ||
157 | .read_char = kgdboc_get_char, | ||
158 | .write_char = kgdboc_put_char, | ||
159 | .pre_exception = kgdboc_pre_exp_handler, | ||
160 | .post_exception = kgdboc_post_exp_handler, | ||
161 | }; | ||
162 | |||
163 | module_init(init_kgdboc); | ||
164 | module_exit(cleanup_kgdboc); | ||
165 | module_param_call(kgdboc, param_set_kgdboc_var, param_get_string, &kps, 0644); | ||
166 | MODULE_PARM_DESC(kgdboc, "<serial_device>[,baud]"); | ||
167 | MODULE_DESCRIPTION("KGDB Console TTY Driver"); | ||
168 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/serial/mcf.c b/drivers/serial/mcf.c index e76fc72c9b36..7e164e0cd211 100644 --- a/drivers/serial/mcf.c +++ b/drivers/serial/mcf.c | |||
@@ -649,5 +649,6 @@ module_exit(mcf_exit); | |||
649 | MODULE_AUTHOR("Greg Ungerer <gerg@snapgear.com>"); | 649 | MODULE_AUTHOR("Greg Ungerer <gerg@snapgear.com>"); |
650 | MODULE_DESCRIPTION("Freescale ColdFire UART driver"); | 650 | MODULE_DESCRIPTION("Freescale ColdFire UART driver"); |
651 | MODULE_LICENSE("GPL"); | 651 | MODULE_LICENSE("GPL"); |
652 | MODULE_ALIAS("platform:mcfuart"); | ||
652 | 653 | ||
653 | /****************************************************************************/ | 654 | /****************************************************************************/ |
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index a638f23c6c61..d93b3578c5e2 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c | |||
@@ -1188,6 +1188,8 @@ mpc52xx_uart_resume(struct platform_device *dev) | |||
1188 | } | 1188 | } |
1189 | #endif | 1189 | #endif |
1190 | 1190 | ||
1191 | /* work with hotplug and coldplug */ | ||
1192 | MODULE_ALIAS("platform:mpc52xx-psc"); | ||
1191 | 1193 | ||
1192 | static struct platform_driver mpc52xx_uart_platform_driver = { | 1194 | static struct platform_driver mpc52xx_uart_platform_driver = { |
1193 | .probe = mpc52xx_uart_probe, | 1195 | .probe = mpc52xx_uart_probe, |
diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c index cb3a91967742..e8819c43f57d 100644 --- a/drivers/serial/mpsc.c +++ b/drivers/serial/mpsc.c | |||
@@ -1964,6 +1964,7 @@ static struct platform_driver mpsc_driver = { | |||
1964 | .remove = mpsc_drv_remove, | 1964 | .remove = mpsc_drv_remove, |
1965 | .driver = { | 1965 | .driver = { |
1966 | .name = MPSC_CTLR_NAME, | 1966 | .name = MPSC_CTLR_NAME, |
1967 | .owner = THIS_MODULE, | ||
1967 | }, | 1968 | }, |
1968 | }; | 1969 | }; |
1969 | 1970 | ||
@@ -2007,3 +2008,4 @@ MODULE_DESCRIPTION("Generic Marvell MPSC serial/UART driver $Revision: 1.00 $"); | |||
2007 | MODULE_VERSION(MPSC_VERSION); | 2008 | MODULE_VERSION(MPSC_VERSION); |
2008 | MODULE_LICENSE("GPL"); | 2009 | MODULE_LICENSE("GPL"); |
2009 | MODULE_ALIAS_CHARDEV_MAJOR(MPSC_MAJOR); | 2010 | MODULE_ALIAS_CHARDEV_MAJOR(MPSC_MAJOR); |
2011 | MODULE_ALIAS("platform:" MPSC_CTLR_NAME); | ||
diff --git a/drivers/serial/netx-serial.c b/drivers/serial/netx-serial.c index b56f7db45031..3123ffeac8ad 100644 --- a/drivers/serial/netx-serial.c +++ b/drivers/serial/netx-serial.c | |||
@@ -713,6 +713,7 @@ static struct platform_driver serial_netx_driver = { | |||
713 | 713 | ||
714 | .driver = { | 714 | .driver = { |
715 | .name = DRIVER_NAME, | 715 | .name = DRIVER_NAME, |
716 | .owner = THIS_MODULE, | ||
716 | }, | 717 | }, |
717 | }; | 718 | }; |
718 | 719 | ||
@@ -745,3 +746,4 @@ module_exit(netx_serial_exit); | |||
745 | MODULE_AUTHOR("Sascha Hauer"); | 746 | MODULE_AUTHOR("Sascha Hauer"); |
746 | MODULE_DESCRIPTION("NetX serial port driver"); | 747 | MODULE_DESCRIPTION("NetX serial port driver"); |
747 | MODULE_LICENSE("GPL"); | 748 | MODULE_LICENSE("GPL"); |
749 | MODULE_ALIAS("platform:" DRIVER_NAME); | ||
diff --git a/drivers/serial/pnx8xxx_uart.c b/drivers/serial/pnx8xxx_uart.c index 8d01c59e8d04..d0e5a79ea635 100644 --- a/drivers/serial/pnx8xxx_uart.c +++ b/drivers/serial/pnx8xxx_uart.c | |||
@@ -850,3 +850,4 @@ MODULE_AUTHOR("Embedded Alley Solutions, Inc."); | |||
850 | MODULE_DESCRIPTION("PNX8XXX SoCs serial port driver"); | 850 | MODULE_DESCRIPTION("PNX8XXX SoCs serial port driver"); |
851 | MODULE_LICENSE("GPL"); | 851 | MODULE_LICENSE("GPL"); |
852 | MODULE_ALIAS_CHARDEV_MAJOR(SERIAL_PNX8XXX_MAJOR); | 852 | MODULE_ALIAS_CHARDEV_MAJOR(SERIAL_PNX8XXX_MAJOR); |
853 | MODULE_ALIAS("platform:pnx8xxx-uart"); | ||
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c index 352fcb8926a6..b4f7ffb7688d 100644 --- a/drivers/serial/pxa.c +++ b/drivers/serial/pxa.c | |||
@@ -833,6 +833,7 @@ static struct platform_driver serial_pxa_driver = { | |||
833 | .resume = serial_pxa_resume, | 833 | .resume = serial_pxa_resume, |
834 | .driver = { | 834 | .driver = { |
835 | .name = "pxa2xx-uart", | 835 | .name = "pxa2xx-uart", |
836 | .owner = THIS_MODULE, | ||
836 | }, | 837 | }, |
837 | }; | 838 | }; |
838 | 839 | ||
@@ -861,4 +862,4 @@ module_init(serial_pxa_init); | |||
861 | module_exit(serial_pxa_exit); | 862 | module_exit(serial_pxa_exit); |
862 | 863 | ||
863 | MODULE_LICENSE("GPL"); | 864 | MODULE_LICENSE("GPL"); |
864 | 865 | MODULE_ALIAS("platform:pxa2xx-uart"); | |
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c index 45de19366030..4ffa2585429a 100644 --- a/drivers/serial/s3c2410.c +++ b/drivers/serial/s3c2410.c | |||
@@ -1935,3 +1935,7 @@ console_initcall(s3c24xx_serial_initconsole); | |||
1935 | MODULE_LICENSE("GPL"); | 1935 | MODULE_LICENSE("GPL"); |
1936 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); | 1936 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); |
1937 | MODULE_DESCRIPTION("Samsung S3C2410/S3C2440/S3C2412 Serial port driver"); | 1937 | MODULE_DESCRIPTION("Samsung S3C2410/S3C2440/S3C2412 Serial port driver"); |
1938 | MODULE_ALIAS("platform:s3c2400-uart"); | ||
1939 | MODULE_ALIAS("platform:s3c2410-uart"); | ||
1940 | MODULE_ALIAS("platform:s3c2412-uart"); | ||
1941 | MODULE_ALIAS("platform:s3c2440-uart"); | ||
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index 58a83c27e14b..67b2338913c2 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c | |||
@@ -884,6 +884,7 @@ static struct platform_driver sa11x0_serial_driver = { | |||
884 | .resume = sa1100_serial_resume, | 884 | .resume = sa1100_serial_resume, |
885 | .driver = { | 885 | .driver = { |
886 | .name = "sa11x0-uart", | 886 | .name = "sa11x0-uart", |
887 | .owner = THIS_MODULE, | ||
887 | }, | 888 | }, |
888 | }; | 889 | }; |
889 | 890 | ||
@@ -917,3 +918,4 @@ MODULE_AUTHOR("Deep Blue Solutions Ltd"); | |||
917 | MODULE_DESCRIPTION("SA1100 generic serial port driver $Revision: 1.50 $"); | 918 | MODULE_DESCRIPTION("SA1100 generic serial port driver $Revision: 1.50 $"); |
918 | MODULE_LICENSE("GPL"); | 919 | MODULE_LICENSE("GPL"); |
919 | MODULE_ALIAS_CHARDEV_MAJOR(SERIAL_SA1100_MAJOR); | 920 | MODULE_ALIAS_CHARDEV_MAJOR(SERIAL_SA1100_MAJOR); |
921 | MODULE_ALIAS("platform:sa11x0-uart"); | ||
diff --git a/drivers/serial/sc26xx.c b/drivers/serial/sc26xx.c index a350b6d2a181..ae2a9e2df777 100644 --- a/drivers/serial/sc26xx.c +++ b/drivers/serial/sc26xx.c | |||
@@ -732,6 +732,7 @@ static struct platform_driver sc26xx_driver = { | |||
732 | .remove = __devexit_p(sc26xx_driver_remove), | 732 | .remove = __devexit_p(sc26xx_driver_remove), |
733 | .driver = { | 733 | .driver = { |
734 | .name = "SC26xx", | 734 | .name = "SC26xx", |
735 | .owner = THIS_MODULE, | ||
735 | }, | 736 | }, |
736 | }; | 737 | }; |
737 | 738 | ||
@@ -753,3 +754,4 @@ MODULE_AUTHOR("Thomas Bogendörfer"); | |||
753 | MODULE_DESCRIPTION("SC681/SC2692 serial driver"); | 754 | MODULE_DESCRIPTION("SC681/SC2692 serial driver"); |
754 | MODULE_VERSION("1.0"); | 755 | MODULE_VERSION("1.0"); |
755 | MODULE_LICENSE("GPL"); | 756 | MODULE_LICENSE("GPL"); |
757 | MODULE_ALIAS("platform:SC26xx"); | ||
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 0f5a17987cca..c32c1ca75f63 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -1771,7 +1771,7 @@ static int uart_read_proc(char *page, char **start, off_t off, | |||
1771 | } | 1771 | } |
1772 | #endif | 1772 | #endif |
1773 | 1773 | ||
1774 | #ifdef CONFIG_SERIAL_CORE_CONSOLE | 1774 | #if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(CONFIG_CONSOLE_POLL) |
1775 | /* | 1775 | /* |
1776 | * uart_console_write - write a console message to a serial port | 1776 | * uart_console_write - write a console message to a serial port |
1777 | * @port: the port to write the message | 1777 | * @port: the port to write the message |
@@ -1827,7 +1827,7 @@ uart_get_console(struct uart_port *ports, int nr, struct console *co) | |||
1827 | * options. The format of the string is <baud><parity><bits><flow>, | 1827 | * options. The format of the string is <baud><parity><bits><flow>, |
1828 | * eg: 115200n8r | 1828 | * eg: 115200n8r |
1829 | */ | 1829 | */ |
1830 | void __init | 1830 | void |
1831 | uart_parse_options(char *options, int *baud, int *parity, int *bits, int *flow) | 1831 | uart_parse_options(char *options, int *baud, int *parity, int *bits, int *flow) |
1832 | { | 1832 | { |
1833 | char *s = options; | 1833 | char *s = options; |
@@ -1842,6 +1842,7 @@ uart_parse_options(char *options, int *baud, int *parity, int *bits, int *flow) | |||
1842 | if (*s) | 1842 | if (*s) |
1843 | *flow = *s; | 1843 | *flow = *s; |
1844 | } | 1844 | } |
1845 | EXPORT_SYMBOL_GPL(uart_parse_options); | ||
1845 | 1846 | ||
1846 | struct baud_rates { | 1847 | struct baud_rates { |
1847 | unsigned int rate; | 1848 | unsigned int rate; |
@@ -1872,7 +1873,7 @@ static const struct baud_rates baud_rates[] = { | |||
1872 | * @bits: number of data bits | 1873 | * @bits: number of data bits |
1873 | * @flow: flow control character - 'r' (rts) | 1874 | * @flow: flow control character - 'r' (rts) |
1874 | */ | 1875 | */ |
1875 | int __init | 1876 | int |
1876 | uart_set_options(struct uart_port *port, struct console *co, | 1877 | uart_set_options(struct uart_port *port, struct console *co, |
1877 | int baud, int parity, int bits, int flow) | 1878 | int baud, int parity, int bits, int flow) |
1878 | { | 1879 | { |
@@ -1924,10 +1925,16 @@ uart_set_options(struct uart_port *port, struct console *co, | |||
1924 | port->mctrl |= TIOCM_DTR; | 1925 | port->mctrl |= TIOCM_DTR; |
1925 | 1926 | ||
1926 | port->ops->set_termios(port, &termios, &dummy); | 1927 | port->ops->set_termios(port, &termios, &dummy); |
1927 | co->cflag = termios.c_cflag; | 1928 | /* |
1929 | * Allow the setting of the UART parameters with a NULL console | ||
1930 | * too: | ||
1931 | */ | ||
1932 | if (co) | ||
1933 | co->cflag = termios.c_cflag; | ||
1928 | 1934 | ||
1929 | return 0; | 1935 | return 0; |
1930 | } | 1936 | } |
1937 | EXPORT_SYMBOL_GPL(uart_set_options); | ||
1931 | #endif /* CONFIG_SERIAL_CORE_CONSOLE */ | 1938 | #endif /* CONFIG_SERIAL_CORE_CONSOLE */ |
1932 | 1939 | ||
1933 | static void uart_change_pm(struct uart_state *state, int pm_state) | 1940 | static void uart_change_pm(struct uart_state *state, int pm_state) |
@@ -2182,6 +2189,60 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state, | |||
2182 | } | 2189 | } |
2183 | } | 2190 | } |
2184 | 2191 | ||
2192 | #ifdef CONFIG_CONSOLE_POLL | ||
2193 | |||
2194 | static int uart_poll_init(struct tty_driver *driver, int line, char *options) | ||
2195 | { | ||
2196 | struct uart_driver *drv = driver->driver_state; | ||
2197 | struct uart_state *state = drv->state + line; | ||
2198 | struct uart_port *port; | ||
2199 | int baud = 9600; | ||
2200 | int bits = 8; | ||
2201 | int parity = 'n'; | ||
2202 | int flow = 'n'; | ||
2203 | |||
2204 | if (!state || !state->port) | ||
2205 | return -1; | ||
2206 | |||
2207 | port = state->port; | ||
2208 | if (!(port->ops->poll_get_char && port->ops->poll_put_char)) | ||
2209 | return -1; | ||
2210 | |||
2211 | if (options) { | ||
2212 | uart_parse_options(options, &baud, &parity, &bits, &flow); | ||
2213 | return uart_set_options(port, NULL, baud, parity, bits, flow); | ||
2214 | } | ||
2215 | |||
2216 | return 0; | ||
2217 | } | ||
2218 | |||
2219 | static int uart_poll_get_char(struct tty_driver *driver, int line) | ||
2220 | { | ||
2221 | struct uart_driver *drv = driver->driver_state; | ||
2222 | struct uart_state *state = drv->state + line; | ||
2223 | struct uart_port *port; | ||
2224 | |||
2225 | if (!state || !state->port) | ||
2226 | return -1; | ||
2227 | |||
2228 | port = state->port; | ||
2229 | return port->ops->poll_get_char(port); | ||
2230 | } | ||
2231 | |||
2232 | static void uart_poll_put_char(struct tty_driver *driver, int line, char ch) | ||
2233 | { | ||
2234 | struct uart_driver *drv = driver->driver_state; | ||
2235 | struct uart_state *state = drv->state + line; | ||
2236 | struct uart_port *port; | ||
2237 | |||
2238 | if (!state || !state->port) | ||
2239 | return; | ||
2240 | |||
2241 | port = state->port; | ||
2242 | port->ops->poll_put_char(port, ch); | ||
2243 | } | ||
2244 | #endif | ||
2245 | |||
2185 | static const struct tty_operations uart_ops = { | 2246 | static const struct tty_operations uart_ops = { |
2186 | .open = uart_open, | 2247 | .open = uart_open, |
2187 | .close = uart_close, | 2248 | .close = uart_close, |
@@ -2206,6 +2267,11 @@ static const struct tty_operations uart_ops = { | |||
2206 | #endif | 2267 | #endif |
2207 | .tiocmget = uart_tiocmget, | 2268 | .tiocmget = uart_tiocmget, |
2208 | .tiocmset = uart_tiocmset, | 2269 | .tiocmset = uart_tiocmset, |
2270 | #ifdef CONFIG_CONSOLE_POLL | ||
2271 | .poll_init = uart_poll_init, | ||
2272 | .poll_get_char = uart_poll_get_char, | ||
2273 | .poll_put_char = uart_poll_put_char, | ||
2274 | #endif | ||
2209 | }; | 2275 | }; |
2210 | 2276 | ||
2211 | /** | 2277 | /** |
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 9d244d1644e1..eff593080d4f 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -1552,3 +1552,4 @@ module_init(sci_init); | |||
1552 | module_exit(sci_exit); | 1552 | module_exit(sci_exit); |
1553 | 1553 | ||
1554 | MODULE_LICENSE("GPL"); | 1554 | MODULE_LICENSE("GPL"); |
1555 | MODULE_ALIAS("platform:sh-sci"); | ||
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c index 4e06ab6bcb6e..b565d5a37499 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c | |||
@@ -561,6 +561,9 @@ static int __devexit ulite_remove(struct platform_device *pdev) | |||
561 | return ulite_release(&pdev->dev); | 561 | return ulite_release(&pdev->dev); |
562 | } | 562 | } |
563 | 563 | ||
564 | /* work with hotplug and coldplug */ | ||
565 | MODULE_ALIAS("platform:uartlite"); | ||
566 | |||
564 | static struct platform_driver ulite_platform_driver = { | 567 | static struct platform_driver ulite_platform_driver = { |
565 | .probe = ulite_probe, | 568 | .probe = ulite_probe, |
566 | .remove = __devexit_p(ulite_remove), | 569 | .remove = __devexit_p(ulite_remove), |
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c index 6fd51b0022ca..98ab649c1ff9 100644 --- a/drivers/serial/vr41xx_siu.c +++ b/drivers/serial/vr41xx_siu.c | |||
@@ -960,3 +960,6 @@ static void __exit vr41xx_siu_exit(void) | |||
960 | 960 | ||
961 | module_init(vr41xx_siu_init); | 961 | module_init(vr41xx_siu_init); |
962 | module_exit(vr41xx_siu_exit); | 962 | module_exit(vr41xx_siu_exit); |
963 | |||
964 | MODULE_LICENSE("GPL"); | ||
965 | MODULE_ALIAS("platform:SIU"); | ||