All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Cc: "Christoph Niedermaier" <cniedermaier@dh-electronics.com>,
	"Crescent CY Hsieh" <crescentcy.hsieh@moxa.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"brenda.streiff@ni.com" <brenda.streiff@ni.com>,
	"Tomas Paukrt" <tomaspaukrt@email.cz>
Subject: Re: [PATCH 1/2] dt-bindings: serial: rs485: add rs485-mux-gpios binding
Date: Fri, 29 Dec 2023 00:25:11 +0100	[thread overview]
Message-ID: <20231228232511.GA19291@wunner.de> (raw)
In-Reply-To: <0ec4c423-3d18-4a29-b78e-938366ece117@gmx.de>

On Sat, Dec 23, 2023 at 02:40:58PM +0100, Lino Sanfilippo wrote:
> On 23.12.23 13:49, Christoph Niedermaier wrote:
> > From: Lukas Wunner [mailto:lukas@wunner.de]
> > Sent: Thursday, December 21, 2023 4:53 PM
> > > Well why don't we just allow enabling or disabling RS-485 termination
> > > independently from the SER_RS485_ENABLED bit in struct serial_rs485?
> > >
> > > Just let the user issue a TIOCSRS485 ioctl to toggle termination even
> > > if in RS-232 mode and use that mode for RS-422.
> >
> > Sounds not bad. The termination should only depend on whether the GPIO is
> > given or not.
> >
> > Irrespective of this, I think the Linos idea of an RS-422 mode is not bad.
> > This allows you to take care of special features that were previously
> > overlooked. For example, hardware flow control can be switched off so that
> > this does not cause any problems.
> 
> Also note, that RS232 and RS422 may NOT always be the same from driver
> perspective.
> Take a look at 8250_excar.c for example. That driver has to configure
> the hardware accordingly when switching from RS232 to RS422
> (see iot2040_rs485_config()).

Actually it seems there are a bunch of GPIOs on the IOT2040 board
(called MPIO instead of GPIO by the driver).  See the documentation
of the wiring at line 87 in drivers/tty/serial/8250/8250_exar.c.

So "configure the hardware" seems to just boil down to toggling the
right GPIO (aka MPIO) pins to mux the UART signals to the right
(RS232/RS485/RS422) transceiver.

IOT2040 is an ACPI-based platform, so no devicetree to describe
the RS232/RS485/RS422 mux GPIOs, but the underlying concept is the same.

Thanks,

Lukas

  parent reply	other threads:[~2023-12-28 23:25 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 15:10 [PATCH 0/2] serial: add rs485-mux-gpio dt binding and support Rasmus Villemoes
2023-11-20 15:10 ` [PATCH 1/2] dt-bindings: serial: rs485: add rs485-mux-gpios binding Rasmus Villemoes
2023-11-21  7:52   ` Krzysztof Kozlowski
2023-11-21  8:27     ` Rasmus Villemoes
2023-11-21  8:34       ` Krzysztof Kozlowski
2023-11-21  9:28         ` Rasmus Villemoes
2023-11-22 18:00           ` Krzysztof Kozlowski
2023-11-22 14:53   ` Lukas Wunner
2023-11-23 10:07     ` Rasmus Villemoes
2023-11-23 10:38       ` Lukas Wunner
2023-11-23 13:48         ` Rasmus Villemoes
2023-11-25 23:40     ` Lino Sanfilippo
2023-11-27 12:14       ` Christoph Niedermaier
2023-12-06 15:42         ` Lino Sanfilippo
2023-12-07 12:35           ` Andy Shevchenko
2023-12-09 11:24             ` Lino Sanfilippo
2023-12-09 11:47           ` Lino Sanfilippo
2023-12-11 13:07             ` Andy Shevchenko
2023-12-14  8:52               ` Lino Sanfilippo
2023-12-14 10:24               ` Crescent CY Hsieh
2023-12-14 13:41                 ` Christoph Niedermaier
2023-12-14 14:04                   ` Lino Sanfilippo
2023-12-14 14:50                     ` Christoph Niedermaier
2023-12-15 22:13                       ` Lino Sanfilippo
2023-12-18  9:08                         ` Christoph Niedermaier
2023-12-21 15:53                   ` Lukas Wunner
2023-12-23 12:49                     ` Christoph Niedermaier
2023-12-23 13:40                       ` Lino Sanfilippo
2023-12-24 10:11                         ` Christoph Niedermaier
2023-12-28 23:25                         ` Lukas Wunner [this message]
2023-11-20 15:10 ` [PATCH 2/2] serial: core: implement support for rs485-mux-gpios Rasmus Villemoes
2023-11-20 23:28   ` Lino Sanfilippo
2023-11-21 10:49   ` Dan Carpenter
2023-11-22 15:10   ` Lukas Wunner
2023-12-04  5:00   ` Dan Carpenter
2023-11-22 14:57 ` [PATCH 0/2] serial: add rs485-mux-gpio dt binding and support Andy Shevchenko
  -- strict thread matches above, loose matches on Subject: below --
2023-12-27 17:40 [PATCH 1/2] dt-bindings: serial: rs485: add rs485-mux-gpios binding Andy Shevchenko

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=20231228232511.GA19291@wunner.de \
    --to=lukas@wunner.de \
    --cc=LinoSanfilippo@gmx.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brenda.streiff@ni.com \
    --cc=cniedermaier@dh-electronics.com \
    --cc=conor+dt@kernel.org \
    --cc=crescentcy.hsieh@moxa.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=robh+dt@kernel.org \
    --cc=tomaspaukrt@email.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.