Commit graph

368 commits

Author SHA1 Message Date
Uwe Kleine-König
20bb8095a4 serial/imx: let probing fail for the dt case without a valid alias
When the uart device is instantiated by dt but dt doesn't provide an
alias then better let probing fail instead of falling back to an
unrelated device id used for the line number and no platform data.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-04 16:30:34 -08:00
Uwe Kleine-König
a197a191f7 serial/imx: propagate error from of_alias_get_id instead of using -ENODEV
A quick look at of_alias_get_id shows that in the error case it returns
-ENODEV, too, but still it's better style to propagate the value as is.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
Cc: Jason Liu <jason.hui@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Jason Liu <jason.hui@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-04 16:30:34 -08:00
Fabio Estevam
db1a9b5500 tty: serial: imx: Allow UART to be a source for wakeup
Allow UART to be a source for wakeup from low power mode.

Tested on a MX27PDK by doing:

echo enabled > /sys/devices/platform/imx21-uart.0/tty/ttymxc0/power/wakeup

echo mem > /sys/power/state

and then pressing a key in the console will wakeup the sytem.

Suggested-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Tested-by: Richard Zhao <richard.zhao@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-04 16:30:33 -08:00
Paul Gortmaker
59087384e4 serial: driver for m32 arch should not have DEC alpha errata
This driver was copied from the original 8250 driver and hence
got the DEC alpha errata workaround.  But the workaround is ugly
and we don't really want it in any more places than it absolutely
needs to be.  Obviously ARCH=m32r means ARCH != alpha, so just
remove the references to the ALPHA_KLUDGE_MCR define.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-04 16:26:32 -08:00
Claudio Scordino
dbf1115d3f atmel_serial: fix spinlock lockup in RS485 code
Patch to fix a spinlock lockup in the driver that sometimes happens when the
tasklet starts.

Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
Signed-off-by: Dave Bender <codehero@gmail.com>
Tested-by: Dave Bender <codehero@gmail.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-04 16:19:34 -08:00
Uwe Kleine-König
97d24634da serial: use DIV_ROUND_CLOSEST instead of open coding it
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-04 16:18:54 -08:00
Yegor Yefremov
1e9deb118e serial: add support for 400 and 800 v3 series Titan cards
add support for 400Hv3, 410Hv3 and 800Hv3

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-03 16:46:10 -08:00
Sonic Zhang
64851636d5 serial: bfin-uart: Remove ASYNC_CTS_FLOW flag for hardware automatic CTS.
Blackfin uart supports automatic CTS trigger when hardware flow control is enabled.
No need to start and top tx in CTS interrupt. So, remote ASYNC_CTS_FLOW flag.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-13 09:50:15 -08:00
Sonic Zhang
b48dc711c3 serial: bfin-uart: Enable hardware automatic CTS only when CTS pin is available.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-13 09:50:15 -08:00
Paul Gortmaker
5c2f37dddd serial: make FSL errata depend on 8250_CONSOLE, not just 8250
The recent commit "serial: add irq handler for Freescale 16550 errata"
would allow Kconfig choices that had 8250 support as a module and
yet still try and build in the errata fix non-modular, resulting
in build failures for some non-embedded PPC targets.

Since we hook in the errata fix from legacy_serial.c, which is
built only for PPC_UDBG_16550, and since the errata is only really
relevant for SysRQ on serial console, tighten up the dependencies
to be exactly that.

We'll get coverage on the relevant Freescale boards because the
Kconfig for their CPU types all select the PPC_UDBG_16550 option,
and the defconfigs also all select the 8250_CONSOLE option.  Also,
the 8250_CONSOLE option has a strict dependency on "SERIAL_8250=y"
which resolves the reported problem for non Freescale targets.

Reported-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Tested-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-13 09:50:13 -08:00
Paul Gortmaker
9deaa53ac7 serial: add irq handler for Freescale 16550 errata.
Sending a break on the SOC UARTs found in some MPC83xx/85xx/86xx
chips seems to cause a short lived IRQ storm (/proc/interrupts
typically shows somewhere between 300 and 1500 events).  Unfortunately
this renders SysRQ over the serial console completely inoperable.

The suggested workaround in the errata is to read the Rx register,
wait one character period, and then read the Rx register again.
We achieve this by tracking the old LSR value, and on the subsequent
interrupt event after a break, we don't read LSR, instead we just
read the RBR again and return immediately.

The "fsl,ns16550" is used in the compatible field of the serial
device to mark UARTs known to have this issue.

Thanks to Scott Wood for providing the errata data which led to
a much cleaner fix.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:14:13 -08:00
Paul Gortmaker
86b21199fc serial: manually inline serial8250_handle_port
Currently serial8250_handle_irq is a trivial wrapper around
serial8250_handle_port, which actually does all the work.

Since there are no other callers of serial8250_handle_port, we
can just move it inline into serial8250_handle_irq.  This also
makes it more clear what functionality any custom IRQ handlers
need to provide if not using serial8250_default_handle_irq.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:14:13 -08:00
Paul Gortmaker
a0431476e9 serial: make 8250 timeout use the specified IRQ handler
The current 8250 timeout code duplicates the code path in
serial8250_default_handle_irq and then serial8250_handle_irq
i.e. reading iir, check for IIR_NO_INT, and then calling
serial8250_handle_port.

So the immediate thought is to replace the duplicated code
with a call to serial8250_default_handle_irq.

But this highlights a problem.  We let 8250 driver variants
use their own IRQ handler via specifying their own custom
->handle_irq, but in the event of a timeout, we ignore their
handler and implicitly run serial8250_default_handle_irq instead.

So, go through the struct to get ->handle_irq and call that,
which for most will still be serial8250_default_handle_irq.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:14:13 -08:00
Paul Gortmaker
3986fb2ba6 serial: export the key functions for an 8250 IRQ handler
For drivers that need to construct their own IRQ handler, the
three components are seen in the current handle_port -- i.e.
Rx, Tx and modem_status.

Make these exported symbols so that "almost" 8250 UARTs can
construct their own IRQ handler with these shared components,
while working around their own unique errata issues.

The function names are given a serial8250 prefix, since they
are now entering the global namespace.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:14:13 -08:00
Paul Gortmaker
0690f41fdd serial: clean up parameter passing for 8250 Rx IRQ handling
The receive_chars() was taking a pointer to a passed in LSR value
in status and knocking off bits as it processed them.  But since
receive_chars isn't returning a value, we can instead pass in
a normal non-pointer value for LSR, and simply return the
residual (unprocessed) LSR once it is done.

The value in this cleanup, is that it clarifies the API of the
receive_chars prior to exporting it to other 8250-like drivers
for shared usage.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:14:12 -08:00
Paul Gortmaker
850624c15d serial: move struct uart_8250_port from 8250.c to 8250.h
Since we want to promote sharing and move away from one single
uart driver with a bunch of platform specific bugfixes all
munged into one, relocate some header like material from
the C file to the header.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:14:12 -08:00
Mayank Rana
ee815f3a76 msm_serial_hs: Fix spinlock recursion in handling CTS
msm_hs_handle_delta_cts tries to acquire port->lock already acquired
by the callee function msm_hs_isr. Change function name to follow
"_locked" convention.

Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:10:04 -08:00
Mayank Rana
8431de80da msm_serial_hs: Fix type inconsistency for tx and rx command_ptr_ptr
Both tx and rx command_ptr_ptr are of type u32*. While allocating
memory for it, sizeof(u32 *) is used as part of kmalloc API instead
of sizeof(u32). ADM Hardare requires size of command_ptr_ptr as 1 Word.
Both sizeof(u32 *) and sizeof(u32) are same on 32-bit architecture
whereas sizeof(u32 *) would be different in size compare to sizeof(u32)
on anyother architecture.

Hence correct usage of sizeof(command_ptr_ptr) for Tx and Rx with
kmalloc and dma_(map/unmap)_single APIs.

Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:10:04 -08:00
Maciej Szmigiero
7f97c000e8 serial: fix serial_cs I/O windows for Argosy RS-COM 2P
Current serial_cs driver has a problem when trying to detect whether
a card has multiple ports: serial_config() calls pcmcia_loop_config()
which iterates over card CIS configurations by calling
serial_check_for_multi() for each of them.

This function wants to check (and select) a configuration
that has either one long I/O window spanning multiple ports or two 8-port
windows for two serial ports.

Problem is, that every pcmcia_loop_config() iteration only updates
the windows (via pcmcia_do_loop_config() in resource[0] and resource[1])
when CONF_AUTO_SET_IO flag is set on the device, which is set only later
in the code.

Fix it by setting this flag earlier.

In addition to this, when multi-port card is detected
and it does not have an one, long I/O window
multi_config_check_notpicky() tries to locate two I/O windows and assumes
they are continuous without checking.

On an Argosy RS-COM 2P this selects first configuration, which
unfortunately has two non-continuous I/O windows.
The net effect is that the second serial port on the card does not work.

Fix it by checking whether the windows are really continuous.

Signed-off-by: Maciej Szmigiero <mhej@o2.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:07:46 -08:00
Wolfram Sang
7d73aaf1d4 serial: 8250: replace hardcoded 0xbf with #define
Makes it easier to find all occurences requesting CONF_MODE_B.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:06:42 -08:00
Sonic Zhang
cee3948d12 serial: bfin-sport-uart: Add tty ASYNC_CTS_FLOW flag to do CTS flow control.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:05:33 -08:00
Sonic Zhang
dc8f3703e7 serial: bfin-sport-uart: Request CTS GPIO PIN when the sport emulated serial device starts up.
This patch is similar to that for bfin-uart hardware flow control.
Sport emulated serial device may be probed earlier before GPIOLIB is initialized.
Requesting and configuring CTS GPIO PIN fails in that early stage.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:05:33 -08:00
Sonic Zhang
07143eaefd tty: bfin-sport-uart: Rx interrupt is not called always with irq disabled.
Replace local_irq_disable by local_irq_save.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:05:33 -08:00
Sonic Zhang
f5b6940cbc serial: bfin-uart: remove redundant CTS check for hardware CTS control.
Blackfin hardware CTS control generate interrupt for both CTS on and off.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:05:32 -08:00
Sonic Zhang
ee948e379e serial: bfin-uart: Add tty ASYNC_CTS_FLOW flag to do CTS flow control.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:05:32 -08:00
Sonic Zhang
32b4456877 serial: bfin-uart: Request CTS GPIO PIN when the serial device starts up.
Serial device may be probed earlier before GPIOLIB is initialized. Requesting and
configuring CTS GPIO PIN fails in that early stage. Do it when the serial device
really starts up.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 19:05:32 -08:00
Axel Lin
c8381c15b1 TTY: serial: convert drivers/tty/serial/* to use module_platform_driver()
This patch converts the drivers in drivers/tty/serial/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jamie Iles <jamie@jamieiles.com>
Cc: Yoichi Yuasa <yuasa@linux-mips.org>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:11:46 +09:00
Lars-Peter Clausen
bb74041b13 TTY: Remove redundant spi driver bus initialization
In ancient times it was necessary to manually initialize the bus field of an
spi_driver to spi_bus_type. These days this is done in spi_driver_register(),
so we can drop the manual assignment.

The patch was generated using the following coccinelle semantic patch:
// <smpl>
@@
identifier _driver;
@@
struct spi_driver _driver = {
	.driver = {
-		.bus = &spi_bus_type,
	},
};
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 20:19:21 -08:00
Dan Williams
e86ff4a63c serial/8250_pci: init-quirk msi support for kt serial controller
The semantics of UPF_IIR_ONCE (once per serial irq) are only guaranteed
if the kt irq is not shared (once per serial isr in the shared case ==
potentially unwanted reads of the IIR).

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 20:11:20 -08:00
Dan Williams
448ac154c9 serial/8250_pci: setup-quirk workaround for the kt serial controller
Workaround dropped notifications in the iir register.  Prevent reads
coincident with new interrupt notifications by reading the iir at most
once per interrupt.

Reported-by: Nhan H Mai <nhan.h.mai@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 20:11:20 -08:00
Uwe Kleine-König
d0758a285c serial/mxs-auart: only wake up tty layer once
There is no need to call uart_write_wakeup after each character send.
Once at the end of the write sequence is enough.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 20:10:13 -08:00
Uwe Kleine-König
f227824e84 serial/imx: propagate error of platform_driver_register in init routine
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 20:10:13 -08:00
Shubhrajyoti D
514f31d19e OMAP: UART: fix the return type of check_modem_status
The function check_modem_status returns an int currently it
is stored in a char.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 20:10:13 -08:00
Greg Kroah-Hartman
dd7c7c3f69 Merge 3.2-rc3 into tty-next to handle merge conflict in tty_ldisc.c
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 20:07:25 -08:00
Linus Torvalds
3b9abc7e48 Merge branch 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
* 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  TTY: ldisc, wait for ldisc infinitely in hangup
  TTY: ldisc, move wait idle to caller
  TTY: ldisc, allow waiting for ldisc arbitrarily long
  Revert "tty/serial: Prevent drop of DCD on suspend for Tegra UARTs"
  RS485: fix inconsistencies in the meaning of some variables
  pch_uart: Fix DMA resource leak issue
  serial,mfd: Fix CMSPAR setup
  tty/serial: Prevent drop of DCD on suspend for Tegra UARTs
  pch_uart: Change company name OKI SEMICONDUCTOR to LAPIS Semiconductor
  pch_uart: Support new device LAPIS Semiconductor ML7831 IOH
  pch_uart: Fix hw-flow control issue
  tty: hvc_dcc: Fix duplicate character inputs
  jsm: Change maintainership
2011-11-21 20:36:46 -08:00
Rong Wang
161e773cbd UART: add CSR SiRFprimaII SoC on-chip uart drivers
SiRFprimaII is the latest generation application processor from CSR’s
multi-function SoC product family.
The SoC support codes are in arch/arm/mach-prima2 from Linux mainline
3.0.

There are three dedicated UARTs in system. This patch adds basic driver
support for them.

It has used the newest pinmux subsystem from Linus Walleij.

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rong Wang <Rong.Wang@csr.com>
Signed-off-by: Bin Shi <Bin.Shi@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-17 11:46:04 -08:00
Greg Kroah-Hartman
6edf0c9b1c Revert "tty/serial: Prevent drop of DCD on suspend for Tegra UARTs"
This reverts commit 9636b755da.

It wasn't supposed to be applied, thanks to Doug for letting me know.

Cc: Doug Anderson <dianders@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 16:01:09 -08:00
Jiri Slaby
c0d92be6bc TTY: serial, extract uart_port_startup
Extract ASYNC_INITIALIZED/TTY_IO_ERROR handling from uart_startup.
This will be useful for tty port helpers. These flags are handled
by the helpers instead.

So we create a new function uart_port_startup without touching these
flags there. And we keep uart_startup with the exact behavior as
before. We need that one because we start/stop the device from other
paths than open/close/hangup.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 15:59:04 -08:00
Jiri Slaby
b922e19d03 TTY: serial, fill uart_port_shutdown
Let's fill the port_ops->shutdown. We will need this for hangup and
close port helpers.

We don't need to touch DTR/RTS registers in uart_port_shutdown. They
are set to off from port_close_start properly already.

Also we don't need to pin the TTY_IO_ERROR bit. This will be done in
close/hangup paths.

We leave uart_shutdown as is, because it is used (and will be) from
several paths now. Like from suspend.

The point is to not touch ASYNC_INITIALIZED bit. It will be set (and
checked) properly by the tty port helpers.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 15:59:03 -08:00
Jiri Slaby
0b1db83081 TTY: serial, define uart_port_activate/shutdown
This is a preparation for the next patches which will move the stuff
from uart_open and uart_close/hangup here. Then we will use
tty_port_* helpers.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 15:59:02 -08:00
Jiri Slaby
1c7b13c488 TTY: serial, inline uart_get
We need to expand uart_get into uart_open. We need it to move on with
conversion to use tty_port_open helper. After we do this, the code
will be much more similar to what tty_port_open does.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 15:59:01 -08:00
Jiri Slaby
b39c49a05e TTY: serial, do not touch tty->alt_speed
It is not used at all, so no need to play any games with that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 15:59:00 -08:00
Jiri Slaby
cf75525f37 TTY: serial, document few functions
Just put a kernel-doc comment to uart_change_pm and uart_insert_char.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 15:58:59 -08:00
Jiri Slaby
d30ccf08e8 TTY: serial, use tty_port_close_start helper
After the previous patches, the code is almost identical. There are
few differences in the helper code:
1) flush_buffer when flow_stopped
   * when a user doesn't care about the data, delete it anyways
2) ASYNCB_INITIALIZED test before wait_until_sent_from
   * obviously, there is nothing to wait for if the port is dead
3) drain_delay wait
   * we don't set drain_delay

So we can use the helper now. It indeed removes a bunch of duplicated
code.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 15:58:59 -08:00
Jiri Slaby
4cb0fbfdc8 TTY: serial, switch closing_wait and close_delay to jiffies
As the tty_port helpers think closing_wait and close_delay are in
jiffies and we want to use the helpers (next patches), we have to
switch the closing_wait and close_delay from ms to jiffies now.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 15:58:58 -08:00
Jiri Slaby
b54bf3b249 TTY: serial, cleanup atmel_set_ldisc
Current ldisc number is passed as a paramneter -- no need to dig it
out of the tty or ldisc. So switch PPS check to that.

No tty callback can be called with port->line higher than TTY driver
num. So remove the check.

This removes some port.tty users.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Viktar Palstsiuk <viktar.palstsiuk@promwad.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 15:58:57 -08:00
Jiri Slaby
027d7dacf7 TTY: serial, cleanup include file
There are some functions (uart_handle_dcd_change, _handle_cts_change,
_insert_char) which are big enough to not be inlined. So move them
from .h to .c. We need to export them so that modules can actually use
them.

They will be even bigger when we introduce tty refcounting to them.

While at it, cleanup the "Proud member of Uglyhacks'R'US". It means,
define uart_handle_sysrq_char only when SUPPORT_SYSRQ is set.
Otherwise define it as a macro. This is needed for some arm driver
where the second parameter is undefined if expanded.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 15:58:56 -08:00
Shubhrajyoti D
f370626619 serial: OMAP2+: UART: Make the SERIAL_OMAP depend on ARCH_OMAP2PLUS
Making  SERIAL_OMAP depend on ARCH_OMAP2PLUS instead of
oring with ARCH2/3/4.

Acked-by: Felipe Balbi <balbi@ti.com>
Suggested-by: Sricharan R <r.sricharan@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 15:56:31 -08:00
Alexander Stein
e30f867d40 drivers/tty/serial/pch_uart.c: add console support
Add console support to pch_uart.  To enable append e.g.
console=ttyPCH0,115200 to your kernel command line.

This is not expected work on CM-iTC boards due to their having a different
clock.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 15:50:31 -08:00
Mika Westerberg
b82e324b3c serial, mfd: don't hardcode the console
Add support to specify which HSU port to use as an early console. This can
be selected by passing "earlyprintk=hsu<n>" on the kernel command line. By
default port 0 is still used.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15 15:50:30 -08:00