Linux-Serial Archive on
 help / color / Atom feed
* [PATCH] sc16is7xx: Set iobase to device index
@ 2020-09-01 12:03 Daniel Mack
  0 siblings, 0 replies; only message in thread
From: Daniel Mack @ 2020-09-01 12:03 UTC (permalink / raw)
  To: linux-serial; +Cc: gregkh, jslaby, Daniel Mack

Some derivates of sc16is7xx devices expose more than one tty device to
userspace. If multiple such devices exist in a system, userspace
currently has no clean way to infer which tty maps to which physical

Set the .iobase value to the relative index within the device to allow
infering the order through sysfs.

Signed-off-by: Daniel Mack <>
 drivers/tty/serial/sc16is7xx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index d2e5c6c866439..a3085b90e2023 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1272,6 +1272,7 @@ static int sc16is7xx_probe(struct device *dev,
 		s->p[i].port.type	= PORT_SC16IS7XX;
 		s->p[i].port.fifosize	= SC16IS7XX_FIFO_SIZE;
 		s->p[i].port.flags	= UPF_FIXED_TYPE | UPF_LOW_LATENCY;
+		s->p[i].port.iobase	= i;
 		s->p[i].port.iotype	= UPIO_PORT;
 		s->p[i].port.uartclk	= freq;
 		s->p[i].port.rs485_config = sc16is7xx_config_rs485;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-01 12:03 [PATCH] sc16is7xx: Set iobase to device index Daniel Mack

Linux-Serial Archive on

Archives are clonable:
	git clone --mirror linux-serial/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-serial linux-serial/ \
	public-inbox-index linux-serial

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone