All of lore.kernel.org
 help / color / mirror / Atom feed
From: Moriis Ku <saumah@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, Morris Ku <saumah@gmail.com>
Subject: Add support for SUNIX multi I/O board
Date: Mon, 26 Apr 2021 17:38:28 +0800	[thread overview]
Message-ID: <20210426093828.10348-1-saumah@gmail.com> (raw)

From: Morris Ku <saumah@gmail.com>

Sunix SDC Multi I/O board are different to Timedia's.

This patch adds proper support for Sunix SDC Multi I/O board.

Signed-off-by: Morris Ku<saumah@gmail.com>
---
 tty/serial/8250/8250_pci.c | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/tty/serial/8250/8250_pci.c b/tty/serial/8250/8250_pci.c
index 8814ff38..5758a98b 100644
--- a/tty/serial/8250/8250_pci.c
+++ b/tty/serial/8250/8250_pci.c
@@ -1802,6 +1802,25 @@ pci_sunix_setup(struct serial_private *priv,
 	return setup_port(priv, port, bar, offset, 0);
 }
 
+static int
+pci_sunix_sdc_setup(struct serial_private *priv,
+		const struct pciserial_board *board,
+		struct uart_8250_port *port, int idx)
+{
+	int bar;
+	int offset;
+
+	port->port.flags |= UPF_FIXED_TYPE;
+	port->port.type = PORT_SUNIX;
+
+	if (idx < 4) {
+		bar = 1
+		offset = idx * board->uart_offset;
+	}
+
+	return setup_port(priv, port, bar, offset, 0);
+}
+
 static int
 pci_moxa_setup(struct serial_private *priv,
 		const struct pciserial_board *board,
@@ -2430,6 +2449,13 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
 		.subdevice	= PCI_ANY_ID,
 		.setup		= pci_sunix_setup,
 	},
+	{
+		.vendor		= PCI_VENDOR_ID_SUNIX,
+		.device		= PCI_DEVICE_ID_SUNIX_2000,
+		.subvendor	= PCI_VENDOR_ID_SUNIX,
+		.subdevice	= PCI_ANY_ID,
+		.setup		= pci_sunix_sdc_setup,
+	},
 	/*
 	 * Xircom cards
 	 */
@@ -2924,6 +2950,7 @@ enum pci_board_num_t {
 	pbn_sunix_pci_4s,
 	pbn_sunix_pci_8s,
 	pbn_sunix_pci_16s,
+	pbn_sunix_sdc_pci_4s
 	pbn_moxa8250_2p,
 	pbn_moxa8250_4p,
 	pbn_moxa8250_8p,
@@ -3704,6 +3731,11 @@ static struct pciserial_board pci_boards[] = {
 		.base_baud      = 921600,
 		.uart_offset	= 0x8,
 	},
+	[pbn_sunix_sdc_pci_4s] = {
+		.num_ports	= 4,
+		.base_baud      = 921600,
+		.uart_offset	= 0x10,
+	},
 	[pbn_moxa8250_2p] = {
 		.flags		= FL_BASE1,
 		.num_ports      = 2,
@@ -4783,7 +4815,9 @@ static const struct pci_device_id serial_pci_tbl[] = {
 	{	PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
 		PCI_VENDOR_ID_SUNIX, 0x0010, 0, 0,
 		pbn_sunix_pci_16s },
-
+	{	PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_2000,
+		PCI_VENDOR_ID_SUNIX, 0x0001, 0, 0,
+		pbn_sunix_sdc_pci_4s },
 	/*
 	 * AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org>
 	 */
-- 
2.20.1


             reply	other threads:[~2021-04-26  9:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26  9:38 Moriis Ku [this message]
2021-04-26  9:48 ` Add support for SUNIX multi I/O board Greg KH

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=20210426093828.10348-1-saumah@gmail.com \
    --to=saumah@gmail.com \
    --cc=gregkh@linuxfoundation.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 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.