Linux Serial subsystem development
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Cc: linux-serial <linux-serial@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	krzysztof.kozlowski+dt@linaro.org, marex@denx.de,
	Jiri Slaby <jirislaby@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Alexander Dahl <ada@thorsis.com>,
	kernel@dh-electronics.com,
	linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH V3 4/4] serial: stm32: Add support for rs485 RX_DURING_TX output GPIO
Date: Thu, 1 Dec 2022 14:09:32 +0200 (EET)	[thread overview]
Message-ID: <2d909d7f-9c6-474-ce15-76a55fdafed3@linux.intel.com> (raw)
In-Reply-To: <20221201110237.7917-4-cniedermaier@dh-electronics.com>

On Thu, 1 Dec 2022, Christoph Niedermaier wrote:

> If a RX_DURING_TX GPIO is defined by the DT property "rs485-rx-during-tx-gpios"
> this patch switches this GPIO accordingly to the RS485 flag RX_DURING_TX in user
> space. Controlled by this GPIO, now the hardware is responsible for connecting
> or disconnecting RX during TX.
> 
> Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
> ---
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Jiri Slaby <jirislaby@kernel.org>
> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
> Cc: Alexander Dahl <ada@thorsis.com>
> Cc: Marek Vasut <marex@denx.de>
> Cc: kernel@dh-electronics.com
> Cc: linux-stm32@st-md-mailman.stormreply.com
> To: linux-serial@vger.kernel.org
> To: linux-arm-kernel@lists.infradead.org
> ---
> V2: - Rework of the commit message
> V3: - No changes
> ---
>  drivers/tty/serial/stm32-usart.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
> index a1490033aa16..0f2cca9054ba 100644
> --- a/drivers/tty/serial/stm32-usart.c
> +++ b/drivers/tty/serial/stm32-usart.c
> @@ -226,7 +226,14 @@ static int stm32_usart_config_rs485(struct uart_port *port, struct ktermios *ter
>  
>  	stm32_usart_clr_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit));
>  
> -	rs485conf->flags |= SER_RS485_RX_DURING_TX;
> +	if (port->rs485_rx_during_tx_gpio) {
> +		if (rs485conf->flags & SER_RS485_RX_DURING_TX)
> +			gpiod_set_value_cansleep(port->rs485_rx_during_tx_gpio, 1);
> +		else
> +			gpiod_set_value_cansleep(port->rs485_rx_during_tx_gpio, 0);

gpiod_set_value_cansleep(port->rs485_rx_during_tx_gpio,
			 !!(rs485conf->flags & SER_RS485_RX_DURING_TX));

And the same comment also for the other patch.

-- 
 i.

  reply	other threads:[~2022-12-01 12:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 11:02 [PATCH V3 1/4] dt-bindings: serial: rs485: Add GPIO controlling RX enable during TX Christoph Niedermaier
2022-12-01 11:02 ` [PATCH V3 2/4] serial: core: Add option to output RS485 RX_DURING_TX state via GPIO Christoph Niedermaier
2022-12-01 11:02 ` [PATCH V3 3/4] serial: imx: Add support for RS485 RX_DURING_TX output GPIO Christoph Niedermaier
2022-12-01 11:02 ` [PATCH V3 4/4] serial: stm32: Add support for rs485 " Christoph Niedermaier
2022-12-01 12:09   ` Ilpo Järvinen [this message]
2022-12-01 23:56 ` [PATCH V3 1/4] dt-bindings: serial: rs485: Add GPIO controlling RX enable during TX Rob Herring

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=2d909d7f-9c6-474-ce15-76a55fdafed3@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=ada@thorsis.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=cniedermaier@dh-electronics.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kernel@dh-electronics.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=marex@denx.de \
    --cc=mcoquelin.stm32@gmail.com \
    /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