diff options
author | Claudio Scordino <claudio@evidence.eu.com> | 2010-07-20 18:26:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 16:47:45 -0400 |
commit | 1b6331848b69d1ed165a6bdc75c4046d68767563 (patch) | |
tree | 8bb63607eed2f95dfcc460bfb0606de5ff7747b8 /drivers | |
parent | 93e3d58284626ff6466f9c3dac8800cd6f8079c6 (diff) |
serial: general fixes in the serial_rs485 structure
Fix several issues related to the RS485 interface:
- It adds the flag SER_RS485_RTS_BEFORE_SEND that was missing from the
serial_rs485 structure (even if "delay_rts_before_send" was existing)
- It adds a further "delay_rts_after_send" field for those drivers that
can have a delay after send (e.g., atmel_serial)
- It fixes the usage of the structure in the atmel_serial driver (where
"delay_rts_before_send" should be used instead of "delay_rts_after_send").
Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
Signed-off-by: Bernhard Roth <br@pwrnet.de>
Cc: Philippe De Muyter <phdm@macqel.be>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/atmel_serial.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index a182def7007d..3892666b5fbd 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -217,7 +217,8 @@ void atmel_config_rs485(struct uart_port *port, struct serial_rs485 *rs485conf) | |||
217 | if (rs485conf->flags & SER_RS485_ENABLED) { | 217 | if (rs485conf->flags & SER_RS485_ENABLED) { |
218 | dev_dbg(port->dev, "Setting UART to RS485\n"); | 218 | dev_dbg(port->dev, "Setting UART to RS485\n"); |
219 | atmel_port->tx_done_mask = ATMEL_US_TXEMPTY; | 219 | atmel_port->tx_done_mask = ATMEL_US_TXEMPTY; |
220 | UART_PUT_TTGR(port, rs485conf->delay_rts_before_send); | 220 | if (rs485conf->flags & SER_RS485_RTS_AFTER_SEND) |
221 | UART_PUT_TTGR(port, rs485conf->delay_rts_after_send); | ||
221 | mode |= ATMEL_US_USMODE_RS485; | 222 | mode |= ATMEL_US_USMODE_RS485; |
222 | } else { | 223 | } else { |
223 | dev_dbg(port->dev, "Setting UART to RS232\n"); | 224 | dev_dbg(port->dev, "Setting UART to RS232\n"); |
@@ -292,7 +293,9 @@ static void atmel_set_mctrl(struct uart_port *port, u_int mctrl) | |||
292 | 293 | ||
293 | if (atmel_port->rs485.flags & SER_RS485_ENABLED) { | 294 | if (atmel_port->rs485.flags & SER_RS485_ENABLED) { |
294 | dev_dbg(port->dev, "Setting UART to RS485\n"); | 295 | dev_dbg(port->dev, "Setting UART to RS485\n"); |
295 | UART_PUT_TTGR(port, atmel_port->rs485.delay_rts_before_send); | 296 | if (atmel_port->rs485.flags & SER_RS485_RTS_AFTER_SEND) |
297 | UART_PUT_TTGR(port, | ||
298 | atmel_port->rs485.delay_rts_after_send); | ||
296 | mode |= ATMEL_US_USMODE_RS485; | 299 | mode |= ATMEL_US_USMODE_RS485; |
297 | } else { | 300 | } else { |
298 | dev_dbg(port->dev, "Setting UART to RS232\n"); | 301 | dev_dbg(port->dev, "Setting UART to RS232\n"); |
@@ -1211,7 +1214,9 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1211 | 1214 | ||
1212 | if (atmel_port->rs485.flags & SER_RS485_ENABLED) { | 1215 | if (atmel_port->rs485.flags & SER_RS485_ENABLED) { |
1213 | dev_dbg(port->dev, "Setting UART to RS485\n"); | 1216 | dev_dbg(port->dev, "Setting UART to RS485\n"); |
1214 | UART_PUT_TTGR(port, atmel_port->rs485.delay_rts_before_send); | 1217 | if (atmel_port->rs485.flags & SER_RS485_RTS_AFTER_SEND) |
1218 | UART_PUT_TTGR(port, | ||
1219 | atmel_port->rs485.delay_rts_after_send); | ||
1215 | mode |= ATMEL_US_USMODE_RS485; | 1220 | mode |= ATMEL_US_USMODE_RS485; |
1216 | } else { | 1221 | } else { |
1217 | dev_dbg(port->dev, "Setting UART to RS232\n"); | 1222 | dev_dbg(port->dev, "Setting UART to RS232\n"); |