Skip to content
Commit 974e2f6a authored by Jarkko Sonninen's avatar Jarkko Sonninen Committed by Johan Hovold
Browse files

USB: serial: xr: add TIOCGRS485 and TIOCSRS485 ioctls



Exar devices like XR21B1411 can control an RS485 transceiver by
automatically asserting the RTS#/RS485 pin before sending data
and deasserting it when the last stop bit has been transmitted.
The polarity of the RST#/RS485 signal is configurable and the
hardware also supports half-duplex turn-around delay and
address matching mode.

Add support for enabling and disabling RS-485 mode and
configuring the RST#/RS485 signal polarity using the TIOCGRS485
and TIOCSRS485 ioctls. Support for half-duplex turn-around delay
and address matching mode are left unimplemented for now.

User enables RS-485 mode by setting SER_RS485_ENABLED flag in
struct serial_rs485 flags. User should also set either
SER_RS485_RTS_ON_SEND or SER_RS485_RTS_AFTER_SEND to select the
behaviour of the RTS#/RS485 pin. Setting SER_RS485_RTS_ON_SEND
will drive RTS#/RS485 low during transmission.

Signed-off-by: default avatarJarkko Sonninen <kasper@iki.fi>
[ johan: let SER_RS485_RTS_ON_SEND determine SER_RS485_RTS_AFTER_SEND ]
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent fdf0eaf1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment