pps: serial clients support
[linux-3.10.git] / include / linux / serial_core.h
index 8c3dd36..78dd1e7 100644 (file)
@@ -491,9 +491,13 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
 {
        struct uart_state *state = uport->state;
        struct tty_port *port = &state->port;
+       struct tty_ldisc *ld = tty_ldisc_ref(port->tty);
+       struct timespec ts;
 
-       uport->icount.dcd++;
+       if (ld && ld->ops->dcd_change)
+               getnstimeofday(&ts);
 
+       uport->icount.dcd++;
 #ifdef CONFIG_HARD_PPS
        if ((uport->flags & UPF_HARDPPS_CD) && status)
                hardpps();
@@ -505,6 +509,11 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
                else if (port->tty)
                        tty_hangup(port->tty);
        }
+
+       if (ld && ld->ops->dcd_change)
+               ld->ops->dcd_change(port->tty, status, &ts);
+       if (ld)
+               tty_ldisc_deref(ld);
 }
 
 /**