* atmel_serial: fix RTS high after initialization in RS485 mode
@ 2010-10-24 10:48 Claudio Scordino
2010-10-25 22:54 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Claudio Scordino @ 2010-10-24 10:48 UTC (permalink / raw)
To: linux-arm-kernel
Hi Nicolas,
when working in RS485 mode, the atmel_serial driver keeps RTS
high after the initialization of the serial port. It goes low only after
the first character has been sent.
This patch fixes this behavior. It has been already tested by Arkadiusz (CC:-ed).
Best regards,
Claudio
atmel_serial: RTS line low after initialization of the serial port
Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
Signed-off-by: Arkadiusz Bubala <arkadiusz.bubala@gmail.com>
---
drivers/serial/atmel_serial.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 3892666..85aa66f 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -1732,6 +1732,15 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, 1);
platform_set_drvdata(pdev, port);
+ if (port->rs485.flags & SER_RS485_ENABLED) {
+ unsigned int control = 0;
+ unsigned int mode = 0;
+ control |= ATMEL_US_RTSEN;
+ mode |= ATMEL_US_USMODE_NORMAL;
+ UART_PUT_MR(&port->uart, mode);
+ UART_PUT_CR(&port->uart, control);
+ }
+
return 0;
err_add_port:
--
1.6.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* atmel_serial: fix RTS high after initialization in RS485 mode
2010-10-24 10:48 atmel_serial: fix RTS high after initialization in RS485 mode Claudio Scordino
@ 2010-10-25 22:54 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2010-10-25 22:54 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, 24 Oct 2010 12:48:29 +0200
Claudio Scordino <claudio@evidence.eu.com> wrote:
> Hi Nicolas,
>
> when working in RS485 mode, the atmel_serial driver keeps RTS
> high after the initialization of the serial port. It goes low only after
> the first character has been sent.
>
> This patch fixes this behavior. It has been already tested by Arkadiusz (CC:-ed).
>
> Best regards,
>
> Claudio
>
>
> atmel_serial: RTS line low after initialization of the serial port
>
> Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
> Signed-off-by: Arkadiusz Bubala <arkadiusz.bubala@gmail.com>
> ---
> drivers/serial/atmel_serial.c | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
> index 3892666..85aa66f 100644
> --- a/drivers/serial/atmel_serial.c
> +++ b/drivers/serial/atmel_serial.c
> @@ -1732,6 +1732,15 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
> device_init_wakeup(&pdev->dev, 1);
> platform_set_drvdata(pdev, port);
>
> + if (port->rs485.flags & SER_RS485_ENABLED) {
> + unsigned int control = 0;
> + unsigned int mode = 0;
> + control |= ATMEL_US_RTSEN;
> + mode |= ATMEL_US_USMODE_NORMAL;
> + UART_PUT_MR(&port->uart, mode);
> + UART_PUT_CR(&port->uart, control);
> + }
> +
> return 0;
>
That was a lot of code! How about just this?
if (port->rs485.flags & SER_RS485_ENABLED) {
UART_PUT_MR(&port->uart, ATMEL_US_USMODE_NORMAL);
UART_PUT_CR(&port->uart, ATMEL_US_RTSEN);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-25 22:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-24 10:48 atmel_serial: fix RTS high after initialization in RS485 mode Claudio Scordino
2010-10-25 22:54 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).