Skip to content

Commit

Permalink
[PATCH] USB: ftdi_sio: allow baud rate to be changed without raising …
Browse files Browse the repository at this point in the history
…RTS and DTR

I'm using a 2 port USB RS232 dongle to connect to a serial-IR cradle for
a bar code reader). Detecting the baudrate of the serial-IR involves
keeping DTR low while changing baudrate.

This works using normal 16550A serial ports as well as the FTDI driver
version 1.4.0 (Linux 2.6.8) but stopped working with the change to
"ensure RTS and DTR are raised when changing baudrate" introduced in
version 1.4.1 (Linux 2.6.9).

The attached patch fixes this, so RTS and DTR is only raised when
changing baudrate iff the previous baudrate was B0.

Signed-off-by: Peter Favrholdt <pfavr@how.dk>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Peter Favrholdt authored and Linus Torvalds committed Sep 22, 2005
1 parent b613738 commit 72a755f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1846,10 +1846,12 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
} else {
/* set the baudrate determined before */
if (change_speed(port)) {
err("%s urb failed to set baurdrate", __FUNCTION__);
err("%s urb failed to set baudrate", __FUNCTION__);
}
/* Ensure RTS and DTR are raised when baudrate changed from 0 */
if ((old_termios->c_cflag & CBAUD) == B0) {
set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
}
/* Ensure RTS and DTR are raised */
set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
}

/* Set flow control */
Expand Down

0 comments on commit 72a755f

Please sign in to comment.