Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: serial: call handle_dcd_change in ftdi driver.

When the device receive a DCD status change, forward the signal to the
USB serial system. This way, we can detect, for instance, PPS pulses.

Signed-off-by: Paul Chavent <paul.chavent@onera.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Paul Chavent and committed by
Greg Kroah-Hartman
d14654df db8f2aa3

+9 -1
+9 -1
drivers/usb/serial/ftdi_sio.c
··· 1966 1966 port->icount.dsr++; 1967 1967 if (diff_status & FTDI_RS0_RI) 1968 1968 port->icount.rng++; 1969 - if (diff_status & FTDI_RS0_RLSD) 1969 + if (diff_status & FTDI_RS0_RLSD) { 1970 + struct tty_struct *tty; 1971 + 1970 1972 port->icount.dcd++; 1973 + tty = tty_port_tty_get(&port->port); 1974 + if (tty) 1975 + usb_serial_handle_dcd_change(port, tty, 1976 + status & FTDI_RS0_RLSD); 1977 + tty_kref_put(tty); 1978 + } 1971 1979 1972 1980 wake_up_interruptible(&port->port.delta_msr_wait); 1973 1981 priv->prev_status = status;