diff options
author | Claudio Scordino <claudio@evidence.eu.com> | 2011-11-09 09:51:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-15 15:13:44 -0500 |
commit | 93f3350c46fa5dfcc9650eb19b186e71ffc924c3 (patch) | |
tree | 13b6f81f9fd85227283b38af6267d094e0038beb /include/linux/serial.h | |
parent | 90f04c2926cfb5bf74533b0a7766bc896f6a0c0e (diff) |
RS485: fix inconsistencies in the meaning of some variables
The crisv10.c and the atmel_serial.c serial drivers intepret the fields of the
serial_rs485 structure in a different way.
In particular, crisv10.c uses SER_RS485_RTS_AFTER_SEND and
SER_RS485_RTS_ON_SEND for the voltage of the RTS pin; atmel_serial.c,
instead, uses these values to know if a delay must be set before and
after sending. This patch makes the usage of these variables consistent
across all drivers and fixes the Documentation as well.
From now on, SER_RS485_RTS_AFTER_SEND and SER_RS485_RTS_ON_SEND will be
used to set the voltage of the RTS pin (as in the crisv10.c driver); the
delay will be understood by looking only at the value of
delay_rts_before_send and delay_rts_after_send.
Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
Signed-off-by: Darron Black <darron@griffin.net>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/serial.h')
-rw-r--r-- | include/linux/serial.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/linux/serial.h b/include/linux/serial.h index 97ff8e27a6cc..3d86517fe7d5 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
@@ -207,13 +207,15 @@ struct serial_icounter_struct { | |||
207 | 207 | ||
208 | struct serial_rs485 { | 208 | struct serial_rs485 { |
209 | __u32 flags; /* RS485 feature flags */ | 209 | __u32 flags; /* RS485 feature flags */ |
210 | #define SER_RS485_ENABLED (1 << 0) | 210 | #define SER_RS485_ENABLED (1 << 0) /* If enabled */ |
211 | #define SER_RS485_RTS_ON_SEND (1 << 1) | 211 | #define SER_RS485_RTS_ON_SEND (1 << 1) /* Logical level for |
212 | #define SER_RS485_RTS_AFTER_SEND (1 << 2) | 212 | RTS pin when |
213 | #define SER_RS485_RTS_BEFORE_SEND (1 << 3) | 213 | sending */ |
214 | #define SER_RS485_RTS_AFTER_SEND (1 << 2) /* Logical level for | ||
215 | RTS pin after sent*/ | ||
214 | #define SER_RS485_RX_DURING_TX (1 << 4) | 216 | #define SER_RS485_RX_DURING_TX (1 << 4) |
215 | __u32 delay_rts_before_send; /* Milliseconds */ | 217 | __u32 delay_rts_before_send; /* Delay before send (milliseconds) */ |
216 | __u32 delay_rts_after_send; /* Milliseconds */ | 218 | __u32 delay_rts_after_send; /* Delay after send (milliseconds) */ |
217 | __u32 padding[5]; /* Memory is cheap, new structs | 219 | __u32 padding[5]; /* Memory is cheap, new structs |
218 | are a royal PITA .. */ | 220 | are a royal PITA .. */ |
219 | }; | 221 | }; |