summaryrefslogtreecommitdiff
path: root/drivers/serial
diff options
context:
space:
mode:
authorRodolfo Giometti <giometti@linux.it>2010-03-10 23:23:48 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 23:52:43 (GMT)
commitdc77f161aa5e81ddaf38390094c4f2ca3814e6b1 (patch)
tree47ec9aff1a07915a5e96f469fea4815881a28e8f /drivers/serial
parenta0880df0ccde8d551fc4d88c455acb2ee0801e26 (diff)
downloadlinux-dc77f161aa5e81ddaf38390094c4f2ca3814e6b1.tar.xz
serial 8250: enable PPS support
Automagically function serial8250_enable_ms() is called when PPS ldisc is selected. Signed-off-by: Rodolfo Giometti <giometti@linux.it> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Greg KH <greg@kroah.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Alexander Gordeev <lasaine@lvk.cs.msu.su> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/8250.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 7c4ebe6e..c3db16b 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2408,6 +2408,21 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
}
static void
+serial8250_set_ldisc(struct uart_port *port)
+{
+ int line = port->line;
+
+ if (line >= port->state->port.tty->driver->num)
+ return;
+
+ if (port->state->port.tty->ldisc->ops->num == N_PPS) {
+ port->flags |= UPF_HARDPPS_CD;
+ serial8250_enable_ms(port);
+ } else
+ port->flags &= ~UPF_HARDPPS_CD;
+}
+
+static void
serial8250_pm(struct uart_port *port, unsigned int state,
unsigned int oldstate)
{
@@ -2628,6 +2643,7 @@ static struct uart_ops serial8250_pops = {
.startup = serial8250_startup,
.shutdown = serial8250_shutdown,
.set_termios = serial8250_set_termios,
+ .set_ldisc = serial8250_set_ldisc,
.pm = serial8250_pm,
.type = serial8250_type,
.release_port = serial8250_release_port,