aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/8250/8250.c (renamed from drivers/tty/serial/8250.c)0
-rw-r--r--drivers/tty/serial/8250/8250.h (renamed from drivers/tty/serial/8250.h)0
-rw-r--r--drivers/tty/serial/8250/8250_accent.c (renamed from drivers/tty/serial/8250_accent.c)0
-rw-r--r--drivers/tty/serial/8250/8250_acorn.c (renamed from drivers/tty/serial/8250_acorn.c)0
-rw-r--r--drivers/tty/serial/8250/8250_boca.c (renamed from drivers/tty/serial/8250_boca.c)0
-rw-r--r--drivers/tty/serial/8250/8250_dw.c (renamed from drivers/tty/serial/8250_dw.c)0
-rw-r--r--drivers/tty/serial/8250/8250_early.c (renamed from drivers/tty/serial/8250_early.c)0
-rw-r--r--drivers/tty/serial/8250/8250_exar_st16c554.c (renamed from drivers/tty/serial/8250_exar_st16c554.c)0
-rw-r--r--drivers/tty/serial/8250/8250_fourport.c (renamed from drivers/tty/serial/8250_fourport.c)0
-rw-r--r--drivers/tty/serial/8250/8250_fsl.c (renamed from drivers/tty/serial/8250_fsl.c)0
-rw-r--r--drivers/tty/serial/8250/8250_gsc.c (renamed from drivers/tty/serial/8250_gsc.c)0
-rw-r--r--drivers/tty/serial/8250/8250_hp300.c (renamed from drivers/tty/serial/8250_hp300.c)0
-rw-r--r--drivers/tty/serial/8250/8250_hub6.c (renamed from drivers/tty/serial/8250_hub6.c)0
-rw-r--r--drivers/tty/serial/8250/8250_mca.c (renamed from drivers/tty/serial/8250_mca.c)0
-rw-r--r--drivers/tty/serial/8250/8250_pci.c (renamed from drivers/tty/serial/8250_pci.c)0
-rw-r--r--drivers/tty/serial/8250/8250_pnp.c (renamed from drivers/tty/serial/8250_pnp.c)0
-rw-r--r--drivers/tty/serial/8250/Kconfig280
-rw-r--r--drivers/tty/serial/8250/Makefile20
-rw-r--r--drivers/tty/serial/8250/m32r_sio.c (renamed from drivers/tty/serial/m32r_sio.c)0
-rw-r--r--drivers/tty/serial/8250/m32r_sio.h (renamed from drivers/tty/serial/m32r_sio.h)0
-rw-r--r--drivers/tty/serial/8250/m32r_sio_reg.h (renamed from drivers/tty/serial/m32r_sio_reg.h)0
-rw-r--r--drivers/tty/serial/8250/serial_cs.c (renamed from drivers/tty/serial/serial_cs.c)0
-rw-r--r--drivers/tty/serial/Kconfig283
-rw-r--r--drivers/tty/serial/Makefile20
-rw-r--r--drivers/tty/serial/amba-pl011.c30
-rw-r--r--drivers/tty/serial/jsm/jsm_driver.c1
-rw-r--r--drivers/tty/serial/max3107-aava.c344
-rw-r--r--drivers/tty/serial/omap-serial.c4
-rw-r--r--drivers/tty/serial/serial_core.c6
-rw-r--r--drivers/tty/tty_port.c12
30 files changed, 345 insertions, 655 deletions
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250/8250.c
index 9f50c4e3c2be..9f50c4e3c2be 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250/8250.c
diff --git a/drivers/tty/serial/8250.h b/drivers/tty/serial/8250/8250.h
index ae027be57e25..ae027be57e25 100644
--- a/drivers/tty/serial/8250.h
+++ b/drivers/tty/serial/8250/8250.h
diff --git a/drivers/tty/serial/8250_accent.c b/drivers/tty/serial/8250/8250_accent.c
index 34b51c651192..34b51c651192 100644
--- a/drivers/tty/serial/8250_accent.c
+++ b/drivers/tty/serial/8250/8250_accent.c
diff --git a/drivers/tty/serial/8250_acorn.c b/drivers/tty/serial/8250/8250_acorn.c
index b0ce8c56f1a4..b0ce8c56f1a4 100644
--- a/drivers/tty/serial/8250_acorn.c
+++ b/drivers/tty/serial/8250/8250_acorn.c
diff --git a/drivers/tty/serial/8250_boca.c b/drivers/tty/serial/8250/8250_boca.c
index d125dc107985..d125dc107985 100644
--- a/drivers/tty/serial/8250_boca.c
+++ b/drivers/tty/serial/8250/8250_boca.c
diff --git a/drivers/tty/serial/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index f574eef3075f..f574eef3075f 100644
--- a/drivers/tty/serial/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
diff --git a/drivers/tty/serial/8250_early.c b/drivers/tty/serial/8250/8250_early.c
index eaafb98debed..eaafb98debed 100644
--- a/drivers/tty/serial/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
diff --git a/drivers/tty/serial/8250_exar_st16c554.c b/drivers/tty/serial/8250/8250_exar_st16c554.c
index bf53aabf9b5e..bf53aabf9b5e 100644
--- a/drivers/tty/serial/8250_exar_st16c554.c
+++ b/drivers/tty/serial/8250/8250_exar_st16c554.c
diff --git a/drivers/tty/serial/8250_fourport.c b/drivers/tty/serial/8250/8250_fourport.c
index be1582609626..be1582609626 100644
--- a/drivers/tty/serial/8250_fourport.c
+++ b/drivers/tty/serial/8250/8250_fourport.c
diff --git a/drivers/tty/serial/8250_fsl.c b/drivers/tty/serial/8250/8250_fsl.c
index f4d3c47b88e8..f4d3c47b88e8 100644
--- a/drivers/tty/serial/8250_fsl.c
+++ b/drivers/tty/serial/8250/8250_fsl.c
diff --git a/drivers/tty/serial/8250_gsc.c b/drivers/tty/serial/8250/8250_gsc.c
index d8c0ffbfa6e3..d8c0ffbfa6e3 100644
--- a/drivers/tty/serial/8250_gsc.c
+++ b/drivers/tty/serial/8250/8250_gsc.c
diff --git a/drivers/tty/serial/8250_hp300.c b/drivers/tty/serial/8250/8250_hp300.c
index c13438c93012..c13438c93012 100644
--- a/drivers/tty/serial/8250_hp300.c
+++ b/drivers/tty/serial/8250/8250_hp300.c
diff --git a/drivers/tty/serial/8250_hub6.c b/drivers/tty/serial/8250/8250_hub6.c
index a5c778e83de0..a5c778e83de0 100644
--- a/drivers/tty/serial/8250_hub6.c
+++ b/drivers/tty/serial/8250/8250_hub6.c
diff --git a/drivers/tty/serial/8250_mca.c b/drivers/tty/serial/8250/8250_mca.c
index d20abf04541e..d20abf04541e 100644
--- a/drivers/tty/serial/8250_mca.c
+++ b/drivers/tty/serial/8250/8250_mca.c
diff --git a/drivers/tty/serial/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index da2b0b0a183f..da2b0b0a183f 100644
--- a/drivers/tty/serial/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
diff --git a/drivers/tty/serial/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c
index a2f236510ff1..a2f236510ff1 100644
--- a/drivers/tty/serial/8250_pnp.c
+++ b/drivers/tty/serial/8250/8250_pnp.c
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
new file mode 100644
index 000000000000..591f8018e7dd
--- /dev/null
+++ b/drivers/tty/serial/8250/Kconfig
@@ -0,0 +1,280 @@
1#
2# The 8250/16550 serial drivers. You shouldn't be in this list unless
3# you somehow have an implicit or explicit dependency on SERIAL_8250.
4#
5
6config SERIAL_8250
7 tristate "8250/16550 and compatible serial support"
8 select SERIAL_CORE
9 ---help---
10 This selects whether you want to include the driver for the standard
11 serial ports. The standard answer is Y. People who might say N
12 here are those that are setting up dedicated Ethernet WWW/FTP
13 servers, or users that have one of the various bus mice instead of a
14 serial mouse and don't intend to use their machine's standard serial
15 port for anything. (Note that the Cyclades and Stallion multi
16 serial port drivers do not need this driver built in for them to
17 work.)
18
19 To compile this driver as a module, choose M here: the
20 module will be called 8250.
21 [WARNING: Do not compile this driver as a module if you are using
22 non-standard serial ports, since the configuration information will
23 be lost when the driver is unloaded. This limitation may be lifted
24 in the future.]
25
26 BTW1: If you have a mouseman serial mouse which is not recognized by
27 the X window system, try running gpm first.
28
29 BTW2: If you intend to use a software modem (also called Winmodem)
30 under Linux, forget it. These modems are crippled and require
31 proprietary drivers which are only available under Windows.
32
33 Most people will say Y or M here, so that they can use serial mice,
34 modems and similar devices connecting to the standard serial ports.
35
36config SERIAL_8250_CONSOLE
37 bool "Console on 8250/16550 and compatible serial port"
38 depends on SERIAL_8250=y
39 select SERIAL_CORE_CONSOLE
40 ---help---
41 If you say Y here, it will be possible to use a serial port as the
42 system console (the system console is the device which receives all
43 kernel messages and warnings and which allows logins in single user
44 mode). This could be useful if some terminal or printer is connected
45 to that serial port.
46
47 Even if you say Y here, the currently visible virtual console
48 (/dev/tty0) will still be used as the system console by default, but
49 you can alter that using a kernel command line option such as
50 "console=ttyS1". (Try "man bootparam" or see the documentation of
51 your boot loader (grub or lilo or loadlin) about how to pass options
52 to the kernel at boot time.)
53
54 If you don't have a VGA card installed and you say Y here, the
55 kernel will automatically use the first serial line, /dev/ttyS0, as
56 system console.
57
58 You can set that using a kernel command line option such as
59 "console=uart8250,io,0x3f8,9600n8"
60 "console=uart8250,mmio,0xff5e0000,115200n8".
61 and it will switch to normal serial console when the corresponding
62 port is ready.
63 "earlycon=uart8250,io,0x3f8,9600n8"
64 "earlycon=uart8250,mmio,0xff5e0000,115200n8".
65 it will not only setup early console.
66
67 If unsure, say N.
68
69config FIX_EARLYCON_MEM
70 bool
71 depends on X86
72 default y
73
74config SERIAL_8250_GSC
75 tristate
76 depends on SERIAL_8250 && GSC
77 default SERIAL_8250
78
79config SERIAL_8250_PCI
80 tristate "8250/16550 PCI device support" if EXPERT
81 depends on SERIAL_8250 && PCI
82 default SERIAL_8250
83 help
84 This builds standard PCI serial support. You may be able to
85 disable this feature if you only need legacy serial support.
86 Saves about 9K.
87
88config SERIAL_8250_PNP
89 tristate "8250/16550 PNP device support" if EXPERT
90 depends on SERIAL_8250 && PNP
91 default SERIAL_8250
92 help
93 This builds standard PNP serial support. You may be able to
94 disable this feature if you only need legacy serial support.
95
96config SERIAL_8250_HP300
97 tristate
98 depends on SERIAL_8250 && HP300
99 default SERIAL_8250
100
101config SERIAL_8250_CS
102 tristate "8250/16550 PCMCIA device support"
103 depends on PCMCIA && SERIAL_8250
104 ---help---
105 Say Y here to enable support for 16-bit PCMCIA serial devices,
106 including serial port cards, modems, and the modem functions of
107 multi-function Ethernet/modem cards. (PCMCIA- or PC-cards are
108 credit-card size devices often used with laptops.)
109
110 To compile this driver as a module, choose M here: the
111 module will be called serial_cs.
112
113 If unsure, say N.
114
115config SERIAL_8250_NR_UARTS
116 int "Maximum number of 8250/16550 serial ports"
117 depends on SERIAL_8250
118 default "4"
119 help
120 Set this to the number of serial ports you want the driver
121 to support. This includes any ports discovered via ACPI or
122 PCI enumeration and any ports that may be added at run-time
123 via hot-plug, or any ISA multi-port serial cards.
124
125config SERIAL_8250_RUNTIME_UARTS
126 int "Number of 8250/16550 serial ports to register at runtime"
127 depends on SERIAL_8250
128 range 0 SERIAL_8250_NR_UARTS
129 default "4"
130 help
131 Set this to the maximum number of serial ports you want
132 the kernel to register at boot time. This can be overridden
133 with the module parameter "nr_uarts", or boot-time parameter
134 8250.nr_uarts
135
136config SERIAL_8250_EXTENDED
137 bool "Extended 8250/16550 serial driver options"
138 depends on SERIAL_8250
139 help
140 If you wish to use any non-standard features of the standard "dumb"
141 driver, say Y here. This includes HUB6 support, shared serial
142 interrupts, special multiport support, support for more than the
143 four COM 1/2/3/4 boards, etc.
144
145 Note that the answer to this question won't directly affect the
146 kernel: saying N will just cause the configurator to skip all
147 the questions about serial driver options. If unsure, say N.
148
149config SERIAL_8250_MANY_PORTS
150 bool "Support more than 4 legacy serial ports"
151 depends on SERIAL_8250_EXTENDED && !IA64
152 help
153 Say Y here if you have dumb serial boards other than the four
154 standard COM 1/2/3/4 ports. This may happen if you have an AST
155 FourPort, Accent Async, Boca (read the Boca mini-HOWTO, available
156 from <http://www.tldp.org/docs.html#howto>), or other custom
157 serial port hardware which acts similar to standard serial port
158 hardware. If you only use the standard COM 1/2/3/4 ports, you can
159 say N here to save some memory. You can also say Y if you have an
160 "intelligent" multiport card such as Cyclades, Digiboards, etc.
161
162#
163# Multi-port serial cards
164#
165
166config SERIAL_8250_FOURPORT
167 tristate "Support Fourport cards"
168 depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
169 help
170 Say Y here if you have an AST FourPort serial board.
171
172 To compile this driver as a module, choose M here: the module
173 will be called 8250_fourport.
174
175config SERIAL_8250_ACCENT
176 tristate "Support Accent cards"
177 depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
178 help
179 Say Y here if you have an Accent Async serial board.
180
181 To compile this driver as a module, choose M here: the module
182 will be called 8250_accent.
183
184config SERIAL_8250_BOCA
185 tristate "Support Boca cards"
186 depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
187 help
188 Say Y here if you have a Boca serial board. Please read the Boca
189 mini-HOWTO, available from <http://www.tldp.org/docs.html#howto>
190
191 To compile this driver as a module, choose M here: the module
192 will be called 8250_boca.
193
194config SERIAL_8250_EXAR_ST16C554
195 tristate "Support Exar ST16C554/554D Quad UART"
196 depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
197 help
198 The Uplogix Envoy TU301 uses this Exar Quad UART. If you are
199 tinkering with your Envoy TU301, or have a machine with this UART,
200 say Y here.
201
202 To compile this driver as a module, choose M here: the module
203 will be called 8250_exar_st16c554.
204
205config SERIAL_8250_HUB6
206 tristate "Support Hub6 cards"
207 depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
208 help
209 Say Y here if you have a HUB6 serial board.
210
211 To compile this driver as a module, choose M here: the module
212 will be called 8250_hub6.
213
214#
215# Misc. options/drivers.
216#
217
218config SERIAL_8250_SHARE_IRQ
219 bool "Support for sharing serial interrupts"
220 depends on SERIAL_8250_EXTENDED
221 help
222 Some serial boards have hardware support which allows multiple dumb
223 serial ports on the same board to share a single IRQ. To enable
224 support for this in the serial driver, say Y here.
225
226config SERIAL_8250_DETECT_IRQ
227 bool "Autodetect IRQ on standard ports (unsafe)"
228 depends on SERIAL_8250_EXTENDED
229 help
230 Say Y here if you want the kernel to try to guess which IRQ
231 to use for your serial port.
232
233 This is considered unsafe; it is far better to configure the IRQ in
234 a boot script using the setserial command.
235
236 If unsure, say N.
237
238config SERIAL_8250_RSA
239 bool "Support RSA serial ports"
240 depends on SERIAL_8250_EXTENDED
241 help
242 ::: To be written :::
243
244config SERIAL_8250_MCA
245 tristate "Support 8250-type ports on MCA buses"
246 depends on SERIAL_8250 != n && MCA
247 help
248 Say Y here if you have a MCA serial ports.
249
250 To compile this driver as a module, choose M here: the module
251 will be called 8250_mca.
252
253config SERIAL_8250_ACORN
254 tristate "Acorn expansion card serial port support"
255 depends on ARCH_ACORN && SERIAL_8250
256 help
257 If you have an Atomwide Serial card or Serial Port card for an Acorn
258 system, say Y to this option. The driver can handle 1, 2, or 3 port
259 cards. If unsure, say N.
260
261config SERIAL_8250_RM9K
262 bool "Support for MIPS RM9xxx integrated serial port"
263 depends on SERIAL_8250 != n && SERIAL_RM9000
264 select SERIAL_8250_SHARE_IRQ
265 help
266 Selecting this option will add support for the integrated serial
267 port hardware found on MIPS RM9122 and similar processors.
268 If unsure, say N.
269
270config SERIAL_8250_FSL
271 bool
272 depends on SERIAL_8250_CONSOLE && PPC_UDBG_16550
273 default PPC
274
275config SERIAL_8250_DW
276 tristate "Support for Synopsys DesignWare 8250 quirks"
277 depends on SERIAL_8250 && OF
278 help
279 Selecting this option will enable handling of the extra features
280 present in the Synopsys DesignWare APB UART.
diff --git a/drivers/tty/serial/8250/Makefile b/drivers/tty/serial/8250/Makefile
new file mode 100644
index 000000000000..867bba738908
--- /dev/null
+++ b/drivers/tty/serial/8250/Makefile
@@ -0,0 +1,20 @@
1#
2# Makefile for the 8250 serial device drivers.
3#
4
5obj-$(CONFIG_SERIAL_8250) += 8250.o
6obj-$(CONFIG_SERIAL_8250_PNP) += 8250_pnp.o
7obj-$(CONFIG_SERIAL_8250_GSC) += 8250_gsc.o
8obj-$(CONFIG_SERIAL_8250_PCI) += 8250_pci.o
9obj-$(CONFIG_SERIAL_8250_HP300) += 8250_hp300.o
10obj-$(CONFIG_SERIAL_8250_CS) += serial_cs.o
11obj-$(CONFIG_SERIAL_8250_ACORN) += 8250_acorn.o
12obj-$(CONFIG_SERIAL_8250_CONSOLE) += 8250_early.o
13obj-$(CONFIG_SERIAL_8250_FOURPORT) += 8250_fourport.o
14obj-$(CONFIG_SERIAL_8250_ACCENT) += 8250_accent.o
15obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_boca.o
16obj-$(CONFIG_SERIAL_8250_EXAR_ST16C554) += 8250_exar_st16c554.o
17obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o
18obj-$(CONFIG_SERIAL_8250_MCA) += 8250_mca.o
19obj-$(CONFIG_SERIAL_8250_FSL) += 8250_fsl.o
20obj-$(CONFIG_SERIAL_8250_DW) += 8250_dw.o
diff --git a/drivers/tty/serial/m32r_sio.c b/drivers/tty/serial/8250/m32r_sio.c
index 94a6792bf97b..94a6792bf97b 100644
--- a/drivers/tty/serial/m32r_sio.c
+++ b/drivers/tty/serial/8250/m32r_sio.c
diff --git a/drivers/tty/serial/m32r_sio.h b/drivers/tty/serial/8250/m32r_sio.h
index e9b7e11793b1..e9b7e11793b1 100644
--- a/drivers/tty/serial/m32r_sio.h
+++ b/drivers/tty/serial/8250/m32r_sio.h
diff --git a/drivers/tty/serial/m32r_sio_reg.h b/drivers/tty/serial/8250/m32r_sio_reg.h
index 4671473793e3..4671473793e3 100644
--- a/drivers/tty/serial/m32r_sio_reg.h
+++ b/drivers/tty/serial/8250/m32r_sio_reg.h
diff --git a/drivers/tty/serial/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
index 86090605a84e..86090605a84e 100644
--- a/drivers/tty/serial/serial_cs.c
+++ b/drivers/tty/serial/8250/serial_cs.c
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index aca2386c5ef1..2de99248dfae 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -5,279 +5,7 @@
5menu "Serial drivers" 5menu "Serial drivers"
6 depends on HAS_IOMEM 6 depends on HAS_IOMEM
7 7
8# 8source "drivers/tty/serial/8250/Kconfig"
9# The new 8250/16550 serial drivers
10config SERIAL_8250
11 tristate "8250/16550 and compatible serial support"
12 select SERIAL_CORE
13 ---help---
14 This selects whether you want to include the driver for the standard
15 serial ports. The standard answer is Y. People who might say N
16 here are those that are setting up dedicated Ethernet WWW/FTP
17 servers, or users that have one of the various bus mice instead of a
18 serial mouse and don't intend to use their machine's standard serial
19 port for anything. (Note that the Cyclades and Stallion multi
20 serial port drivers do not need this driver built in for them to
21 work.)
22
23 To compile this driver as a module, choose M here: the
24 module will be called 8250.
25 [WARNING: Do not compile this driver as a module if you are using
26 non-standard serial ports, since the configuration information will
27 be lost when the driver is unloaded. This limitation may be lifted
28 in the future.]
29
30 BTW1: If you have a mouseman serial mouse which is not recognized by
31 the X window system, try running gpm first.
32
33 BTW2: If you intend to use a software modem (also called Winmodem)
34 under Linux, forget it. These modems are crippled and require
35 proprietary drivers which are only available under Windows.
36
37 Most people will say Y or M here, so that they can use serial mice,
38 modems and similar devices connecting to the standard serial ports.
39
40config SERIAL_8250_CONSOLE
41 bool "Console on 8250/16550 and compatible serial port"
42 depends on SERIAL_8250=y
43 select SERIAL_CORE_CONSOLE
44 ---help---
45 If you say Y here, it will be possible to use a serial port as the
46 system console (the system console is the device which receives all
47 kernel messages and warnings and which allows logins in single user
48 mode). This could be useful if some terminal or printer is connected
49 to that serial port.
50
51 Even if you say Y here, the currently visible virtual console
52 (/dev/tty0) will still be used as the system console by default, but
53 you can alter that using a kernel command line option such as
54 "console=ttyS1". (Try "man bootparam" or see the documentation of
55 your boot loader (grub or lilo or loadlin) about how to pass options
56 to the kernel at boot time.)
57
58 If you don't have a VGA card installed and you say Y here, the
59 kernel will automatically use the first serial line, /dev/ttyS0, as
60 system console.
61
62 You can set that using a kernel command line option such as
63 "console=uart8250,io,0x3f8,9600n8"
64 "console=uart8250,mmio,0xff5e0000,115200n8".
65 and it will switch to normal serial console when the corresponding
66 port is ready.
67 "earlycon=uart8250,io,0x3f8,9600n8"
68 "earlycon=uart8250,mmio,0xff5e0000,115200n8".
69 it will not only setup early console.
70
71 If unsure, say N.
72
73config FIX_EARLYCON_MEM
74 bool
75 depends on X86
76 default y
77
78config SERIAL_8250_GSC
79 tristate
80 depends on SERIAL_8250 && GSC
81 default SERIAL_8250
82
83config SERIAL_8250_PCI
84 tristate "8250/16550 PCI device support" if EXPERT
85 depends on SERIAL_8250 && PCI
86 default SERIAL_8250
87 help
88 This builds standard PCI serial support. You may be able to
89 disable this feature if you only need legacy serial support.
90 Saves about 9K.
91
92config SERIAL_8250_PNP
93 tristate "8250/16550 PNP device support" if EXPERT
94 depends on SERIAL_8250 && PNP
95 default SERIAL_8250
96 help
97 This builds standard PNP serial support. You may be able to
98 disable this feature if you only need legacy serial support.
99
100config SERIAL_8250_FSL
101 bool
102 depends on SERIAL_8250_CONSOLE && PPC_UDBG_16550
103 default PPC
104
105config SERIAL_8250_HP300
106 tristate
107 depends on SERIAL_8250 && HP300
108 default SERIAL_8250
109
110config SERIAL_8250_CS
111 tristate "8250/16550 PCMCIA device support"
112 depends on PCMCIA && SERIAL_8250
113 ---help---
114 Say Y here to enable support for 16-bit PCMCIA serial devices,
115 including serial port cards, modems, and the modem functions of
116 multi-function Ethernet/modem cards. (PCMCIA- or PC-cards are
117 credit-card size devices often used with laptops.)
118
119 To compile this driver as a module, choose M here: the
120 module will be called serial_cs.
121
122 If unsure, say N.
123
124config SERIAL_8250_NR_UARTS
125 int "Maximum number of 8250/16550 serial ports"
126 depends on SERIAL_8250
127 default "4"
128 help
129 Set this to the number of serial ports you want the driver
130 to support. This includes any ports discovered via ACPI or
131 PCI enumeration and any ports that may be added at run-time
132 via hot-plug, or any ISA multi-port serial cards.
133
134config SERIAL_8250_RUNTIME_UARTS
135 int "Number of 8250/16550 serial ports to register at runtime"
136 depends on SERIAL_8250
137 range 0 SERIAL_8250_NR_UARTS
138 default "4"
139 help
140 Set this to the maximum number of serial ports you want
141 the kernel to register at boot time. This can be overridden
142 with the module parameter "nr_uarts", or boot-time parameter
143 8250.nr_uarts
144
145config SERIAL_8250_EXTENDED
146 bool "Extended 8250/16550 serial driver options"
147 depends on SERIAL_8250
148 help
149 If you wish to use any non-standard features of the standard "dumb"
150 driver, say Y here. This includes HUB6 support, shared serial
151 interrupts, special multiport support, support for more than the
152 four COM 1/2/3/4 boards, etc.
153
154 Note that the answer to this question won't directly affect the
155 kernel: saying N will just cause the configurator to skip all
156 the questions about serial driver options. If unsure, say N.
157
158config SERIAL_8250_MANY_PORTS
159 bool "Support more than 4 legacy serial ports"
160 depends on SERIAL_8250_EXTENDED && !IA64
161 help
162 Say Y here if you have dumb serial boards other than the four
163 standard COM 1/2/3/4 ports. This may happen if you have an AST
164 FourPort, Accent Async, Boca (read the Boca mini-HOWTO, available
165 from <http://www.tldp.org/docs.html#howto>), or other custom
166 serial port hardware which acts similar to standard serial port
167 hardware. If you only use the standard COM 1/2/3/4 ports, you can
168 say N here to save some memory. You can also say Y if you have an
169 "intelligent" multiport card such as Cyclades, Digiboards, etc.
170
171#
172# Multi-port serial cards
173#
174
175config SERIAL_8250_FOURPORT
176 tristate "Support Fourport cards"
177 depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
178 help
179 Say Y here if you have an AST FourPort serial board.
180
181 To compile this driver as a module, choose M here: the module
182 will be called 8250_fourport.
183
184config SERIAL_8250_ACCENT
185 tristate "Support Accent cards"
186 depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
187 help
188 Say Y here if you have an Accent Async serial board.
189
190 To compile this driver as a module, choose M here: the module
191 will be called 8250_accent.
192
193config SERIAL_8250_BOCA
194 tristate "Support Boca cards"
195 depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
196 help
197 Say Y here if you have a Boca serial board. Please read the Boca
198 mini-HOWTO, available from <http://www.tldp.org/docs.html#howto>
199
200 To compile this driver as a module, choose M here: the module
201 will be called 8250_boca.
202
203config SERIAL_8250_EXAR_ST16C554
204 tristate "Support Exar ST16C554/554D Quad UART"
205 depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
206 help
207 The Uplogix Envoy TU301 uses this Exar Quad UART. If you are
208 tinkering with your Envoy TU301, or have a machine with this UART,
209 say Y here.
210
211 To compile this driver as a module, choose M here: the module
212 will be called 8250_exar_st16c554.
213
214config SERIAL_8250_HUB6
215 tristate "Support Hub6 cards"
216 depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
217 help
218 Say Y here if you have a HUB6 serial board.
219
220 To compile this driver as a module, choose M here: the module
221 will be called 8250_hub6.
222
223config SERIAL_8250_SHARE_IRQ
224 bool "Support for sharing serial interrupts"
225 depends on SERIAL_8250_EXTENDED
226 help
227 Some serial boards have hardware support which allows multiple dumb
228 serial ports on the same board to share a single IRQ. To enable
229 support for this in the serial driver, say Y here.
230
231config SERIAL_8250_DETECT_IRQ
232 bool "Autodetect IRQ on standard ports (unsafe)"
233 depends on SERIAL_8250_EXTENDED
234 help
235 Say Y here if you want the kernel to try to guess which IRQ
236 to use for your serial port.
237
238 This is considered unsafe; it is far better to configure the IRQ in
239 a boot script using the setserial command.
240
241 If unsure, say N.
242
243config SERIAL_8250_RSA
244 bool "Support RSA serial ports"
245 depends on SERIAL_8250_EXTENDED
246 help
247 ::: To be written :::
248
249config SERIAL_8250_MCA
250 tristate "Support 8250-type ports on MCA buses"
251 depends on SERIAL_8250 != n && MCA
252 help
253 Say Y here if you have a MCA serial ports.
254
255 To compile this driver as a module, choose M here: the module
256 will be called 8250_mca.
257
258config SERIAL_8250_ACORN
259 tristate "Acorn expansion card serial port support"
260 depends on ARCH_ACORN && SERIAL_8250
261 help
262 If you have an Atomwide Serial card or Serial Port card for an Acorn
263 system, say Y to this option. The driver can handle 1, 2, or 3 port
264 cards. If unsure, say N.
265
266config SERIAL_8250_RM9K
267 bool "Support for MIPS RM9xxx integrated serial port"
268 depends on SERIAL_8250 != n && SERIAL_RM9000
269 select SERIAL_8250_SHARE_IRQ
270 help
271 Selecting this option will add support for the integrated serial
272 port hardware found on MIPS RM9122 and similar processors.
273 If unsure, say N.
274
275config SERIAL_8250_DW
276 tristate "Support for Synopsys DesignWare 8250 quirks"
277 depends on SERIAL_8250 && OF
278 help
279 Selecting this option will enable handling of the extra features
280 present in the Synopsys DesignWare APB UART.
281 9
282comment "Non-8250 serial port support" 10comment "Non-8250 serial port support"
283 11
@@ -536,15 +264,6 @@ config SERIAL_MAX3107
536 help 264 help
537 MAX3107 chip support 265 MAX3107 chip support
538 266
539config SERIAL_MAX3107_AAVA
540 tristate "MAX3107 AAVA platform support"
541 depends on X86_MRST && SERIAL_MAX3107 && GPIOLIB
542 select SERIAL_CORE
543 help
544 Support for the MAX3107 chip configuration found on the AAVA
545 platform. Includes the extra initialisation and GPIO support
546 neded for this device.
547
548config SERIAL_DZ 267config SERIAL_DZ
549 bool "DECstation DZ serial driver" 268 bool "DECstation DZ serial driver"
550 depends on MACH_DECSTATION && 32BIT 269 depends on MACH_DECSTATION && 32BIT
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index f5b01f2ce525..fef32e10c851 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -14,22 +14,9 @@ obj-$(CONFIG_SERIAL_SUNZILOG) += sunzilog.o
14obj-$(CONFIG_SERIAL_SUNSU) += sunsu.o 14obj-$(CONFIG_SERIAL_SUNSU) += sunsu.o
15obj-$(CONFIG_SERIAL_SUNSAB) += sunsab.o 15obj-$(CONFIG_SERIAL_SUNSAB) += sunsab.o
16 16
17obj-$(CONFIG_SERIAL_8250) += 8250.o 17# Now bring in any enabled 8250/16450/16550 type drivers.
18obj-$(CONFIG_SERIAL_8250_PNP) += 8250_pnp.o 18obj-$(CONFIG_SERIAL_8250) += 8250/
19obj-$(CONFIG_SERIAL_8250_GSC) += 8250_gsc.o 19
20obj-$(CONFIG_SERIAL_8250_PCI) += 8250_pci.o
21obj-$(CONFIG_SERIAL_8250_HP300) += 8250_hp300.o
22obj-$(CONFIG_SERIAL_8250_CS) += serial_cs.o
23obj-$(CONFIG_SERIAL_8250_ACORN) += 8250_acorn.o
24obj-$(CONFIG_SERIAL_8250_CONSOLE) += 8250_early.o
25obj-$(CONFIG_SERIAL_8250_FOURPORT) += 8250_fourport.o
26obj-$(CONFIG_SERIAL_8250_ACCENT) += 8250_accent.o
27obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_boca.o
28obj-$(CONFIG_SERIAL_8250_EXAR_ST16C554) += 8250_exar_st16c554.o
29obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o
30obj-$(CONFIG_SERIAL_8250_MCA) += 8250_mca.o
31obj-$(CONFIG_SERIAL_8250_FSL) += 8250_fsl.o
32obj-$(CONFIG_SERIAL_8250_DW) += 8250_dw.o
33obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o 20obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o
34obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o 21obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
35obj-$(CONFIG_SERIAL_CLPS711X) += clps711x.o 22obj-$(CONFIG_SERIAL_CLPS711X) += clps711x.o
@@ -42,7 +29,6 @@ obj-$(CONFIG_SERIAL_BFIN_SPORT) += bfin_sport_uart.o
42obj-$(CONFIG_SERIAL_SAMSUNG) += samsung.o 29obj-$(CONFIG_SERIAL_SAMSUNG) += samsung.o
43obj-$(CONFIG_SERIAL_MAX3100) += max3100.o 30obj-$(CONFIG_SERIAL_MAX3100) += max3100.o
44obj-$(CONFIG_SERIAL_MAX3107) += max3107.o 31obj-$(CONFIG_SERIAL_MAX3107) += max3107.o
45obj-$(CONFIG_SERIAL_MAX3107_AAVA) += max3107-aava.o
46obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o 32obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o
47obj-$(CONFIG_SERIAL_MUX) += mux.o 33obj-$(CONFIG_SERIAL_MUX) += mux.o
48obj-$(CONFIG_SERIAL_68328) += 68328serial.o 34obj-$(CONFIG_SERIAL_68328) += 68328serial.o
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 9ae024025ff3..6800f5f26241 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -159,6 +159,7 @@ struct uart_amba_port {
159 unsigned int fifosize; /* vendor-specific */ 159 unsigned int fifosize; /* vendor-specific */
160 unsigned int lcrh_tx; /* vendor-specific */ 160 unsigned int lcrh_tx; /* vendor-specific */
161 unsigned int lcrh_rx; /* vendor-specific */ 161 unsigned int lcrh_rx; /* vendor-specific */
162 unsigned int old_cr; /* state during shutdown */
162 bool autorts; 163 bool autorts;
163 char type[12]; 164 char type[12];
164 bool interrupt_may_hang; /* vendor-specific */ 165 bool interrupt_may_hang; /* vendor-specific */
@@ -1411,7 +1412,9 @@ static int pl011_startup(struct uart_port *port)
1411 while (readw(uap->port.membase + UART01x_FR) & UART01x_FR_BUSY) 1412 while (readw(uap->port.membase + UART01x_FR) & UART01x_FR_BUSY)
1412 barrier(); 1413 barrier();
1413 1414
1414 cr = UART01x_CR_UARTEN | UART011_CR_RXE | UART011_CR_TXE; 1415 /* restore RTS and DTR */
1416 cr = uap->old_cr & (UART011_CR_RTS | UART011_CR_DTR);
1417 cr |= UART01x_CR_UARTEN | UART011_CR_RXE | UART011_CR_TXE;
1415 writew(cr, uap->port.membase + UART011_CR); 1418 writew(cr, uap->port.membase + UART011_CR);
1416 1419
1417 /* Clear pending error interrupts */ 1420 /* Clear pending error interrupts */
@@ -1469,6 +1472,7 @@ static void pl011_shutdown_channel(struct uart_amba_port *uap,
1469static void pl011_shutdown(struct uart_port *port) 1472static void pl011_shutdown(struct uart_port *port)
1470{ 1473{
1471 struct uart_amba_port *uap = (struct uart_amba_port *)port; 1474 struct uart_amba_port *uap = (struct uart_amba_port *)port;
1475 unsigned int cr;
1472 1476
1473 /* 1477 /*
1474 * disable all interrupts 1478 * disable all interrupts
@@ -1488,9 +1492,16 @@ static void pl011_shutdown(struct uart_port *port)
1488 1492
1489 /* 1493 /*
1490 * disable the port 1494 * disable the port
1495 * disable the port. It should not disable RTS and DTR.
1496 * Also RTS and DTR state should be preserved to restore
1497 * it during startup().
1491 */ 1498 */
1492 uap->autorts = false; 1499 uap->autorts = false;
1493 writew(UART01x_CR_UARTEN | UART011_CR_TXE, uap->port.membase + UART011_CR); 1500 cr = readw(uap->port.membase + UART011_CR);
1501 uap->old_cr = cr;
1502 cr &= UART011_CR_RTS | UART011_CR_DTR;
1503 cr |= UART01x_CR_UARTEN | UART011_CR_TXE;
1504 writew(cr, uap->port.membase + UART011_CR);
1494 1505
1495 /* 1506 /*
1496 * disable break condition and fifos 1507 * disable break condition and fifos
@@ -1740,9 +1751,19 @@ pl011_console_write(struct console *co, const char *s, unsigned int count)
1740{ 1751{
1741 struct uart_amba_port *uap = amba_ports[co->index]; 1752 struct uart_amba_port *uap = amba_ports[co->index];
1742 unsigned int status, old_cr, new_cr; 1753 unsigned int status, old_cr, new_cr;
1754 unsigned long flags;
1755 int locked = 1;
1743 1756
1744 clk_enable(uap->clk); 1757 clk_enable(uap->clk);
1745 1758
1759 local_irq_save(flags);
1760 if (uap->port.sysrq)
1761 locked = 0;
1762 else if (oops_in_progress)
1763 locked = spin_trylock(&uap->port.lock);
1764 else
1765 spin_lock(&uap->port.lock);
1766
1746 /* 1767 /*
1747 * First save the CR then disable the interrupts 1768 * First save the CR then disable the interrupts
1748 */ 1769 */
@@ -1762,6 +1783,10 @@ pl011_console_write(struct console *co, const char *s, unsigned int count)
1762 } while (status & UART01x_FR_BUSY); 1783 } while (status & UART01x_FR_BUSY);
1763 writew(old_cr, uap->port.membase + UART011_CR); 1784 writew(old_cr, uap->port.membase + UART011_CR);
1764 1785
1786 if (locked)
1787 spin_unlock(&uap->port.lock);
1788 local_irq_restore(flags);
1789
1765 clk_disable(uap->clk); 1790 clk_disable(uap->clk);
1766} 1791}
1767 1792
@@ -1905,6 +1930,7 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
1905 uap->vendor = vendor; 1930 uap->vendor = vendor;
1906 uap->lcrh_rx = vendor->lcrh_rx; 1931 uap->lcrh_rx = vendor->lcrh_rx;
1907 uap->lcrh_tx = vendor->lcrh_tx; 1932 uap->lcrh_tx = vendor->lcrh_tx;
1933 uap->old_cr = 0;
1908 uap->fifosize = vendor->fifosize; 1934 uap->fifosize = vendor->fifosize;
1909 uap->interrupt_may_hang = vendor->interrupt_may_hang; 1935 uap->interrupt_may_hang = vendor->interrupt_may_hang;
1910 uap->port.dev = &dev->dev; 1936 uap->port.dev = &dev->dev;
diff --git a/drivers/tty/serial/jsm/jsm_driver.c b/drivers/tty/serial/jsm/jsm_driver.c
index 7c867a046c97..7545fe1b9925 100644
--- a/drivers/tty/serial/jsm/jsm_driver.c
+++ b/drivers/tty/serial/jsm/jsm_driver.c
@@ -251,6 +251,7 @@ static void jsm_io_resume(struct pci_dev *pdev)
251 struct jsm_board *brd = pci_get_drvdata(pdev); 251 struct jsm_board *brd = pci_get_drvdata(pdev);
252 252
253 pci_restore_state(pdev); 253 pci_restore_state(pdev);
254 pci_save_state(pdev);
254 255
255 jsm_uart_port_init(brd); 256 jsm_uart_port_init(brd);
256} 257}
diff --git a/drivers/tty/serial/max3107-aava.c b/drivers/tty/serial/max3107-aava.c
deleted file mode 100644
index aae772a71de6..000000000000
--- a/drivers/tty/serial/max3107-aava.c
+++ /dev/null
@@ -1,344 +0,0 @@
1/*
2 * max3107.c - spi uart protocol driver for Maxim 3107
3 * Based on max3100.c
4 * by Christian Pellegrin <chripell@evolware.org>
5 * and max3110.c
6 * by Feng Tang <feng.tang@intel.com>
7 *
8 * Copyright (C) Aavamobile 2009
9 *
10 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 *
28 */
29
30#include <linux/delay.h>
31#include <linux/device.h>
32#include <linux/serial_core.h>
33#include <linux/serial.h>
34#include <linux/spi/spi.h>
35#include <linux/freezer.h>
36#include <linux/platform_device.h>
37#include <linux/gpio.h>
38#include <linux/sfi.h>
39#include <linux/module.h>
40#include <asm/mrst.h>
41#include "max3107.h"
42
43/* GPIO direction to input function */
44static int max3107_gpio_direction_in(struct gpio_chip *chip, unsigned offset)
45{
46 struct max3107_port *s = container_of(chip, struct max3107_port, chip);
47 u16 buf[1]; /* Buffer for SPI transfer */
48
49 if (offset >= MAX3107_GPIO_COUNT) {
50 dev_err(&s->spi->dev, "Invalid GPIO\n");
51 return -EINVAL;
52 }
53
54 /* Read current GPIO configuration register */
55 buf[0] = MAX3107_GPIOCFG_REG;
56 /* Perform SPI transfer */
57 if (max3107_rw(s, (u8 *)buf, (u8 *)buf, 2)) {
58 dev_err(&s->spi->dev, "SPI transfer GPIO read failed\n");
59 return -EIO;
60 }
61 buf[0] &= MAX3107_SPI_RX_DATA_MASK;
62
63 /* Set GPIO to input */
64 buf[0] &= ~(0x0001 << offset);
65
66 /* Write new GPIO configuration register value */
67 buf[0] |= (MAX3107_WRITE_BIT | MAX3107_GPIOCFG_REG);
68 /* Perform SPI transfer */
69 if (max3107_rw(s, (u8 *)buf, NULL, 2)) {
70 dev_err(&s->spi->dev, "SPI transfer GPIO write failed\n");
71 return -EIO;
72 }
73 return 0;
74}
75
76/* GPIO direction to output function */
77static int max3107_gpio_direction_out(struct gpio_chip *chip, unsigned offset,
78 int value)
79{
80 struct max3107_port *s = container_of(chip, struct max3107_port, chip);
81 u16 buf[2]; /* Buffer for SPI transfers */
82
83 if (offset >= MAX3107_GPIO_COUNT) {
84 dev_err(&s->spi->dev, "Invalid GPIO\n");
85 return -EINVAL;
86 }
87
88 /* Read current GPIO configuration and data registers */
89 buf[0] = MAX3107_GPIOCFG_REG;
90 buf[1] = MAX3107_GPIODATA_REG;
91 /* Perform SPI transfer */
92 if (max3107_rw(s, (u8 *)buf, (u8 *)buf, 4)) {
93 dev_err(&s->spi->dev, "SPI transfer gpio failed\n");
94 return -EIO;
95 }
96 buf[0] &= MAX3107_SPI_RX_DATA_MASK;
97 buf[1] &= MAX3107_SPI_RX_DATA_MASK;
98
99 /* Set GPIO to output */
100 buf[0] |= (0x0001 << offset);
101 /* Set value */
102 if (value)
103 buf[1] |= (0x0001 << offset);
104 else
105 buf[1] &= ~(0x0001 << offset);
106
107 /* Write new GPIO configuration and data register values */
108 buf[0] |= (MAX3107_WRITE_BIT | MAX3107_GPIOCFG_REG);
109 buf[1] |= (MAX3107_WRITE_BIT | MAX3107_GPIODATA_REG);
110 /* Perform SPI transfer */
111 if (max3107_rw(s, (u8 *)buf, NULL, 4)) {
112 dev_err(&s->spi->dev,
113 "SPI transfer for GPIO conf data w failed\n");
114 return -EIO;
115 }
116 return 0;
117}
118
119/* GPIO value query function */
120static int max3107_gpio_get(struct gpio_chip *chip, unsigned offset)
121{
122 struct max3107_port *s = container_of(chip, struct max3107_port, chip);
123 u16 buf[1]; /* Buffer for SPI transfer */
124
125 if (offset >= MAX3107_GPIO_COUNT) {
126 dev_err(&s->spi->dev, "Invalid GPIO\n");
127 return -EINVAL;
128 }
129
130 /* Read current GPIO data register */
131 buf[0] = MAX3107_GPIODATA_REG;
132 /* Perform SPI transfer */
133 if (max3107_rw(s, (u8 *)buf, (u8 *)buf, 2)) {
134 dev_err(&s->spi->dev, "SPI transfer GPIO data r failed\n");
135 return -EIO;
136 }
137 buf[0] &= MAX3107_SPI_RX_DATA_MASK;
138
139 /* Return value */
140 return buf[0] & (0x0001 << offset);
141}
142
143/* GPIO value set function */
144static void max3107_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
145{
146 struct max3107_port *s = container_of(chip, struct max3107_port, chip);
147 u16 buf[2]; /* Buffer for SPI transfers */
148
149 if (offset >= MAX3107_GPIO_COUNT) {
150 dev_err(&s->spi->dev, "Invalid GPIO\n");
151 return;
152 }
153
154 /* Read current GPIO configuration registers*/
155 buf[0] = MAX3107_GPIODATA_REG;
156 buf[1] = MAX3107_GPIOCFG_REG;
157 /* Perform SPI transfer */
158 if (max3107_rw(s, (u8 *)buf, (u8 *)buf, 4)) {
159 dev_err(&s->spi->dev,
160 "SPI transfer for GPIO data and config read failed\n");
161 return;
162 }
163 buf[0] &= MAX3107_SPI_RX_DATA_MASK;
164 buf[1] &= MAX3107_SPI_RX_DATA_MASK;
165
166 if (!(buf[1] & (0x0001 << offset))) {
167 /* Configured as input, can't set value */
168 dev_warn(&s->spi->dev,
169 "Trying to set value for input GPIO\n");
170 return;
171 }
172
173 /* Set value */
174 if (value)
175 buf[0] |= (0x0001 << offset);
176 else
177 buf[0] &= ~(0x0001 << offset);
178
179 /* Write new GPIO data register value */
180 buf[0] |= (MAX3107_WRITE_BIT | MAX3107_GPIODATA_REG);
181 /* Perform SPI transfer */
182 if (max3107_rw(s, (u8 *)buf, NULL, 2))
183 dev_err(&s->spi->dev, "SPI transfer GPIO data w failed\n");
184}
185
186/* GPIO chip data */
187static struct gpio_chip max3107_gpio_chip = {
188 .owner = THIS_MODULE,
189 .direction_input = max3107_gpio_direction_in,
190 .direction_output = max3107_gpio_direction_out,
191 .get = max3107_gpio_get,
192 .set = max3107_gpio_set,
193 .can_sleep = 1,
194 .base = MAX3107_GPIO_BASE,
195 .ngpio = MAX3107_GPIO_COUNT,
196};
197
198/**
199 * max3107_aava_reset - reset on AAVA systems
200 * @spi: The SPI device we are probing
201 *
202 * Reset the device ready for probing.
203 */
204
205static int max3107_aava_reset(struct spi_device *spi)
206{
207 /* Reset the chip */
208 if (gpio_request(MAX3107_RESET_GPIO, "max3107")) {
209 pr_err("Requesting RESET GPIO failed\n");
210 return -EIO;
211 }
212 if (gpio_direction_output(MAX3107_RESET_GPIO, 0)) {
213 pr_err("Setting RESET GPIO to 0 failed\n");
214 gpio_free(MAX3107_RESET_GPIO);
215 return -EIO;
216 }
217 msleep(MAX3107_RESET_DELAY);
218 if (gpio_direction_output(MAX3107_RESET_GPIO, 1)) {
219 pr_err("Setting RESET GPIO to 1 failed\n");
220 gpio_free(MAX3107_RESET_GPIO);
221 return -EIO;
222 }
223 gpio_free(MAX3107_RESET_GPIO);
224 msleep(MAX3107_WAKEUP_DELAY);
225 return 0;
226}
227
228static int max3107_aava_configure(struct max3107_port *s)
229{
230 int retval;
231
232 /* Initialize GPIO chip data */
233 s->chip = max3107_gpio_chip;
234 s->chip.label = s->spi->modalias;
235 s->chip.dev = &s->spi->dev;
236
237 /* Add GPIO chip */
238 retval = gpiochip_add(&s->chip);
239 if (retval) {
240 dev_err(&s->spi->dev, "Adding GPIO chip failed\n");
241 return retval;
242 }
243
244 /* Temporary fix for EV2 boot problems, set modem reset to 0 */
245 max3107_gpio_direction_out(&s->chip, 3, 0);
246 return 0;
247}
248
249#if 0
250/* This will get enabled once we have the board stuff merged for this
251 specific case */
252
253static const struct baud_table brg13_ext[] = {
254 { 300, MAX3107_BRG13_B300 },
255 { 600, MAX3107_BRG13_B600 },
256 { 1200, MAX3107_BRG13_B1200 },
257 { 2400, MAX3107_BRG13_B2400 },
258 { 4800, MAX3107_BRG13_B4800 },
259 { 9600, MAX3107_BRG13_B9600 },
260 { 19200, MAX3107_BRG13_B19200 },
261 { 57600, MAX3107_BRG13_B57600 },
262 { 115200, MAX3107_BRG13_B115200 },
263 { 230400, MAX3107_BRG13_B230400 },
264 { 460800, MAX3107_BRG13_B460800 },
265 { 921600, MAX3107_BRG13_B921600 },
266 { 0, 0 }
267};
268
269static void max3107_aava_init(struct max3107_port *s)
270{
271 /*override for AAVA SC specific*/
272 if (mrst_platform_id() == MRST_PLATFORM_AAVA_SC) {
273 if (get_koski_build_id() <= KOSKI_EV2)
274 if (s->ext_clk) {
275 s->brg_cfg = MAX3107_BRG13_B9600;
276 s->baud_tbl = (struct baud_table *)brg13_ext;
277 }
278 }
279}
280#endif
281
282static int __devexit max3107_aava_remove(struct spi_device *spi)
283{
284 struct max3107_port *s = dev_get_drvdata(&spi->dev);
285
286 /* Remove GPIO chip */
287 if (gpiochip_remove(&s->chip))
288 dev_warn(&spi->dev, "Removing GPIO chip failed\n");
289
290 /* Then do the default remove */
291 return max3107_remove(spi);
292}
293
294/* Platform data */
295static struct max3107_plat aava_plat_data = {
296 .loopback = 0,
297 .ext_clk = 1,
298/* .init = max3107_aava_init, */
299 .configure = max3107_aava_configure,
300 .hw_suspend = max3107_hw_susp,
301 .polled_mode = 0,
302 .poll_time = 0,
303};
304
305
306static int __devinit max3107_probe_aava(struct spi_device *spi)
307{
308 int err = max3107_aava_reset(spi);
309 if (err < 0)
310 return err;
311 return max3107_probe(spi, &aava_plat_data);
312}
313
314/* Spi driver data */
315static struct spi_driver max3107_driver = {
316 .driver = {
317 .name = "aava-max3107",
318 .owner = THIS_MODULE,
319 },
320 .probe = max3107_probe_aava,
321 .remove = __devexit_p(max3107_aava_remove),
322 .suspend = max3107_suspend,
323 .resume = max3107_resume,
324};
325
326/* Driver init function */
327static int __init max3107_init(void)
328{
329 return spi_register_driver(&max3107_driver);
330}
331
332/* Driver exit function */
333static void __exit max3107_exit(void)
334{
335 spi_unregister_driver(&max3107_driver);
336}
337
338module_init(max3107_init);
339module_exit(max3107_exit);
340
341MODULE_DESCRIPTION("MAX3107 driver");
342MODULE_AUTHOR("Aavamobile");
343MODULE_ALIAS("spi:aava-max3107");
344MODULE_LICENSE("GPL v2");
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index d192dcbb82f5..1c2426931484 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1160,7 +1160,7 @@ static struct uart_driver serial_omap_reg = {
1160 .cons = OMAP_CONSOLE, 1160 .cons = OMAP_CONSOLE,
1161}; 1161};
1162 1162
1163#ifdef CONFIG_SUSPEND 1163#ifdef CONFIG_PM_SLEEP
1164static int serial_omap_suspend(struct device *dev) 1164static int serial_omap_suspend(struct device *dev)
1165{ 1165{
1166 struct uart_omap_port *up = dev_get_drvdata(dev); 1166 struct uart_omap_port *up = dev_get_drvdata(dev);
@@ -1521,6 +1521,7 @@ static void serial_omap_mdr1_errataset(struct uart_omap_port *up, u8 mdr1)
1521 } 1521 }
1522} 1522}
1523 1523
1524#ifdef CONFIG_PM_RUNTIME
1524static void serial_omap_restore_context(struct uart_omap_port *up) 1525static void serial_omap_restore_context(struct uart_omap_port *up)
1525{ 1526{
1526 if (up->errata & UART_ERRATA_i202_MDR1_ACCESS) 1527 if (up->errata & UART_ERRATA_i202_MDR1_ACCESS)
@@ -1550,7 +1551,6 @@ static void serial_omap_restore_context(struct uart_omap_port *up)
1550 serial_out(up, UART_OMAP_MDR1, up->mdr1); 1551 serial_out(up, UART_OMAP_MDR1, up->mdr1);
1551} 1552}
1552 1553
1553#ifdef CONFIG_PM_RUNTIME
1554static int serial_omap_runtime_suspend(struct device *dev) 1554static int serial_omap_runtime_suspend(struct device *dev)
1555{ 1555{
1556 struct uart_omap_port *up = dev_get_drvdata(dev); 1556 struct uart_omap_port *up = dev_get_drvdata(dev);
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index c7bf31a6a7e7..13056180adf5 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2348,11 +2348,11 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport)
2348 */ 2348 */
2349 tty_dev = tty_register_device(drv->tty_driver, uport->line, uport->dev); 2349 tty_dev = tty_register_device(drv->tty_driver, uport->line, uport->dev);
2350 if (likely(!IS_ERR(tty_dev))) { 2350 if (likely(!IS_ERR(tty_dev))) {
2351 device_init_wakeup(tty_dev, 1); 2351 device_set_wakeup_capable(tty_dev, 1);
2352 device_set_wakeup_enable(tty_dev, 0); 2352 } else {
2353 } else
2354 printk(KERN_ERR "Cannot register tty device on line %d\n", 2353 printk(KERN_ERR "Cannot register tty device on line %d\n",
2355 uport->line); 2354 uport->line);
2355 }
2356 2356
2357 /* 2357 /*
2358 * Ensure UPF_DEAD is not set. 2358 * Ensure UPF_DEAD is not set.
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index ef9dd628ba0b..bf6e238146ae 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -227,7 +227,6 @@ int tty_port_block_til_ready(struct tty_port *port,
227 int do_clocal = 0, retval; 227 int do_clocal = 0, retval;
228 unsigned long flags; 228 unsigned long flags;
229 DEFINE_WAIT(wait); 229 DEFINE_WAIT(wait);
230 int cd;
231 230
232 /* block if port is in the process of being closed */ 231 /* block if port is in the process of being closed */
233 if (tty_hung_up_p(filp) || port->flags & ASYNC_CLOSING) { 232 if (tty_hung_up_p(filp) || port->flags & ASYNC_CLOSING) {
@@ -284,11 +283,14 @@ int tty_port_block_til_ready(struct tty_port *port,
284 retval = -ERESTARTSYS; 283 retval = -ERESTARTSYS;
285 break; 284 break;
286 } 285 }
287 /* Probe the carrier. For devices with no carrier detect this 286 /*
288 will always return true */ 287 * Probe the carrier. For devices with no carrier detect
289 cd = tty_port_carrier_raised(port); 288 * tty_port_carrier_raised will always return true.
289 * Never ask drivers if CLOCAL is set, this causes troubles
290 * on some hardware.
291 */
290 if (!(port->flags & ASYNC_CLOSING) && 292 if (!(port->flags & ASYNC_CLOSING) &&
291 (do_clocal || cd)) 293 (do_clocal || tty_port_carrier_raised(port)))
292 break; 294 break;
293 if (signal_pending(current)) { 295 if (signal_pending(current)) {
294 retval = -ERESTARTSYS; 296 retval = -ERESTARTSYS;