public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: linux-serial@vger.kernel.org,
	Greg KH <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-kernel@vger.kernel.org
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH 08/36] serial: 8250_fintek: Fill in rs485_supported
Date: Mon,  6 Jun 2022 13:04:05 +0300	[thread overview]
Message-ID: <20220606100433.13793-9-ilpo.jarvinen@linux.intel.com> (raw)
In-Reply-To: <20220606100433.13793-1-ilpo.jarvinen@linux.intel.com>

Add information on supported serial_rs485 features.

Differentiate based on which port is in question.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/8250/8250_fintek.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c
index dba5950b8d0e..6e98c376e082 100644
--- a/drivers/tty/serial/8250/8250_fintek.c
+++ b/drivers/tty/serial/8250/8250_fintek.c
@@ -424,6 +424,17 @@ static int probe_setup_port(struct fintek_8250 *pdata,
 	return -ENODEV;
 }
 
+/* Only the first port supports delays */
+static const struct serial_rs485 fintek_8250_rs485_supported_port0 = {
+	.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND,
+	.delay_rts_before_send = 1,
+	.delay_rts_after_send = 1,
+};
+
+static const struct serial_rs485 fintek_8250_rs485_supported = {
+	.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND,
+};
+
 static void fintek_8250_set_rs485_handler(struct uart_8250_port *uart)
 {
 	struct fintek_8250 *pdata = uart->port.private_data;
@@ -435,6 +446,10 @@ static void fintek_8250_set_rs485_handler(struct uart_8250_port *uart)
 	case CHIP_ID_F81866:
 	case CHIP_ID_F81865:
 		uart->port.rs485_config = fintek_8250_rs485_config;
+		if (!pdata->index)
+			uart->port.rs485_supported = &fintek_8250_rs485_supported_port0;
+		else
+			uart->port.rs485_supported = &fintek_8250_rs485_supported;
 		break;
 
 	default: /* No RS485 Auto direction functional */
-- 
2.30.2


  parent reply	other threads:[~2022-06-06 10:06 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06 10:03 [PATCH 00/36] RS485 serial_rs485 sanitization Ilpo Järvinen
2022-06-06 10:03 ` [PATCH 01/36] serial: Add uart_rs485_config() Ilpo Järvinen
2022-06-25 20:19   ` Lukas Wunner
2022-06-26 12:36     ` Lino Sanfilippo
2022-06-06 10:03 ` [PATCH 02/36] serial: Move serial_rs485 sanitization into separate function Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 03/36] serial: Add rs485_supported to uart_port Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 04/36] serial: 8250: Create serial8250_em485_supported for em485 users Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 05/36] serial: 8250_bcm2835aux: Use serial8250_em485_supported Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 06/36] serial: 8250_dwlib: Fill in rs485_supported Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 07/36] serial: 8250_exar: " Ilpo Järvinen
2022-06-06 10:04 ` Ilpo Järvinen [this message]
2022-06-06 10:04 ` [PATCH 09/36] serial: 8250_lpc18cc: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 10/36] serial: 8250_of: Use serial8250_em485_supported Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 11/36] serial: 8250_pci: Fill in rs485_supported for pci_fintek Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 12/36] serial: pl011: Fill in rs485_supported Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 13/36] serial: ar933x: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 14/36] serial: atmel: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 15/36] serial: fsl_lpuart: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 16/36] serial: imx: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 17/36] serial: max310x: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 18/36] serial: mcf: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 19/36] serial: omap: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 20/36] serial: sc16is7xx: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 21/36] serial: stm32: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 22/36] serial: Sanitize rs485_struct Ilpo Järvinen
2022-06-25 20:12   ` Lukas Wunner
2022-06-26 12:39     ` Lino Sanfilippo
2022-06-06 10:04 ` [PATCH 23/36] serial: Clear rs485 struct when non-RS485 mode is set Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 24/36] serial: return -EINVAL for non-legacy RS485 flags Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 25/36] serial: 8250_dwlib: Remove serial_rs485 sanitization Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 26/36] serial: 8250_fintek: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 27/36] serial: 8250: lpc18xx: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 28/36] serial: 8250_pci: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 29/36] serial: pl011: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 30/36] serial: fsl_lpuart: Call core's sanitization and remove custom one Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 31/36] serial: imx: Remove serial_rs485 sanitization Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 32/36] serial: max310x: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 33/36] serial: 8250_exar: Remove serial_rs485 assignment Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 34/36] serial: mcf: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 35/36] serial: sc16is7xx: " Ilpo Järvinen
2022-06-06 10:04 ` [PATCH 36/36] serial: 8250: Remove serial_rs485 sanitization from em485 Ilpo Järvinen

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=20220606100433.13793-9-ilpo.jarvinen@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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