[PATCH] ftdi_sio 1.6 in kernel 2.6.35: DTR asserted/deasserted regardless of HUPCL setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I don't know how to navigate the kernel's git tree, but I have noticed
that the 1.6 version of the ftdi_sio driver included in kernel 2.6.35
always asserts/deasserts the DTR line regardless of hup setting by
stty or similar. Older versions of the driver don't exhibit this
behaviour.
to reproduce:
stty -hup < /dev/ttyUSB0
cat < /dev/ttyUSB0
what used to happen in old driver (what I want to happen):
DTR does NOT assert/deassert at 2nd command start
what happens:
DTR asserts at 2nd command start
this behaviour causes my arduino to reset (arduino resets when DTR
line goes from 5v to 0v) every time I open the port, causing problems
for some of my projects. I would have to use an older kernel or remove
a surface mount component to get around this.

Another clue: when I stty crtscts, the DTR line no longer toggles when
I open the port, however I can't send any data as the arduino does not
use rts/cts handshaking lines!
If there is some other method I should use to get the behaviour I
want, please inform me.

I created the following patch to get the behaviour I want. I didn't
touch any of the set_mctrl calls since I'm only interested in stopping
the line going low, but I'm sure some should be similarly altered for
symmetry.

I welcome all comments

--- a/drivers/usb/serial/ftdi_sio.c	2010-09-11 22:32:25.000000000 +1000
+++ b/drivers/usb/serial/ftdi_sio.c	2010-09-11 22:32:26.000000000 +1000
@@ -2062,8 +2062,10 @@
 			}
 		}

-		/* lower DTR/RTS */
-		clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
+		if (cflag & HUPCL) {
+		  /* lower DTR/RTS */
+		  clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
+		}
 	}
 	return;
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux