All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>, Rob Herring <robh+dt@kernel.org>
Cc: "Matwey V. Kornilov" <matwey@sai.msu.ru>,
	Giulio Benetti <giulio.benetti@micronovasrl.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Christoph Muellner <christoph.muellner@theobroma-systems.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Codrin Ciubotariu <Codrin.Ciubotariu@microchip.com>,
	Razvan Stefanescu <razvan.stefanescu@microchip.com>,
	Radu Pirea <radu.pirea@microchip.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Bich HEMON <bich.hemon@st.com>,
	Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>,
	Sascha Weisenberger <sascha.weisenberger@siemens.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	devicetree@vger.kernel.org, linux-serial@vger.kernel.org
Subject: [PATCH 0/4] rs485 bus termination GPIO
Date: Tue, 5 May 2020 16:42:00 +0200	[thread overview]
Message-ID: <cover.1588505407.git.lukas@wunner.de> (raw)

Commit e8759ad17d41 ("serial: uapi: Add support for bus termination"),
allowed user space to change rs485 bus termination through a flag in
struct serial_rs485.  But so far only a single driver, 8250_exar.c,
supports the flag:  It hardcodes a GPIO specific to Siemens IOT2040
products.

Provide for a more generic solution:  Define a device tree binding
for an rs485 bus termination GPIO (patch [3/4]), amend the serial core
to retrieve the GPIO from the device tree and amend the default
->rs485_config() callback for 8250 drivers to change the GPIO on
request from user space (patch [4/4]).

Retrieving the GPIO from the device tree may fail, so allow
uart_get_rs485_mode() to return an errno and change all callers
to check for failure (patch [2/4]).

Testing has exposed a bug in the 8250 core if retrieval of the GPIO
initially fails with -EPROBE_DEFER and is later retried.  That bug
is fixed by patch [1/4].


Lukas Wunner (4):
  serial: 8250: Avoid error message on reprobe
  serial: Allow uart_get_rs485_mode() to return errno
  dt-bindings: serial: Add binding for rs485 bus termination GPIO
  serial: 8250: Support rs485 bus termination GPIO

 .../devicetree/bindings/serial/rs485.yaml     |  4 +++
 drivers/tty/serial/8250/8250_core.c           | 16 +++++++---
 drivers/tty/serial/8250/8250_port.c           |  4 +++
 drivers/tty/serial/ar933x_uart.c              |  6 ++--
 drivers/tty/serial/atmel_serial.c             |  6 ++--
 drivers/tty/serial/fsl_lpuart.c               |  5 +++-
 drivers/tty/serial/imx.c                      |  6 +++-
 drivers/tty/serial/omap-serial.c              |  4 ++-
 drivers/tty/serial/serial_core.c              | 30 ++++++++++++++++++-
 drivers/tty/serial/stm32-usart.c              |  8 ++---
 include/linux/serial_core.h                   |  4 ++-
 11 files changed, 76 insertions(+), 17 deletions(-)

-- 
2.26.2


             reply	other threads:[~2020-05-05 14:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 14:42 Lukas Wunner [this message]
2020-05-05 14:42 ` [PATCH 1/4] serial: 8250: Avoid error message on reprobe Lukas Wunner
2020-05-05 16:01   ` Andy Shevchenko
2020-05-06  6:06     ` Lukas Wunner
2020-05-06 10:01       ` Andy Shevchenko
2020-05-06 11:54         ` Lukas Wunner
2020-05-05 14:42 ` [PATCH 2/4] serial: Allow uart_get_rs485_mode() to return errno Lukas Wunner
2020-05-05 14:42 ` [PATCH 3/4] dt-bindings: serial: Add binding for rs485 bus termination GPIO Lukas Wunner
2020-05-05 14:42 ` [PATCH 4/4] serial: 8250: Support " Lukas Wunner
2020-05-05 16:10   ` Andy Shevchenko
2020-05-06  6:29     ` Lukas Wunner
2020-05-06 10:06       ` 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=cover.1588505407.git.lukas@wunner.de \
    --to=lukas@wunner.de \
    --cc=Codrin.Ciubotariu@microchip.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bich.hemon@st.com \
    --cc=christoph.muellner@theobroma-systems.com \
    --cc=devicetree@vger.kernel.org \
    --cc=giulio.benetti@micronovasrl.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=jan.kiszka@siemens.com \
    --cc=jslaby@suse.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=matwey@sai.msu.ru \
    --cc=nicolas.ferre@microchip.com \
    --cc=radu.pirea@microchip.com \
    --cc=razvan.stefanescu@microchip.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sascha.weisenberger@siemens.com \
    --cc=u.kleine-koenig@pengutronix.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 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.