mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-10 15:58:47 +00:00
atmel_serial: RS485: receiving enabled when sending data
By default the atmel_serial driver in RS485 mode disables receiving data until all data in the send buffer has been sent. This flag allows to receive data even whilst sending data. Signed-off-by: Bernhard Roth <br@pwrnet.de> Signed-off-by: Claudio Scordino <claudio@evidence.eu.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
019dc9ea8d
commit
83cac9f3b4
@ -104,6 +104,9 @@
|
||||
rs485conf.flags |= SER_RS485_RTS_AFTER_SEND;
|
||||
rs485conf.delay_rts_after_send = ...;
|
||||
|
||||
/* Set this flag if you want to receive data even whilst sending data */
|
||||
rs485conf.flags |= SER_RS485_RX_DURING_TX;
|
||||
|
||||
if (ioctl (fd, TIOCSRS485, &rs485conf) < 0) {
|
||||
/* Error handling. See errno. */
|
||||
}
|
||||
|
@ -339,7 +339,8 @@ static void atmel_stop_tx(struct uart_port *port)
|
||||
/* Disable interrupts */
|
||||
UART_PUT_IDR(port, atmel_port->tx_done_mask);
|
||||
|
||||
if (atmel_port->rs485.flags & SER_RS485_ENABLED)
|
||||
if ((atmel_port->rs485.flags & SER_RS485_ENABLED) &&
|
||||
!(atmel_port->rs485.flags & SER_RS485_RX_DURING_TX))
|
||||
atmel_start_rx(port);
|
||||
}
|
||||
|
||||
@ -356,7 +357,8 @@ static void atmel_start_tx(struct uart_port *port)
|
||||
really need this.*/
|
||||
return;
|
||||
|
||||
if (atmel_port->rs485.flags & SER_RS485_ENABLED)
|
||||
if ((atmel_port->rs485.flags & SER_RS485_ENABLED) &&
|
||||
!(atmel_port->rs485.flags & SER_RS485_RX_DURING_TX))
|
||||
atmel_stop_rx(port);
|
||||
|
||||
/* re-enable PDC transmit */
|
||||
@ -680,7 +682,8 @@ static void atmel_tx_dma(struct uart_port *port)
|
||||
/* Enable interrupts */
|
||||
UART_PUT_IER(port, atmel_port->tx_done_mask);
|
||||
} else {
|
||||
if (atmel_port->rs485.flags & SER_RS485_ENABLED) {
|
||||
if ((atmel_port->rs485.flags & SER_RS485_ENABLED) &&
|
||||
!(atmel_port->rs485.flags & SER_RS485_RX_DURING_TX)) {
|
||||
/* DMA done, stop TX, start RX for RS485 */
|
||||
atmel_start_rx(port);
|
||||
}
|
||||
|
@ -211,6 +211,7 @@ struct serial_rs485 {
|
||||
#define SER_RS485_RTS_ON_SEND (1 << 1)
|
||||
#define SER_RS485_RTS_AFTER_SEND (1 << 2)
|
||||
#define SER_RS485_RTS_BEFORE_SEND (1 << 3)
|
||||
#define SER_RS485_RX_DURING_TX (1 << 4)
|
||||
__u32 delay_rts_before_send; /* Milliseconds */
|
||||
__u32 delay_rts_after_send; /* Milliseconds */
|
||||
__u32 padding[5]; /* Memory is cheap, new structs
|
||||
|
Loading…
x
Reference in New Issue
Block a user