public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: Laurent Pinchart <laurentp@cse-semaphore.com>
Cc: linux-serial@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH/RFC] 8250: Auto RS485 direction control
Date: Thu, 24 Jul 2008 13:10:50 +0100	[thread overview]
Message-ID: <20080724121050.GA9327@flint.arm.linux.org.uk> (raw)
In-Reply-To: <200807241347.33261.laurentp@cse-semaphore.com>

On Thu, Jul 24, 2008 at 01:47:29PM +0200, Laurent Pinchart wrote:
> This patch adds support for the automatic RS485 direction control feature
> present in 16850 UARTs.
> 
> A new termios c_cflag, CARTS, is introduced to configure automatic direction
> control from userspace.
> 
> This is a first proposal. I'm open to suggestions regarding the CARTS name.

I think CARTS is a bad name - if you look at other 8250 ports, they have
auto-flow control for normal communications which not only includes
stopping the transmitter when CTS deasserts, but also allows the device
to deassert RTS when the receive FIFO reaches a certain level.

That means that the name "auto RTS" is confusing.

Maybe a better name would be CRS485 to enable RS485 direction control?
Then we can use CRTSCTS to mean "on the RTS signal".  If/when a
CDTRDSR for DTR/DSR flow control is introduced, we could then use
that to switch to DTR RS485 direction control instead.

> I assume the CARTS flag will have to be added to all asm/termbits.h
> headers.

Yes...

> Why are the termios bits definitions platform specific ?

... though if you can find a free bit in the cflag on all platforms,
creating an asm-generic/termbits.h might be a good idea?

Alan should probably comment on that first though.

> diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h
> index 3c8a6aa..3db78cc 100644
> --- a/include/linux/serial_reg.h
> +++ b/include/linux/serial_reg.h
> @@ -188,6 +188,7 @@
>  #define UART_FCTR_RTS_8DELAY	0x03
>  #define UART_FCTR_IRDA		0x04  /* IrDa data encode select */
>  #define UART_FCTR_TX_INT	0x08  /* Tx interrupt type select */
> +#define UART_FCTR_RS485		0x08  /* Auto RS485 direction control */

Please include in the comment which device this refers to (as the entries
below do.)

>  #define UART_FCTR_TRGA		0x00  /* Tx/Rx 550 trigger table select */
>  #define UART_FCTR_TRGB		0x10  /* Tx/Rx 650 trigger table select */
>  #define UART_FCTR_TRGC		0x20  /* Tx/Rx 654 trigger table select */

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

  parent reply	other threads:[~2008-07-24 12:11 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-24 11:47 [PATCH/RFC] 8250: Auto RS485 direction control Laurent Pinchart
2008-07-24 11:57 ` Alan Cox
2008-07-24 12:24   ` Russell King
2008-07-24 12:27     ` Alan Cox
2008-07-24 12:52       ` Russell King
2008-07-24 13:00         ` Alan Cox
2008-07-24 13:18         ` Laurent Pinchart
2008-07-24 14:13         ` Matt Schulte
2008-07-24 14:47           ` Russell King
2008-07-24 12:10 ` Russell King [this message]
2008-08-04 14:14 ` Tosoni
2008-08-04 14:22   ` Grant Edwards
2008-08-04 14:36   ` Laurent Pinchart
2008-08-04 16:15     ` Grant Edwards
2008-08-04 16:21       ` Grant Edwards
2008-08-05  9:41       ` Laurent Pinchart
2008-08-05 12:55         ` Tosoni
2008-08-06 14:30           ` Christopher Gibson
2008-08-06 16:33             ` Tosoni
2008-08-09 10:08               ` Christopher Gibson
2008-08-07  8:50             ` Laurent Pinchart
2008-08-07 13:50               ` Grant Edwards
2008-08-10  3:49               ` Christopher Gibson
2008-08-10  3:57               ` Christopher Gibson
2008-08-29 12:22                 ` Christopher Gibson
2008-12-02 13:09                 ` [PATCH/RFC] " Christopher Gibson
2008-12-04 11:14                   ` Christopher Gibson
2008-08-04 16:47     ` [PATCH/RFC] 8250: " Tosoni
2008-08-04 17:46       ` Grant Edwards
2008-08-04 20:59         ` Matt Schulte
2008-08-05  9:23         ` Laurent Pinchart
2008-08-05  9:34         ` Tosoni

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=20080724121050.GA9327@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=laurentp@cse-semaphore.com \
    --cc=linux-serial@vger.kernel.org \
    /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