[Linux-parport] Add wch382_2s PCI ID
Jeff Gustafson
ncjeffgus at zimage.com
Mon Dec 28 14:26:34 PST 2015
Hi all,
I purchased a two port PCIe serial board. Linux didn't seem to notice
it. I dug into the parport and tty/serial/8250 and added the PCI ID's.
Now the ports are working just fine.
I am also sending this patch to the linux-serial list since it touches
files in both locations.
...Jeff
>From ec862041a8c5cafda8b4f2eb7442a86e184d6294 Mon Sep 17 00:00:00 2001
From: Jeff Gustafson <ncjeffgus at zimage.com>
Date: Tue, 22 Dec 2015 17:12:00 -0800
Subject: [PATCH] Add wch382_2s PCI ID
---
drivers/parport/parport_serial.c | 10 ++++++++++
drivers/tty/serial/8250/8250_pci.c | 10 ++++++++++
2 files changed, 20 insertions(+)
diff --git a/drivers/parport/parport_serial.c
b/drivers/parport/parport_serial.c
index e15b484..65bb759 100644
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -65,6 +65,7 @@ enum parport_pc_pci_cards {
wch_ch353_1s1p,
wch_ch353_2s1p,
wch_ch382_2s1p,
+ wch_ch382_2s,
sunix_2s1p,
};
@@ -153,6 +154,7 @@ static struct parport_pc_pci cards[] = {
/* wch_ch353_1s1p*/ { 1, { { 1, -1}, } },
/* wch_ch353_2s1p*/ { 1, { { 2, -1}, } },
/* wch_ch382_2s1p*/ { 1, { { 2, -1}, } },
+ /* wch_ch382_2s*/ { 1, { { 2, -1}, } },
/* sunix_2s1p */ { 1, { { 3, -1 }, } },
};
@@ -260,6 +262,7 @@ static struct pci_device_id
parport_serial_pci_tbl[] = {
{ 0x4348, 0x5053, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
wch_ch353_1s1p},
{ 0x4348, 0x7053, 0x4348, 0x3253, 0, 0, wch_ch353_2s1p},
{ 0x1c00, 0x3250, 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p},
+ { 0x1c00, 0x3253, 0x1c00, 0x3253, 0, 0, wch_ch382_2s},
/*
* More SUNIX variations. At least one of these has part
number
@@ -504,6 +507,13 @@ static struct pciserial_board
pci_parport_serial_boards[] = {
.uart_offset = 8,
.first_offset = 0xC0,
},
+ [wch_ch382_2s] = {
+ .flags = FL_BASE0,
+ .num_ports = 2,
+ .base_baud = 115200,
+ .uart_offset = 8,
+ .first_offset = 0xC0,
+ },
[sunix_2s1p] = {
.flags = FL_BASE0|FL_BASE_BARS,
.num_ports = 2,
diff --git a/drivers/tty/serial/8250/8250_pci.c
b/drivers/tty/serial/8250/8250_pci.c
index 46ddce4..ea12088 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -2015,6 +2015,7 @@ pci_wch_ch38x_setup(struct serial_private *priv,
#define PCIE_VENDOR_ID_WCH 0x1c00
#define PCIE_DEVICE_ID_WCH_CH382_2S1P 0x3250
+#define PCIE_DEVICE_ID_WCH_CH382_2S 0x3253
#define PCIE_DEVICE_ID_WCH_CH384_4S 0x3470
#define PCI_VENDOR_ID_PERICOM 0x12D8
@@ -2734,6 +2735,14 @@ static struct pci_serial_quirk
pci_serial_quirks[] __refdata = {
.subdevice = PCI_ANY_ID,
.setup = pci_wch_ch38x_setup,
},
+ /* WCH CH382 2S card (16850 clone) */
+ {
+ .vendor = PCIE_VENDOR_ID_WCH,
+ .device = PCIE_DEVICE_ID_WCH_CH382_2S,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ .setup = pci_wch_ch38x_setup,
+ },
/* WCH CH384 4S card (16850 clone) */
{
.vendor = PCIE_VENDOR_ID_WCH,
@@ -3922,6 +3931,7 @@ static const struct pci_device_id blacklist[] = {
{ PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */
{ PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */
{ PCI_DEVICE(0x1c00, 0x3250), }, /* WCH CH382 2S1P */
+ { PCI_DEVICE(0x1c00, 0x3253), }, /* WCH CH382 2S */
{ PCI_DEVICE(0x1c00, 0x3470), }, /* WCH CH384 4S */
};
--
2.5.0
More information about the Linux-parport
mailing list