mbox series

[0/2] serial: add rs485-mux-gpio dt binding and support

Message ID 20231120151056.148450-1-linux@rasmusvillemoes.dk
Headers show
Series serial: add rs485-mux-gpio dt binding and support | expand

Message

Rasmus Villemoes Nov. 20, 2023, 3:10 p.m. UTC
Some boards are wired so that they support both rs232 and rs485, with
a gpio controlling a mux connecting the SOC's pins to the appropriate
external circuitry. Instead of requiring the application to know about
such details and handle the gpio appropriately, allow it to be
described in device tree and let the serial core code handle it if
present.

Tested on a board based on imx8mp.

Rasmus Villemoes (2):
  dt-bindings: serial: rs485: add rs485-mux-gpios binding
  serial: core: implement support for rs485-mux-gpios

 .../devicetree/bindings/serial/rs485.yaml     |  5 +++
 drivers/tty/serial/serial_core.c              | 35 +++++++++++++++++--
 include/linux/serial_core.h                   |  1 +
 3 files changed, 39 insertions(+), 2 deletions(-)

Comments

Andy Shevchenko Nov. 22, 2023, 2:57 p.m. UTC | #1
On Mon, Nov 20, 2023 at 04:10:53PM +0100, Rasmus Villemoes wrote:
> Some boards are wired so that they support both rs232 and rs485, with
> a gpio controlling a mux connecting the SOC's pins to the appropriate
> external circuitry. Instead of requiring the application to know about
> such details and handle the gpio appropriately, allow it to be
> described in device tree and let the serial core code handle it if
> present.
> 
> Tested on a board based on imx8mp.

Why mux framework is not (may not) used?