From: Chris Gibson <chris@toftronix.com.au>
To: Laurent Pinchart <laurentp@cse-semaphore.com>
Cc: Matthias Fuchs <mfuchs@ma-fu.de>, linux-serial@vger.kernel.org
Subject: Re: [PATCH/RFC] serial: Add ioctl to enable auto rs485 mode with some Exar UARTs
Date: Sun, 21 Dec 2008 20:50:04 +1100 [thread overview]
Message-ID: <1229853004.3216.14.camel@thewinkle.toftronix.com.au> (raw)
In-Reply-To: <200812191613.29657.laurentp@cse-semaphore.com>
Two and a half weeks ago I submitted a patch to implement RS485 auto
direction control on either (or both) the RTS and the DTR lines with
varying pre and post delay settings that would work for _all_ uarts that
support mctrl.
This patch had a variation on the ioctl suggested by Alan Cox, that was
a variation on an ioctl that was already in existence in the kernel.
The ioctl was devised to allow considerable flexibility, and I hoped
that it would be considered for future auto direction control.
Sorry for sounding grumpy but is any one interested?
On Fri, 2008-12-19 at 16:13 +0100, Laurent Pinchart wrote:
> Hi Matthias,
>
> On Friday 19 December 2008 00:48:34 Matthias Fuchs wrote:
> > Hi,
> >
> > please see my patch for enabling the RS485 half-duplex control below.
> > Please note that I am using this on a PowerPC platform. So I needed to
> > add the ioctl to the PowerPC header. As Wolfgang stated, it is
> > already in the x86 header. I am not sure if I have to post the modification
> > on the powerpc header to the PowerPC list or if it will be accepted here
> > as well. .... But first I will have to see what you think of this patch
> > :-)
> >
> > Matthias
> >
> >
> > Some Exar UARTs support a auto rs485 mode. In this mode
> > the UART's RTS# pin is activated during transmitting and
> > can be used to enable a rs485 line driver. This has nothing
> > to do with attempts to do this by manually by asserting/
> > deasserting handshake lines.
>
> [snip]
> > + serial_outp(up, UART_LCR, 0xbf);
> > + fctr = serial_inp(up, UART_FCTR);
> > + if (rs485ctrl.flags & SER_RS485_ENABLED)
> > + fctr |= 0x08;
> > + else
> > + fctr &= ~0x08;
> > + serial_outp(up, UART_FCTR, fctr);
> > + serial_outp(up, UART_LCR, 0);
>
> You might also want to add a
>
> #define UART_FCTR_RS485 0x08
>
> to include/linux/serial_reg.h instead of using a hardcoded 0x08 constant.
>
next prev parent reply other threads:[~2008-12-21 9:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-18 23:48 [PATCH/RFC] serial: Add ioctl to enable auto rs485 mode with some Exar UARTs Matthias Fuchs
2008-12-19 10:28 ` Laurent Pinchart
2008-12-22 17:57 ` Matthias Fuchs
2008-12-19 15:13 ` Laurent Pinchart
2008-12-21 9:50 ` Chris Gibson [this message]
2008-12-22 15:59 ` Wolfram Sang
2008-12-22 18:02 ` Matthias Fuchs
2008-12-23 13:23 ` Christopher Gibson
2009-01-02 15:29 ` Matthias Fuchs
2009-01-07 13:42 ` Christopher Gibson
2008-12-23 14:03 ` Christopher Gibson
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=1229853004.3216.14.camel@thewinkle.toftronix.com.au \
--to=chris@toftronix.com.au \
--cc=laurentp@cse-semaphore.com \
--cc=linux-serial@vger.kernel.org \
--cc=mfuchs@ma-fu.de \
/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