aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorRodolfo Giometti <giometti@linux.it>2010-03-10 18:23:48 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 18:52:43 -0500
commit7ed63d5eb4c0de0321f5c0a7328e132a78f9fafe (patch)
tree20dd851a6ca48ee780432ffdaae012bd10745a66 /drivers/serial
parentdc77f161aa5e81ddaf38390094c4f2ca3814e6b1 (diff)
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/serial')
-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 429a8ae86933..e4b3c2c88bb6 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,
471 spin_unlock_irqrestore(&uap->port.lock, flags); 471 spin_unlock_irqrestore(&uap->port.lock, flags);
472} 472}
473 473
474static void pl010_set_ldisc(struct uart_port *port)
475{
476 int line = port->line;
477
478 if (line >= port->state->port.tty->driver->num)
479 return;
480
481 if (port->state->port.tty->ldisc->ops->num == N_PPS) {
482 port->flags |= UPF_HARDPPS_CD;
483 pl010_enable_ms(port);
484 } else
485 port->flags &= ~UPF_HARDPPS_CD;
486}
487
474static const char *pl010_type(struct uart_port *port) 488static const char *pl010_type(struct uart_port *port)
475{ 489{
476 return port->type == PORT_AMBA ? "AMBA" : NULL; 490 return port->type == PORT_AMBA ? "AMBA" : NULL;
@@ -531,6 +545,7 @@ static struct uart_ops amba_pl010_pops = {
531 .startup = pl010_startup, 545 .startup = pl010_startup,
532 .shutdown = pl010_shutdown, 546 .shutdown = pl010_shutdown,
533 .set_termios = pl010_set_termios, 547 .set_termios = pl010_set_termios,
548 .set_ldisc = pl010_set_ldisc,
534 .type = pl010_type, 549 .type = pl010_type,
535 .release_port = pl010_release_port, 550 .release_port = pl010_release_port,
536 .request_port = pl010_request_port, 551 .request_port = pl010_request_port,