All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] tty: serial: Add ability to control rs485 RX_DURING_TX via a GPIO
@ 2022-10-26 16:50 ` Christoph Niedermaier
  0 siblings, 0 replies; 18+ messages in thread
From: Christoph Niedermaier @ 2022-10-26 16:50 UTC (permalink / raw)
  To: linux-serial, linux-arm-kernel
  Cc: krzysztof.kozlowski+dt, marex, jirislaby, Christoph Niedermaier

This patch series add the ability to control the RS485 feature RX_DURING_TX via
a GPIO. Currently it is handled by the low level serial driver and it depends
on the ability of the serial hardware. In case of that RX_DURING_TX is disabled
the serial hardware must be capable to turn off the receiver during sending.
The idea is to have an electrical circuit that connects/disconnects the Rx by
using the RX_DURING_TX GPIO. On one hand by using this GPIO the use of RS485
RX_DURING_TX becomes independent of the capability of the serial hardware, and
on the other hand possible software-caused switch-off and switch-on times of the
receiver in case of RX_DURING_TX is disabled (default state) can also be avoided.

The core patch adds a generic GPIO variable for the use of this RS485 feature
controlled by a GPIO. The GPIO is defined by the devicetree property
"rs485-rx-during-tx-gpios".

The low-level implementation is done for the STM32 and the i.MX serial driver.
Other platforms are not covered in this series, but can easily be added.

I tested it with a DHCOM i.MX6DL and DHCOM STM32MP1 on a PicoITX board.

In this series the devicetree bindings description is also included.


Christoph Niedermaier (4):
  dt_bindings: rs485: Add binding for GPIO that controls Rx enable
    during Tx
  serial: core: Add option to control rs485 RX_DURING_TX by a GPIO
  serial: imx: Add support for rs485 RX_DURING_TX GPIO
  serial: stm32: Add support for rs485 RX_DURING_TX GPIO

 Documentation/devicetree/bindings/serial/rs485.yaml |  4 ++++
 drivers/tty/serial/imx.c                            | 13 +++++++++++--
 drivers/tty/serial/serial_core.c                    | 12 ++++++++++++
 drivers/tty/serial/stm32-usart.c                    |  9 ++++++++-
 include/linux/serial_core.h                         |  1 +
 5 files changed, 36 insertions(+), 3 deletions(-)

-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-10-28  8:38 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 16:50 [PATCH 0/4] tty: serial: Add ability to control rs485 RX_DURING_TX via a GPIO Christoph Niedermaier
2022-10-26 16:50 ` Christoph Niedermaier
2022-10-26 16:50 ` [PATCH 1/4] dt_bindings: rs485: Add binding for GPIO that controls Rx enable during Tx Christoph Niedermaier
2022-10-26 16:50   ` Christoph Niedermaier
2022-10-26 20:59   ` Rob Herring
2022-10-26 20:59     ` Rob Herring
2022-10-27 12:06     ` Christoph Niedermaier
2022-10-27 12:06       ` Christoph Niedermaier
2022-10-28  6:20       ` Alexander Dahl
2022-10-28  6:20         ` Alexander Dahl
2022-10-28  8:27         ` Christoph Niedermaier
2022-10-28  8:27           ` Christoph Niedermaier
2022-10-26 16:50 ` [PATCH 2/4] serial: core: Add option to control rs485 RX_DURING_TX by a GPIO Christoph Niedermaier
2022-10-26 16:50   ` Christoph Niedermaier
2022-10-26 16:50 ` [PATCH 3/4] serial: imx: Add support for rs485 RX_DURING_TX GPIO Christoph Niedermaier
2022-10-26 16:50   ` Christoph Niedermaier
2022-10-26 16:50 ` [PATCH 4/4] serial: stm32: " Christoph Niedermaier
2022-10-26 16:50   ` Christoph Niedermaier

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.