Commit dc77f161 authored by Rodolfo Giometti's avatar Rodolfo Giometti Committed by Linus Torvalds

serial 8250: enable PPS support

Automagically function serial8250_enable_ms() is called when PPS ldisc
is selected.
Signed-off-by: default avatarRodolfo 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a0880df0
...@@ -2407,6 +2407,21 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios, ...@@ -2407,6 +2407,21 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
tty_termios_encode_baud_rate(termios, baud, baud); tty_termios_encode_baud_rate(termios, baud, baud);
} }
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 static void
serial8250_pm(struct uart_port *port, unsigned int state, serial8250_pm(struct uart_port *port, unsigned int state,
unsigned int oldstate) unsigned int oldstate)
...@@ -2628,6 +2643,7 @@ static struct uart_ops serial8250_pops = { ...@@ -2628,6 +2643,7 @@ static struct uart_ops serial8250_pops = {
.startup = serial8250_startup, .startup = serial8250_startup,
.shutdown = serial8250_shutdown, .shutdown = serial8250_shutdown,
.set_termios = serial8250_set_termios, .set_termios = serial8250_set_termios,
.set_ldisc = serial8250_set_ldisc,
.pm = serial8250_pm, .pm = serial8250_pm,
.type = serial8250_type, .type = serial8250_type,
.release_port = serial8250_release_port, .release_port = serial8250_release_port,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment