summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRodolfo Giometti <giometti@linux.it>2010-03-10 15:23:48 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 15:52:43 -0800
commit7ed63d5eb4c0de0321f5c0a7328e132a78f9fafe (patch)
tree20dd851a6ca48ee780432ffdaae012bd10745a66 /drivers
parentdc77f161aa5e81ddaf38390094c4f2ca3814e6b1 (diff)
downloadlinux-3.10-7ed63d5eb4c0de0321f5c0a7328e132a78f9fafe.tar.gz
linux-3.10-7ed63d5eb4c0de0321f5c0a7328e132a78f9fafe.tar.bz2
linux-3.10-7ed63d5eb4c0de0321f5c0a7328e132a78f9fafe.zip
serial amba-pl010: enable PPS support
Function pl010_enable_ms() is automagically 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')
-rw-r--r--drivers/serial/amba-pl010.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index 429a8ae8693..e4b3c2c88bb 100644
--- a/drivers/serial/amba-pl010.c
+++ b/drivers/serial/amba-pl010.c
@@ -471,6 +471,20 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios,
spin_unlock_irqrestore(&uap->port.lock, flags);
}
+static void pl010_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;
+ pl010_enable_ms(port);
+ } else
+ port->flags &= ~UPF_HARDPPS_CD;
+}
+
static const char *pl010_type(struct uart_port *port)
{
return port->type == PORT_AMBA ? "AMBA" : NULL;
@@ -531,6 +545,7 @@ static struct uart_ops amba_pl010_pops = {
.startup = pl010_startup,
.shutdown = pl010_shutdown,
.set_termios = pl010_set_termios,
+ .set_ldisc = pl010_set_ldisc,
.type = pl010_type,
.release_port = pl010_release_port,
.request_port = pl010_request_port,