tty/serial: Prevent drop of DCD on suspend for Tegra UARTs
authorDoug Anderson <dianders@chromium.org>
Wed, 12 Oct 2011 00:05:43 +0000 (17:05 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Nov 2011 20:13:41 +0000 (12:13 -0800)
commit9636b755da7b498094bdf15b4ce9f6fd16995e4e
tree8c3351fd307b2a8c9af4d6139ff3841ef8ff4eb2
parenteca9dfa846a3d0eeb865e290851f4bfe4fb34fdd
tty/serial: Prevent drop of DCD on suspend for Tegra UARTs

On Tegra UARTs (except UART1), the DTR / DCD / DSR lines are not
externally accessible.  Instead, the DTR line internally appears to be
looped back to be the input to the DCD and DSR lines.  The net effect
of this is that when we drop DTR (like when we suspend), we'll see DCD
drop too.  ...and when we see DCD drop, we treat that as a hangup.

In order to prevent this hangup from occurring at every sleep, we need
to force DTR to remain high on Tegra UARTs.

This patch uses the mcr_mask / mcr_force fields, which were originally
added for the kludge ALPHA_KLUDGE_MCR.  Using these fields does not
prevent us from removing ALPHA_KLUDGE_MCR--we can just remove the "if"
tests I have added and always init mcr_mask / mcr_force from the
serial8250_config.

NOTE: If we have people that are using UARTA on a Tegra and need to
control DTR, we'll need to either add a separate port type for UARTA
or we'll need to add some tegra-specific code to detect whether the
DTR needs to be left high.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/tty/serial/8250.c
drivers/tty/serial/8250.h