Skip to content

Commit

Permalink
serial: imx: only count 0->1 transitions for RNG
Browse files Browse the repository at this point in the history
According to tty_ioctl(4) (from man-pages 4.04) the rng member only
counts 0->1 transitions. For the other signals (DSR, CD, CTS) both edges
are supposed to be counted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Uwe Kleine-König authored and Greg Kroah-Hartman committed Apr 30, 2016
1 parent 16804d6 commit 9ec8efe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/serial/imx.c
Original file line number Diff line number Diff line change
@@ -887,7 +887,7 @@ static void imx_mctrl_check(struct imx_port *sport)

sport->old_status = status;

if (changed & TIOCM_RI)
if (changed & TIOCM_RI && status & TIOCM_RI)
sport->port.icount.rng++;
if (changed & TIOCM_DSR)
sport->port.icount.dsr++;

0 comments on commit 9ec8efe

Please sign in to comment.