aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRodolfo Giometti <giometti@linux.it>2010-03-10 18:23:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 18:52:43 -0500
commita0880df0ccde8d551fc4d88c455acb2ee0801e26 (patch)
tree91153c79484ee379d663f5cc7a490d18bac710f9 /include
parent572b9adbd40b5565dc413db04af9cc234f72bf19 (diff)
pps: serial clients support
Adds support, by using the PPS line discipline, for the PPS sources connected with the CD (Carrier Detect) pin of a serial port. [akpm@linux-foundation.org: fix cast size warnings] 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 'include')
-rw-r--r--include/linux/serial_core.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 8c3dd36fe91a..78dd1e7120a9 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -491,9 +491,13 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
491{ 491{
492 struct uart_state *state = uport->state; 492 struct uart_state *state = uport->state;
493 struct tty_port *port = &state->port; 493 struct tty_port *port = &state->port;
494 struct tty_ldisc *ld = tty_ldisc_ref(port->tty);
495 struct timespec ts;
494 496
495 uport->icount.dcd++; 497 if (ld && ld->ops->dcd_change)
498 getnstimeofday(&ts);
496 499
500 uport->icount.dcd++;
497#ifdef CONFIG_HARD_PPS 501#ifdef CONFIG_HARD_PPS
498 if ((uport->flags & UPF_HARDPPS_CD) && status) 502 if ((uport->flags & UPF_HARDPPS_CD) && status)
499 hardpps(); 503 hardpps();
@@ -505,6 +509,11 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
505 else if (port->tty) 509 else if (port->tty)
506 tty_hangup(port->tty); 510 tty_hangup(port->tty);
507 } 511 }
512
513 if (ld && ld->ops->dcd_change)
514 ld->ops->dcd_change(port->tty, status, &ts);
515 if (ld)
516 tty_ldisc_deref(ld);
508} 517}
509 518
510/** 519/**