summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorPeter Favrholdt <pfavr@how.dk>2005-09-22 00:48:49 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-22 07:58:25 -0700
commit72a755fce0243d4168a6153813a1b533b05a7d72 (patch)
tree9a43f379879f0cf8cdf95f7f11edb9ae4ca39654 /drivers/usb
parentb6137383bda844a433d65e027502df7b20ba45c2 (diff)
[PATCH] USB: ftdi_sio: allow baud rate to be changed without raising 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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/ftdi_sio.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 4e434cb10bb..5a8631c8a4a 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -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 */