From: Andrew Morton <akpm@linux-foundation.org>
To: Claudio Scordino <claudio@evidence.eu.com>
Cc: "Nicolas Ferre" <nicolas.ferre@atmel.com>,
"Arkadiusz Bubała" <arkadiusz.bubala@gmail.com>,
linux@maxim.org.za,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
"Linux Kernel" <linux-kernel@vger.kernel.org>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"Greg KH" <greg@kroah.com>
Subject: Re: atmel_serial: fix RTS high after initialization in RS485 mode
Date: Mon, 25 Oct 2010 15:54:10 -0700 [thread overview]
Message-ID: <20101025155410.f960fcd5.akpm@linux-foundation.org> (raw)
In-Reply-To: <4CC40EFD.8070000@evidence.eu.com>
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);
}
prev parent reply other threads:[~2010-10-25 22:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101025155410.f960fcd5.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=arkadiusz.bubala@gmail.com \
--cc=claudio@evidence.eu.com \
--cc=greg@kroah.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@maxim.org.za \
--cc=nicolas.ferre@atmel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).