aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/amba-pl010.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/amba-pl010.c')
-rw-r--r--drivers/serial/amba-pl010.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index 429a8ae86933..b09a638d051f 100644
--- a/drivers/serial/amba-pl010.c
+++ b/drivers/serial/amba-pl010.c
@@ -47,6 +47,7 @@
47#include <linux/amba/bus.h> 47#include <linux/amba/bus.h>
48#include <linux/amba/serial.h> 48#include <linux/amba/serial.h>
49#include <linux/clk.h> 49#include <linux/clk.h>
50#include <linux/slab.h>
50 51
51#include <asm/io.h> 52#include <asm/io.h>
52 53
@@ -471,6 +472,20 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios,
471 spin_unlock_irqrestore(&uap->port.lock, flags); 472 spin_unlock_irqrestore(&uap->port.lock, flags);
472} 473}
473 474
475static void pl010_set_ldisc(struct uart_port *port)
476{
477 int line = port->line;
478
479 if (line >= port->state->port.tty->driver->num)
480 return;
481
482 if (port->state->port.tty->ldisc->ops->num == N_PPS) {
483 port->flags |= UPF_HARDPPS_CD;
484 pl010_enable_ms(port);
485 } else
486 port->flags &= ~UPF_HARDPPS_CD;
487}
488
474static const char *pl010_type(struct uart_port *port) 489static const char *pl010_type(struct uart_port *port)
475{ 490{
476 return port->type == PORT_AMBA ? "AMBA" : NULL; 491 return port->type == PORT_AMBA ? "AMBA" : NULL;
@@ -531,6 +546,7 @@ static struct uart_ops amba_pl010_pops = {
531 .startup = pl010_startup, 546 .startup = pl010_startup,
532 .shutdown = pl010_shutdown, 547 .shutdown = pl010_shutdown,
533 .set_termios = pl010_set_termios, 548 .set_termios = pl010_set_termios,
549 .set_ldisc = pl010_set_ldisc,
534 .type = pl010_type, 550 .type = pl010_type,
535 .release_port = pl010_release_port, 551 .release_port = pl010_release_port,
536 .request_port = pl010_request_port, 552 .request_port = pl010_request_port,