diff options
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/8250.c | 16 | ||||
-rw-r--r-- | drivers/serial/amba-pl010.c | 15 |
2 files changed, 31 insertions, 0 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 7c4ebe6ee18b..c3db16b7afa1 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, | |||
2408 | } | 2408 | } |
2409 | 2409 | ||
2410 | static void | 2410 | static void |
2411 | serial8250_set_ldisc(struct uart_port *port) | ||
2412 | { | ||
2413 | int line = port->line; | ||
2414 | |||
2415 | if (line >= port->state->port.tty->driver->num) | ||
2416 | return; | ||
2417 | |||
2418 | if (port->state->port.tty->ldisc->ops->num == N_PPS) { | ||
2419 | port->flags |= UPF_HARDPPS_CD; | ||
2420 | serial8250_enable_ms(port); | ||
2421 | } else | ||
2422 | port->flags &= ~UPF_HARDPPS_CD; | ||
2423 | } | ||
2424 | |||
2425 | static void | ||
2411 | serial8250_pm(struct uart_port *port, unsigned int state, | 2426 | serial8250_pm(struct uart_port *port, unsigned int state, |
2412 | unsigned int oldstate) | 2427 | unsigned int oldstate) |
2413 | { | 2428 | { |
@@ -2628,6 +2643,7 @@ static struct uart_ops serial8250_pops = { | |||
2628 | .startup = serial8250_startup, | 2643 | .startup = serial8250_startup, |
2629 | .shutdown = serial8250_shutdown, | 2644 | .shutdown = serial8250_shutdown, |
2630 | .set_termios = serial8250_set_termios, | 2645 | .set_termios = serial8250_set_termios, |
2646 | .set_ldisc = serial8250_set_ldisc, | ||
2631 | .pm = serial8250_pm, | 2647 | .pm = serial8250_pm, |
2632 | .type = serial8250_type, | 2648 | .type = serial8250_type, |
2633 | .release_port = serial8250_release_port, | 2649 | .release_port = serial8250_release_port, |
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 | ||
474 | static 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 | |||
474 | static const char *pl010_type(struct uart_port *port) | 488 | static 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, |