public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Hugo Villeneuve <hugo@hugovil.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Jiri Slaby <jirislaby@kernel.org>
Cc: hugo@hugovil.com, ilpo.jarvinen@linux.intel.com,
	 linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	 Hugo Villeneuve <hvilleneuve@dimonoff.com>
Subject: [PATCH 7/9] serial: sc16is7xx: use new UPIO_BUS as iotype
Date: Thu, 23 Apr 2026 16:15:07 -0400	[thread overview]
Message-ID: <20260423-tty-upio-v1-7-baf82d3b86d1@dimonoff.com> (raw)
In-Reply-To: <20260423-tty-upio-v1-0-baf82d3b86d1@dimonoff.com>

From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

Now that we have a new UPIO_BUS I/O type, use it to register our serial
port and remove ambiguous membase/iobase workaround.

Note that commit 5da6b1c079e6 ("sc16is7xx: Set iobase to device index")
used the iobase field as an index within the device to allow infering
the order through sysfs, but this is no longer needed since
commit 1ef2c2df1199 ("serial: core: Fix serial core controller port name
to show controller id").

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
---
This means that displaying iomem_base will now always be zero:

cat /sys/class/tty/ttySC0/iomem_base
0x0
cat /sys/class/tty/ttySC1/iomem_base
0x0
...

But the index can be properly displayed with this instead (example with two
sc16is7xx devices):
$> ls -al /sys/class/tty/ttySC*/device
... /sys/class/tty/ttySC0/device -> ../../../spi1.0:0.0
... /sys/class/tty/ttySC1/device -> ../../../spi1.0:0.1
... /sys/class/tty/ttySC2/device -> ../../../spi3.0:0.0
... /sys/class/tty/ttySC3/device -> ../../../spi3.0:0.1
---
 drivers/tty/serial/sc16is7xx.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 1fd64a47341d8263c82fcadd90a4c2e549193e19..4b638e69f36f2d20253d8de31f52ecfe349aa39f 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1472,14 +1472,7 @@ static int sc16is7xx_setup_channel(struct sc16is7xx_one *one, int i,
 	port->type	= PORT_SC16IS7XX;
 	port->fifosize	= SC16IS7XX_FIFO_SIZE;
 	port->flags	= UPF_FIXED_TYPE | UPF_LOW_LATENCY;
-	port->iobase	= i;
-	/*
-	 * Use all ones as membase to make sure uart_configure_port() in
-	 * serial_core.c does not abort for SPI/I2C devices where the
-	 * membase address is not applicable.
-	 */
-	port->membase	= (void __iomem *)~0;
-	port->iotype	= UPIO_PORT;
+	port->iotype	= UPIO_BUS;
 	port->rs485_config = sc16is7xx_config_rs485;
 	port->rs485_supported = sc16is7xx_rs485_supported;
 	port->ops	= &sc16is7xx_ops;

-- 
2.47.3


  parent reply	other threads:[~2026-04-23 20:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23 20:15 [PATCH 0/9] serial: add new I/O type for SPI and I2C bus devices Hugo Villeneuve
2026-04-23 20:15 ` [PATCH 1/9] serial: core: add uart_iotype_mmio/legacy_io helper functions Hugo Villeneuve
2026-04-23 20:15 ` [PATCH 2/9] serial: core: use uart_iotype_*() to simplify code Hugo Villeneuve
2026-04-24 11:13   ` Ilpo Järvinen
2026-04-24 15:30     ` Hugo Villeneuve
2026-04-27 13:46       ` Hugo Villeneuve
2026-04-27 14:16         ` Ilpo Järvinen
2026-04-27 14:18           ` Hugo Villeneuve
2026-04-23 20:15 ` [PATCH 3/9] serial: 8250: " Hugo Villeneuve
2026-04-23 20:15 ` [PATCH 4/9] serial: core: fix indentation/alignment Hugo Villeneuve
2026-04-23 20:15 ` [PATCH 5/9] serial: core: add new I/O type for SPI and I2C bus devices Hugo Villeneuve
2026-04-23 20:15 ` [PATCH 6/9] serial: core: prevent irrelevant I/O infos display for UPIO_BUS Hugo Villeneuve
2026-04-24 10:51   ` Ilpo Järvinen
2026-04-24 14:24     ` Hugo Villeneuve
2026-04-23 20:15 ` Hugo Villeneuve [this message]
2026-04-23 20:15 ` [PATCH 8/9] serial: max310x: use new UPIO_BUS as iotype Hugo Villeneuve
2026-04-23 20:15 ` [PATCH 9/9] serial: max3100: " Hugo Villeneuve
2026-04-24 11:24 ` [PATCH 0/9] serial: add new I/O type for SPI and I2C bus devices 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=20260423-tty-upio-v1-7-baf82d3b86d1@dimonoff.com \
    --to=hugo@hugovil.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hvilleneuve@dimonoff.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --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